VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-copilot-cli/2.3-starting-copilot-cli

⇱ Starting Copilot CLI | invokable/laravel-boost-copilot-cli | DeepWiki


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

Starting Copilot CLI

This page explains how to properly start GitHub Copilot CLI with Laravel Boost MCP integration enabled. The --additional-mcp-config flag is mandatory for accessing Laravel Boost tools through the MCP server. For environment-specific command variations (standard Laravel, Sail, Testbench), see page 2.4. For details about the .github/mcp-config.json file structure, see page 5.1. </old_str> <new_str>

Starting Copilot CLI

This page explains how to properly start GitHub Copilot CLI with Laravel Boost MCP integration enabled. The --additional-mcp-config flag is mandatory for accessing Laravel Boost tools through the MCP server. For environment-specific command variations (standard Laravel, Sail, Testbench), see page 2.4. For details about the .github/mcp-config.json file structure, see page 5.1.

Critical Configuration Requirement

The --additional-mcp-config flag is required for every Copilot CLI session. Without this flag, the laravel-boost MCP server will not load, and all Laravel Boost tools will be unavailable. This is not an optional enhancement—it is the sole mechanism through which Copilot CLI discovers and connects to the MCP server defined in .github/mcp-config.json.

Why the Flag is Required

GitHub Copilot CLI does not automatically discover MCP server configurations in project directories. The MCP server connection must be explicitly declared at startup using the --additional-mcp-config option with a path to the configuration file.

Diagram: Copilot CLI Startup Process — MCP Server Connection Flow


Sources: README.md55-71 .github/copilot-instructions.md6-13 .github/instructions/laravel-boost.instructions.md6-13

Basic Usage

Start Copilot CLI by explicitly specifying the MCP configuration file:


The @ prefix indicates a file path reference. The command expects .github/mcp-config.json to exist in the current working directory and contain valid MCP server configuration.

Sources: README.md55-59

Verifying Successful Connection

When Copilot CLI starts with MCP configuration correctly loaded, it displays a confirmation message:

Configured MCP servers: laravel-boost

This message indicates that:

  1. The .github/mcp-config.json file was successfully parsed
  2. The MCP server process (php artisan boost:mcp or equivalent) was spawned
  3. Laravel Boost tools are now available for AI tool calls

If this message does not appear, the MCP server is not connected. See page 7.4 for resolution steps.

Sources: README.md61-63

Combining with Other Flags

The --additional-mcp-config flag can be combined with any other Copilot CLI flags:

CommandPurpose
copilot --additional-mcp-config @.github/mcp-config.json --resumeResume previous conversation with MCP enabled
copilot --additional-mcp-config @.github/mcp-config.json --continueContinue last conversation with MCP enabled
copilot --additional-mcp-config @.github/mcp-config.json --model=gpt-4Use specific model with MCP enabled

The --additional-mcp-config option must be included in every invocation to maintain access to Laravel Boost tools.

Sources: README.md63-71

Automating Configuration Loading

To avoid manually specifying the MCP configuration file on every command, create a shell function that automatically detects and loads configuration files when present in the project directory.

Shell Function Implementation

Add the following function to .bashrc or .zshrc:


This function:

  1. Checks for .github/mcp-config.json in the current directory
  2. Checks for .github/mcp-config.local.json (for sensitive credentials)
  3. Adds appropriate --additional-mcp-config flags if files exist
  4. Passes through all additional arguments to the copilot command

Usage After Shell Function Setup


Diagram: copilot_mcp() Shell Function — File Detection and Argument Construction


Sources: README.md76-99

Local Configuration for Sensitive Credentials

For MCP servers requiring authentication headers or API tokens, use .github/mcp-config.local.json to store sensitive configuration separately from version control.

Setup Local Configuration

  1. Create .github/mcp-config.local.json with sensitive credentials:

  1. Add to .gitignore:

Configuration Precedence

When both .github/mcp-config.json and .github/mcp-config.local.json exist:

ConfigurationPurposeVersion ControlServer Definition
.github/mcp-config.jsonProject-wide MCP serversCommitted to repositorylaravel-boost (local)
.github/mcp-config.local.jsonUser-specific MCP serversExcluded from repositoryAdditional servers with credentials

The copilot_mcp() shell function automatically loads both files when present, allowing the combination of shared project configuration and private user configuration.

Diagram: Configuration File Layering — Version Control and Local Overrides


Sources: README.md101-124

MCP Configuration File Structure (Summary)

The .github/mcp-config.json file generated by boost:install defines the MCP server connection. The command and args values depend on the detected runtime environment (see page 2.4 for all variants). The standard Laravel configuration is:
































FieldRequiredDescription
typeYeslocal for a subprocess; http for a remote server
commandYes (local)Executable that starts the MCP server
argsNoArguments passed to command
toolsYes["*"] grants access to all exposed tools

The CopilotCli class (src/CopilotCli.php) determines the correct command/args values at install time based on environment detection. Full details are on page 5.1 and page 5.4.

Sources: .github/mcp-config.json1-13 .github/copilot-instructions.md37-90

What Happens After Startup

Once Copilot CLI successfully loads the MCP configuration:

  1. MCP Server Process Spawned: The command specified in mcp-config.json (e.g., php artisan boost:mcp) starts as a background process
  2. MCP Protocol Communication Established: Copilot CLI communicates with the server using JSON-RPC over stdin/stdout
  3. Tools Registration: The MCP server exposes all Laravel Boost tools to Copilot CLI
  4. AI Context Enhancement: The AI can now call Laravel Boost tools to retrieve application-specific context

For details on available tools, see page 3.1. For understanding the protocol-level communication, see page 4.4.

Sources: README.md55-71 .github/copilot-instructions.md1-13