VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-phpstorm-copilot/2.4-multi-project-workflow

⇱ Multi-Project Workflow | invokable/laravel-boost-phpstorm-copilot | DeepWiki


Loading...
Last indexed: 28 February 2026 (57ef88)
Menu

Multi-Project Workflow

This document provides step-by-step instructions for managing multiple Laravel projects when using the laravel-boost-phpstorm-copilot package. It explains the architectural constraint of system-wide MCP configuration and the required workflow when switching between projects.

For information about the underlying architectural reason for this workflow, see Understanding System-Wide MCP Configuration. For initial setup of your first project, see Initial Configuration with boost:install.


The System-Wide Configuration Constraint

The mcp.json configuration file used by PhpStorm's GitHub Copilot plugin is stored in a system-wide location, not within individual Laravel projects. However, this configuration file contains absolute paths to a specific Laravel project's PHP binary and artisan file.

System-Wide Storage Locations:

Operating SystemMCP Configuration Path
macOS~/.config/github-copilot/intellij/mcp.json
Linux~/.config/github-copilot/intellij/mcp.json
Windows%LOCALAPPDATA%\github-copilot\intellij\mcp.json
WSL%LOCALAPPDATA%\github-copilot\intellij\mcp.json (Windows side)

Project-Specific Content:

The configuration contains entries like:


This means when you switch from Project A to Project B, the configuration still points to Project A's paths, causing GitHub Copilot to connect to the wrong project's MCP server.

Sources: README.md114-124 resources/boost/guidelines/core.blade.php5-32


Project Switching State Diagram

Diagram: Configuration State Transitions During Project Switching


Code Entity Mapping:

User ActionCode Entity InvokedFile Path
php artisan boost:installLaravel Boost commandProvided by laravel/boost
Agent selectionPhpStormCopilotServiceProvider::boot()src/PhpStormCopilotServiceProvider.php
Platform detectionPhpStormCopilot::systemDetectionConfig()src/PhpStormCopilot.php
PHP path resolutionPhpStormCopilot::getPhpPath()src/PhpStormCopilot.php
Artisan path resolutionPhpStormCopilot::getArtisanPath()src/PhpStormCopilot.php
Native file writePhpStormCopilot::installFileMcp()src/PhpStormCopilot.php
WSL file writeWithWSL::installMcpViaWsl()src/Concerns/WithWSL.php
Sail command wrappingPhpStormCopilot::transformSailCommand()src/PhpStormCopilot.php
WSL command wrappingWithWSL::transformMcpCommandForWsl()src/Concerns/WithWSL.php

Sources: README.md114-118 resources/boost/guidelines/core.blade.php23-28


Step-by-Step Project Switching Workflow

1. Switch to the New Project Directory

Navigate to your target Laravel project:


2. Run boost:install to Update Configuration

Execute the installation command to reconfigure mcp.json with the new project's paths:

Interactive Mode:


Select the following when prompted:

  • Features: AI Guidelines, Agent Skills, Boost MCP Server Configuration
  • Agent: PhpStorm with GitHub Copilot

Non-Interactive Mode (Recommended):


The --no-interaction flag skips all prompts and uses default selections.

3. Verify Configuration Update

Check that the configuration was written successfully:

PlatformVerification Command
macOS/Linuxcat ~/.config/github-copilot/intellij/mcp.json
Windowstype %LOCALAPPDATA%\github-copilot\intellij\mcp.json
WSLpowershell.exe -Command "Get-Content $env:LOCALAPPDATA\github-copilot\intellij\mcp.json"

The command and args[0] values should contain absolute paths pointing to your current project.

4. Resume Development

PhpStorm's GitHub Copilot will now connect to the correct project's MCP server when you use AI assistance features.

Sources: README.md96-118 resources/boost/guidelines/core.blade.php16-28


Command Options Reference

The boost:install command provided by Laravel Boost accepts flags for controlling installation behavior.

Diagram: Command Flag Processing


Flag Reference:

FlagInvokesOutputRequired for Switching
--guidelinesTemplate rendering from resources/boost/guidelines/core.blade.php.github/instructions/laravel-boost.instructions.mdOptional
--skillsSkill file operations.github/skills/ directoryOptional
--mcpPhpStormCopilot::installFileMcp() or WithWSL::installMcpViaWsl()System-wide mcp.json with absolute pathsRequired
--no-interactionSkips prompts in Laravel BoostNoneRecommended

Minimum Required Command:


Recommended Command:


Sources: README.md117 README.md120


Common Multi-Project Scenarios

Scenario 1: Daily Work Across Multiple Projects

