VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-copilot-cli/5.1-mcp-configuration-file

⇱ MCP Configuration File | invokable/laravel-boost-copilot-cli | DeepWiki


Loading...
Last indexed: 7 March 2026 (397730)
Menu

MCP Configuration File

The .github/mcp-config.json file defines MCP server connection parameters for GitHub Copilot CLI. Generated by boost:install, this file specifies the command, args, and tools configuration that enables Copilot CLI to spawn the boost:mcp server process.

Related documentation: Local Configuration Overrides for credential management, Environment Detection and Adaptation for environment-specific command resolution, Starting Copilot CLI for usage.

File Location and Structure

The file path .github/mcp-config.json is returned by CopilotCli::mcpConfigPath() at src/CopilotCli.php79-82 The file must be specified via --additional-mcp-config @.github/mcp-config.json for Copilot CLI to load the laravel-boost MCP server.

.github/
└── mcp-config.json

The file defines:

  1. MCP server connection parameters (type, command, args, env)
  2. Tool exposure configuration (tools: ["*"])

Omitting --additional-mcp-config prevents Copilot CLI from loading the laravel-boost server and its tools.

Sources: src/CopilotCli.php79-82 README.md55-59 .github/copilot-instructions.md37-39

JSON Structure

mcpServers Configuration Block

Diagram: CopilotCli::mcpServerConfig() return array structure


The mcpServers object contains server definitions keyed by server name. The "laravel-boost" key is the MCP server identifier displayed in Copilot CLI startup output: Configured MCP servers: laravel-boost.

Sources: .github/mcp-config.json1-14 .github/copilot-instructions.md37-90 src/CopilotCli.php91-103

Field Definitions

FieldTypeRequiredValuePurpose
typestringYes"local"MCP server connection type (local process spawn)
commandstringYes"php", "./vendor/bin/testbench", "./vendor/bin/sail"Executable path resolved by convertCommandToPhpPath()
argsstring[]Yes["artisan", "boost:mcp"] or ["boost:mcp"]Command arguments, filtered by isRunningInTestbench()
toolsstring[]Yes["*"]Tool exposure filter (wildcard exposes all tools)
envobjectNo{}Environment variables passed to subprocess

The type field value "local" instructs Copilot CLI to spawn a local subprocess. The tools field value ["*"] enables all MCP tools provided by boost:mcp without filtering. The command field value is computed by src/CopilotCli.php108-122

Sources: .github/copilot-instructions.md39 src/CopilotCli.php91-103

Configuration Generation

The CopilotCli::mcpServerConfig() method at src/CopilotCli.php91-103 generates the configuration array that is serialized to .github/mcp-config.json.

Diagram: Configuration generation call chain


Configuration construction logic:

  • Line 94: 'type' => 'local' (constant value)
  • Line 95: 'command' resolved by convertCommandToPhpPath($command)
  • Lines 96-99: 'args' filters 'artisan' element based on isRunningInTestbench() return value
  • Line 100: 'env' passes through environment variables
  • Line 101: 'tools' => ['*'] (constant value)

Sources: src/CopilotCli.php91-103 src/CopilotCli.php108-122 src/CopilotCli.php133-140 src/CopilotCli.php124-131

Environment-Specific Configurations

Standard Laravel Application

For standard Laravel installations on macOS, Linux, or WSL:


The command php with arguments ["artisan", "boost:mcp"] executes php artisan boost:mcp to spawn the MCP server.

Sources: .github/copilot-instructions.md41-53 README.md52-53

Laravel Sail Environment

For Docker-based development with Laravel Sail:


The Sail wrapper script at ./vendor/bin/sail executes Artisan commands inside the Docker container. The detection logic at src/CopilotCli.php118-120 checks if the command ends with 'sail' to preserve this path.

Sources: .github/copilot-instructions.md55-72 src/CopilotCli.php108-122

Orchestra Testbench Environment

For package development using Testbench:


Critical difference: The args array contains only ["boost:mcp"], omitting 'artisan'. This is because the testbench binary handles the Artisan command invocation internally. The filtering logic at src/CopilotCli.php96-99 removes 'artisan' when isRunningInTestbench() returns true.

Sources: .github/copilot-instructions.md74-90 .github/mcp-config.json1-14 docs/testbench.md61-78

Command Resolution Logic

Diagram: convertCommandToPhpPath() decision tree


The convertCommandToPhpPath() method at src/CopilotCli.php108-122 resolves the command field through cascading conditionals:

PriorityCheckMethodReturn Value
1defined('TESTBENCH_CORE')isRunningInTestbench() src/CopilotCli.php133-140"./vendor/bin/testbench"
2getenv('WSL_DISTRO_NAME') || getenv('IS_WSL')isRunningInsideWsl() src/CopilotCli.php124-131getPhpPath() (from Agent base class)
3Str::afterLast($command, '/') === 'sail'Inline check src/CopilotCli.php118-120"./vendor/bin/sail"
4Default-$command parameter value (typically "php")

Sources: src/CopilotCli.php108-122 src/CopilotCli.php124-131 src/CopilotCli.php133-140

Runtime MCP Server Connection

Diagram: Copilot CLI MCP server initialization and tool invocation


Copilot CLI parses the mcpServers configuration object and spawns subprocesses for each defined server. The server key "laravel-boost" becomes the server identifier displayed in CLI output: Configured MCP servers: laravel-boost. The tools: ["*"] configuration enables all tools advertised by the MCP server.

Sources: README.md55-71 .github/copilot-instructions.md1-6 .ai/guidelines/copilot-cli.blade.php1-10

Tool Exposure Configuration

The tools field value ["*"] is hardcoded at src/CopilotCli.php101 to expose all MCP tools without filtering:


The wildcard value ["*"] instructs Copilot CLI to enable all tools advertised by the boost:mcp server during the MCP handshake. Tool availability at runtime depends on the environment (standard Laravel application vs Orchestra Testbench). See Tool Availability by Environment for environment-specific tool limitations.

Sources: src/CopilotCli.php91-103 .github/mcp-config.json9-11

Configuration File Management

Version Control

The .github/mcp-config.json file should be committed to version control as it contains project-specific, non-sensitive configuration. It is automatically generated during boost:install and can be regenerated by running the command again.

Local Overrides

For sensitive credentials or local customizations, use .github/mcp-config.local.json instead. This file should be added to .gitignore to prevent credential leaks. See Local Configuration Overrides for implementation details.

Sources: README.md101-124