Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
HichemTab-tech wants to merge 6 commits into laravel:main
base: main
Choose a base branch
Loading
from HichemTab-tech:fix-mcp-commands-for-wsl

Conversation

Copy link

@HichemTab-tech HichemTab-tech commented Aug 14, 2025

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

ceilidhboy reacted with thumbs up emoji ceilidhboy reacted with heart emoji
Copy link

@HichemTab-tech thanks, man! Much appreciated! You saved some of my hair 🤣 I've installed Boost direct from your fork and it's now working perfectly in Junie on PhpStorm on Windows with the project under WSL2 on Ubuntu.

I can also confirm that it works flawlessly in Augment Code now as well 👏

I hope the Boost team can accept your PR soon so I can switch back to the canonical version.

HichemTab-tech reacted with heart emoji

Copy link
Author

@HichemTab-tech thanks, man! Much appreciated! You saved some of my hair 🤣 I've installed Boost direct from your fork and it's now working perfectly in Junie on PhpStorm on Windows with the project under WSL2 on Ubuntu.

I can also confirm that it works flawlessly in Augment Code now as well 👏

I hope the Boost team can accept your PR soon so I can switch back to the canonical version.

@ceilidhboy lol thanks, I'm glad that it helped.

ceilidhboy reacted with thumbs up emoji

Copy link

@ceilidhboy How do you set it up to give guidelines to Augment?

marciozotelli reacted with rocket emoji

Copy link

marciozotelli commented Aug 25, 2025
edited
Loading

@ceilidhboy How do you set it up to give guidelines to Augment?

To use the fork with the fix, point Composer directly to it. Add this to your composer.json.

There's no need to change the package to the fork. Just changing the arguments in mcp.json will work. In any case, the following explanation also includes the fork.

"repositories": [
 {
 "type": "vcs",
 "url": "https://github.com/HichemTab-tech/forked-from-boost.git"
 }
],
"require-dev": {
 "laravel/boost": "dev-fix-mcp-commands-for-wsl as 1.0.0"
}

Then run:

composer update laravel/boost --with-all-dependencies

For MCP setup with Junie/Augment in PhpStorm, add a config like this to .junie/mcp/mcp.json:

{
 "mcpServers": {
 "laravel-boost": {
 "command": "wsl.exe",
 "args": [
 "-d", "Ubuntu-24.04",
 "--cd", "/home/<your-wsl-path-to-project>",
 "--exec", "./vendor/bin/sail", "artisan", "boost:mcp"
 ]
 }
 }
}
spitfire64 reacted with thumbs up emoji

Copy link

ceilidhboy commented Aug 25, 2025
edited
Loading

@ceilidhboy How do you set it up to give guidelines to Augment?

So as @marciozotelli wrote, you first need to edit your composer.json and add the following repositories key and edit the version of laravel/boost as shown below:

{
 "require-dev": {
 "laravel/boost": "dev-fix-mcp-commands-for-wsl as 1.0.999"
 },
 "repositories": [
 {
 "type": "vcs",
 "url": "git@github.com:HichemTab-tech/forked-from-boost.git",
 "no-api": true
 }
 ]
}

Then run:

composer update -W laravel/boost

Then in Augment Code, add an MCP server called Laravel Boost with command below, using the absolute path to your PHP binary as the first parameter after wsl and the absolute path to the artisan command in your project directory:

wsl /usr/bin/php8.4 /your/absolute/Laravel/project/directory/artisan boost:mcp

You'll have to add an MCP server entry to each project, with the absolute path to the project's artisan command.

Optional bash script to detect Laravel and use the current directory

To make this even easier, I created a small bash script in a file laravel-boost-mcp which detects a Laravel project in the current directory and does the necessary, like this:

#!/bin/bash
# Laravel Boost MCP wrapper script
# Automatically detects Laravel project in current directory
if [ -f "./artisan" ]; then
 /usr/bin/php8.4 ./artisan boost:mcp
else
 echo "Error: No Laravel project found in current directory" >&2
 echo "Please run this from a Laravel project root directory" >&2
 exit 1
fi

I put it in directory ~/.local/bin/ and did a chmod +x ~/.local/bin/laravel-boost-mcp on it to make it executable. Now I can just call the script ~/.local/bin/laravel-boost-mcp as the command in the Augment MCP server field in every project that requires it.

Works like a charm!

spitfire64 reacted with thumbs up emoji HichemTab-tech reacted with rocket emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

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

AltStyle によって変換されたページ (->オリジナル) /