Skip to content

Enhance MCP commands for WSL compatibility #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HichemTab-tech
Copy link

Description:

This PR updates Laravel Boost’s MCP server command configuration to ensure compatibility when running inside WSL. Instead of relying on PhpStorm to directly execute the WSL PHP binary (which fails due to path and process resolution differences), the changes adjust the mcp.json command to invoke PHP in a way that works in both native and WSL environments.

Key changes:

  • Added a isRunningInWsl().
  • When running under WSL, set the MCP command to "wsl" instead of "php", and pass the PHP binary path as the first argument.
  • Introduced a $forceAbsolutePath option to ensure the PHP binary/artisan path is absolute when in WSL mode.
  • Preserved the original "php" command for non-WSL environments to maintain backward compatibility.

While this issue was reproduced in PhpStorm, the fix applies to any IDE that runs the MCP command directly without WSL resolution.

Fixes #120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated mcp.json is not compatible with Windows + WSL development environments
1 participant