laravel/boost

WSL and docker

Closed this issue · 15 comments

Any plans to support WSL and Docker setup ?

in my setup on WSL I have to ran command docker compose exec php-fpm php artisan do run artisan commands. However windows docker is triggered.
Cannot run program "C:\Program Files\Docker\Docker\resources\bin\docker": CreateProcess error=193, %1 is not a valid Win32 application

It seems it works for me, but you need to change the default mcp.json file.

For cursor + wsl + docker for me is that:

{
  "mcpServers": {
    "laravel-boost": {
      "command": "docker",
      "args": [
        "exec",
        "-i",
        "-u",
        "www-data",
        "laravel_app",
        "php",
        "artisan",
        "boost:mcp"
      ]
    }
  }
}

@tdrabikdev
if you are using sail.
can you try this config and let me know if this works.

{
    "mcpServers": {
        "laravel-boost": {
            "command": "./vendor/bin/sail",
            "args": [
                "artisan",
                "boost:mcp"
            ]
        }
    }
}

you manually have to update the mcp config with above and this should work.
Feel free to reopen issue if it's exists after implementing above solution.

We are tracking sail support in this MR #83

@tdrabikdev if you are using sail. can you try this config and let me know if this works.

{
    "mcpServers": {
        "laravel-boost": {
            "command": "./vendor/bin/sail",
            "args": [
                "artisan",
                "boost:mcp"
            ]
        }
    }
}

you manually have to update the mcp config with above and this should work. Feel free to reopen issue if it's exists after implementing above solution.

We are tracking sail support in this MR #83

Unfortunately not:

Image

@gigerIT PHPstrom needs absolute path in the config. can you replace it with complete path ? /xyz/vendor/bin/sail ?

if you can check this on another code editor this should work. for eg. claude and cursor.|

Let me know.

@gigerIT PHPstrom needs absolute path in the config. can you replace it with complete path ? /xyz/vendor/bin/sail ?

if you can check this on another code editor this should work. for eg. claude and cursor.|

Let me know.

With the full path specified in PhpStorm, the issue remains:

Image

(PhpStorm somehow converts the forward slashes from the config to backslashes in the error message, which might indicate that it’s trying to run it on the Windows host rather than the WSL2 instance.)

Same in VS Code (with both the relative and full path):

Image
2025-08-14 10:12:13.419 [info] Starting server laravel-boost
2025-08-14 10:12:13.420 [info] Connection state: Starting
2025-08-14 10:12:13.429 [info] Starting server from Remote extension host
2025-08-14 10:12:14.505 [info] Connection state: Starting
2025-08-14 10:12:14.513 [info] Connection state: Error spawn ./vendor/bin/sail ENOENT

Trying it with:

{
    "mcpServers": {
        "laravel-boost": {
            "command": "docker",
            "args": [
                "exec",
                "-i",
                "tfs-app-v2-laravel.tfs-1",
                "php",
                "/var/www/html/artisan",
                "boost:mcp"
            ]
        }
    }
}

As suggested in #36
returns:

Image

So PhpStorm definitely tries to run the command from the host instead of the WSL2 instance.

I have it working on my WSL Docker setup with PHPStorm. I have PHP running in a container called 'php' so replace the first occurrence below with your container name.

{
    "mcpServers": {
        "laravel-boost": {
            "command": "wsl.exe",
            "args": [
                "docker",
                "compose",
                "-f", "/home/USERNAME/projects/docker-compose.yml",
                "run",
                "-i",
                "--rm",
                "--user", "1000:1000",
                "php",
                "php",
                "artisan",
                "boost:mcp"
            ]
        }
    }
}

I have it working on my WSL Docker setup with PHPStorm. I have PHP running in a container called 'php' so replace the first occurrence below with your container name.

{
    "mcpServers": {
        "laravel-boost": {
            "command": "wsl.exe",
            "args": [
                "docker",
                "compose",
                "-f", "/home/USERNAME/projects/docker-compose.yml",
                "run",
                "-i",
                "--rm",
                "--user", "1000:1000",
                "php",
                "php",
                "artisan",
                "boost:mcp"
            ]
        }
    }
}

No luck unfortunately

Image

I ran into similar issues running the MCP server in DDEV on macOS.

This configuration worked for me:

{
  "mcpServers": {
    "laravel-boost": {
      "command": "/opt/homebrew/bin/docker",
      "args": [
        "exec",
        "-i",
        "ddev-project.local-web",
        "php",
        "-d", "output_buffering=0",
        "-d", "implicit_flush=1",
        "/var/www/html/artisan",
        "boost:mcp",
        "--no-ansi",
        "-q"
      ]
    }
  }
}

If you’re on Windows (WSL), you’ll need to adjust the command accordingly, and replace ddev-project.local-web with your actual container name.

Hopefully this helps you get it running!

This was helpful, thank you. I was able to adapt a working version for WSL2 with Sail.

With this PhpStorm configuration:

{
    "mcpServers": {
        "laravel-boost": {
            "command": "wsl.exe",
            "args": [
                "docker",
                "exec",
                "-i",
                "YOUR_SAIL_APP_CONTAINER_NAME",
                "php",
                "-d", "output_buffering=0",
                "-d", "implicit_flush=1",
                "/var/www/html/artisan",
                "boost:mcp",
                "--no-ansi",
                "-q"
            ]
        }
    }
}

Okay what works for me:

{
  "mcpServers": {
    "laravel-boost": {
      "command": "wsl.exe",
      "args": [
        "docker",
        "exec",
        "-i",
        "CONTAINER_ID",
        "php",
        "-d", "output_buffering=0",
        "-d", "implicit_flush=1",
        "artisan",
        "boost:mcp",
        "--no-ansi",
        "-q"
      ]
    }
  }
}```

{
"mcpServers": {
"laravel-boost": {
"command": "docker",
"args": [
"exec",
"-i",
"tfs-app-v2-laravel.tfs-1",
"php",
"/var/www/html/artisan",
"boost:mcp"
]
}
}
}

StandaloneCoroutine was cancelled Now i am getting this. Any idea ?

this is my version on mac + docker, starting from yours @PatrickNetzDesign; thx

{
    "mcpServers": {
        "laravel-boost": {
            "command": "docker",
            "args": [
                "exec",
                "-i",
                "myapp-shop-php-1",
                "php",
                "-d", "output_buffering=0",
                "-d", "implicit_flush=1",
                "/var/www/html/artisan",
                "boost:mcp",
                "--no-ansi",
                "-q"
            ]
        }
    }
}

I ran into similar issues running the MCP server in DDEV on macOS.

This configuration worked for me:

{
"mcpServers": {
"laravel-boost": {
"command": "/opt/homebrew/bin/docker",
"args": [
"exec",
"-i",
"ddev-project.local-web",
"php",
"-d", "output_buffering=0",
"-d", "implicit_flush=1",
"/var/www/html/artisan",
"boost:mcp",
"--no-ansi",
"-q"
]
}
}
}

If you’re on Windows (WSL), you’ll need to adjust the command accordingly, and replace ddev-project.local-web with your actual container name.

Hopefully this helps you get it running!

This issue seams to be verry simular to #105. I wrote a litte comment there on how to setup WSL2, PHP-Storm with Junie and laravel sail (the docker service in my case ist running on Ubuntu without Docker for Windows, but that should also work).

just see the solution for that case there

Using Docker desktop + WSL and own docker image, working ✅

webserver is the name of my service inside my compose.yml stack.

        "laravel-boost": {
            "command": "docker",
            "args": [
                "compose",
                "exec",
                "webserver",
                "php",
                "artisan",
                "boost:mcp"
            ]
        }