VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-copilot-cli/2.4-environment-specific-setup

⇱ Environment-Specific Setup | invokable/laravel-boost-copilot-cli | DeepWiki


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

Environment-Specific Setup

This page covers the configuration differences and setup procedures for running Laravel Boost Copilot CLI in different environments: standard Laravel applications, Laravel Sail (Docker), Windows Subsystem for Linux (WSL), and Orchestra Testbench (package development). Each environment requires specific MCP server configuration and command paths to function correctly.

For information about the initial installation process, see Installation. For details on the generated configuration files, see Configuration Generation. For environment detection implementation details, see Environment Detection and Adaptation.

Environment Overview

The package automatically detects the current environment and generates appropriate MCP server configuration. The primary differences between environments are the command executable paths and arguments used in .github/mcp-config.json.


Sources: src/CopilotCli.php91-122 README.md20-33 .github/copilot-instructions.md38-90

Environment Detection Flow

The CopilotCli class performs environment detection during MCP configuration generation. The detection logic determines which command path and arguments to use.


Sources: src/CopilotCli.php91-122 src/CopilotCli.php124-140

Standard Laravel Application

A standard Laravel application uses the default PHP executable and artisan to run the MCP server.

Configuration

The generated .github/mcp-config.json for a standard Laravel application:


Starting Copilot CLI


Characteristics

AspectDetails
Commandphp
Arguments["artisan", "boost:mcp"]
Full Application Context✓ Available
Database Access✓ Full access to configured databases
Application Models✓ All application models available
MCP Tool Availability✓ All tools fully functional

Sources: README.md10-24 .github/copilot-instructions.md41-52

Laravel Sail

Laravel Sail runs Laravel inside Docker containers. The MCP server must be invoked through the sail wrapper script to execute inside the container.

Configuration

The generated .github/mcp-config.json for Laravel Sail:


Prerequisites

Before using Copilot CLI with Sail, ensure Docker containers are running:


Starting Copilot CLI

The copilot command runs on the host machine (outside Docker), while the MCP server executes inside the Sail container:


Detection Logic

The package detects Sail usage by checking if the command path ends with sail:

src/CopilotCli.php118-120

Characteristics

AspectDetails
Command./vendor/bin/sail
Arguments["artisan", "boost:mcp"]
Execution ContextMCP server runs inside Docker container
Host Requirementcopilot CLI runs on host machine
Docker Requirement✓ Containers must be running (sail up -d)
Full Application Context✓ Available
Database Access✓ Access to databases defined in docker-compose.yml
MCP Tool Availability✓ All tools fully functional

Sources: README.md27-29 .github/copilot-instructions.md55-72 src/CopilotCli.php118-121

Windows Subsystem for Linux (WSL)

When running inside WSL, the package automatically converts PHP paths to ensure proper execution from the Windows host where GitHub Copilot CLI runs.

Configuration

The MCP configuration uses the converted PHP path suitable for cross-platform execution:


Detection Logic

WSL detection checks for environment variables WSL_DISTRO_NAME or IS_WSL:

src/CopilotCli.php124-131

Path Conversion

When WSL is detected, the package calls getPhpPath() to obtain the appropriate PHP executable path for cross-platform execution:

src/CopilotCli.php114-116

Characteristics

AspectDetails
DetectionVia WSL_DISTRO_NAME or IS_WSL environment variables
CommandPHP path returned by getPhpPath()
Path Conversion✓ Automatic PHP path conversion for Windows interoperability
Arguments["artisan", "boost:mcp"]
Full Application Context✓ Available
Database Access✓ Full access to configured databases
Recommendation✓ Recommended for Windows users
Native Windows Support✓ Supported but WSL recommended

Sources: README.md22-25 src/CopilotCli.php124-131 src/CopilotCli.php114-116

Orchestra Testbench

Orchestra Testbench provides a minimal Laravel environment for package development. This environment differs significantly from standard Laravel applications and has important limitations.

Configuration

The generated .github/mcp-config.json for Testbench uses ./vendor/bin/testbench instead of php artisan:


Note that the args array contains only ["boost:mcp"] without "artisan" since Testbench commands are invoked directly.

Detection Logic

Testbench detection checks for the TESTBENCH_CORE constant:

src/CopilotCli.php133-140

MCP Server Configuration Generation

The mcpServerConfig() method conditionally includes "artisan" in the arguments array based on the Testbench detection result:

src/CopilotCli.php96-99

Setup Process

Recommended Setup (with workbench)

Create the Testbench workbench environment:


Add the build script to post-autoload-dump in composer.json:


Run the installation:


Alternative Setup (array cache)

For minimal setup without workbench, configure array cache in testbench.yaml:


Then run:


Environment Limitations


Tool Availability

MCP ToolAvailabilityNotes
application-info✓ FunctionalReturns basic Laravel environment information
list-artisan-commands✓ FunctionalLists available Artisan commands
search-docs✓ FunctionalSearches Laravel documentation
tinker✓ FunctionalBasic REPL functionality
database-query⚠️ LimitedNo application-specific database/models
database-schema⚠️ LimitedShows minimal schema if configured
list-routes⚠️ LimitedNo application-specific routes
browser-logs✗ Not AvailableNo browser testing context
get-absolute-url⚠️ LimitedNo application-specific routes

AI Guidelines Adaptation

The AI guidelines template automatically detects the Testbench environment and adjusts instructions:

.ai/guidelines/copilot-cli.blade.php11-21

The Blade directive @if(defined('TESTBENCH_CORE')) provides environment-specific guidance to the AI about tool limitations.

Characteristics

AspectDetails
Command./vendor/bin/testbench
Arguments["boost:mcp"] (no "artisan")
Detection ConstantTESTBENCH_CORE
Use CaseLaravel package development
Application Context✗ No full application
Database⚠️ Minimal (SQLite via workbench:build or array cache)
Application Models✗ Not available
Application Routes✗ Not available
Basic MCP Tools✓ Functional
Application-Specific Tools⚠️ Limited or unavailable

Sources: docs/testbench.md1-87 src/CopilotCli.php133-140 src/CopilotCli.php96-99 .ai/guidelines/copilot-cli.blade.php11-21

Configuration Comparison

The following table summarizes the key configuration differences across all supported environments:

EnvironmentCommandArgsDetection MethodFull App ContextUse Case
Standard Laravelphp["artisan", "boost:mcp"]Default (no special conditions)Production Laravel applications
Laravel Sail./vendor/bin/sail["artisan", "boost:mcp"]Command basename = sailDocker-based development
WSLgetPhpPath() result["artisan", "boost:mcp"]WSL_DISTRO_NAME or IS_WSL env varsWindows development via WSL
Testbench./vendor/bin/testbench["boost:mcp"]TESTBENCH_CORE constantPackage development

Code Path Decision Tree


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

Verification

After running php artisan boost:install (or vendor/bin/testbench boost:install for Testbench), verify the generated configuration matches your environment by examining .github/mcp-config.json.

When starting Copilot CLI, look for this confirmation message:

Configured MCP servers: laravel-boost

If the server appears in the configuration, the environment-specific setup was successful.

Sources: README.md61 docs/testbench.md84-86