Workflow:

  1. Morning: Work on Project A
  2. Afternoon: Switch to Project B for client demo
  3. Evening: Return to Project A for bug fix

Commands:


Scenario 2: Cloned Repository to New Location

Problem: You cloned a project to a new directory or machine. The old mcp.json points to the previous location.

Solution:


Scenario 3: Multiple Versions of Same Project

Example: Separate directories for main, staging, and feature-branch versions.

Workflow: Each directory requires separate boost:install execution when switching:


Sources: resources/boost/guidelines/core.blade.php23-28


Detection of Stale Configuration

The package installs AI guidelines that help GitHub Copilot detect configuration issues.

Diagram: Stale Configuration Detection Flow


Guideline Generation:

The guidelines file is created by the PhpStormCopilot agent during boost:install execution:

ComponentValue
Template sourceresources/boost/guidelines/core.blade.php5-32
Output location.github/instructions/laravel-boost.instructions.md
ContainsVerification instructions referencing PhpStormCopilot::mcpConfigPath() locations
PurposeInstruct Copilot to check mcp.json contains correct project paths

Warning Signs of Stale Configuration:

SymptomCause
MCP tools return data from different projectmcp.json points to wrong project's artisan file
File paths don't match current structurePhpStormCopilot::getArtisanPath() resolved to old project
Database operations affect wrong databaseWrong project's .env file being read
Generated code uses wrong namespaceContext from wrong project's composer.json

Sources: resources/boost/guidelines/core.blade.php1-33


Integration with Laravel Boost Update Command

Important Limitation: As of Laravel Boost 1.8+, the boost:update command does not update the MCP configuration file.


Reason: The boost:update command is designed for updating package-managed files within the project directory. The system-wide mcp.json is considered environment-specific configuration, not package-managed content.

Correct Command for MCP Updates:


Sources: README.md120


Configuration File Anatomy

When boost:install --mcp executes, the PhpStormCopilot agent generates the configuration through this call chain.

Diagram: MCP Configuration Generation Call Flow


Code Entity Reference:

MethodSignaturePurpose
PhpStormCopilot::systemDetectionConfig()public function systemDetectionConfig(): arrayReturns OS detection config arrays
PhpStormCopilot::mcpConfigPath()public function mcpConfigPath(array $environment): stringResolves OS-specific mcp.json path
PhpStormCopilot::getPhpPath()protected function getPhpPath(): stringReturns absolute PHP binary path
PhpStormCopilot::getArtisanPath()protected function getArtisanPath(): stringReturns absolute artisan file path
PhpStormCopilot::transformSailCommand()protected function transformSailCommand(string $command): stringWraps command with bash -c for Sail
PhpStormCopilot::removeEmptyArrays()protected function removeEmptyArrays(array $data): arrayRecursively removes empty arrays
PhpStormCopilot::installFileMcp()protected function installFileMcp(string $path, string $content): boolWrites file using Laravel File facade
WithWSL::isWSL()protected function isWSL(): boolChecks WSL_DISTRO_NAME environment variable
WithWSL::transformMcpCommandForWsl()protected function transformMcpCommandForWsl(string $command, array $args): arrayWraps with wsl.exe --cd PROJECT
WithWSL::installMcpViaWsl()protected function installMcpViaWsl(string $windowsPath, string $content): boolUses PowerShell to write Windows-side file

Sources: src/PhpStormCopilot.php src/Concerns/WithWSL.php src/PhpStormCopilotServiceProvider.php


Performance Considerations

The boost:install command is designed to be fast when run with --no-interaction:

OperationTypical Duration
Environment detection< 100ms
Path resolution< 50ms
File writing (Unix)< 50ms
File writing (WSL)200-500ms (requires PowerShell)
Total (non-interactive)< 1 second (standard), 1-2 seconds (WSL)

Optimization Tip: Create shell aliases for frequent project switches:



Verification Checklist

After running boost:install in a new project, verify the configuration:

CheckCommandExpected Result
MCP file existsSee OS-specific commands aboveFile exists
Contains current project pathCheck command/args in JSONAbsolute path to current project
PHP path is correctwhich php (Unix) or where php (Windows)Matches command in JSON
Artisan path is absoluteCheck args[0] in JSONFull path like /home/user/project/artisan
Laravel Boost respondsphp artisan boost:mcpStarts MCP server without errors

Sources: README.md122-124


Alternative Solution for Frequent Switchers

For developers who frequently switch between many projects, the repository recommends considering laravel-boost-copilot-cli which supports project-level MCP configuration instead of system-wide configuration.

This alternative eliminates the need to run boost:install when switching projects, as each project maintains its own configuration file.

Sources: README.md84