Black Friday: the Laravel testing course is $149 instead of $249, through Dec 7. See the course →
logo

How can you run Laravel Boost's MCP server in a Docker container?

Use this sample config

Joel Clermont
Joel Clermont
2025-10-07

From our daily Laravel tips email. Get the next one in your inbox.

I recently installed Laravel Boost on a project and one of the things I wanted to play with was the MCP server.

But when I tried to get Claude Code to list the available tools, it had a problem connecting to the MCP server, which was running in a Docker container.

The default .mcp.json configuration assumed that the MCP server could be started via PHP running on the host machine.

In order to make it work, I had to change that file to reflect running the command via Docker:

{
    "mcpServers": {
        "laravel-boost": {
            "command": "docker",
            "args": [
                "exec",
                "-i",
                "CONTAINER_NAME",
                "php",
                "artisan",
                "boost:mcp"
            ]
        }
    }
}

If you're going to use this, make sure to replace CONTAINER_NAME with the name of your PHP Docker container.

One other important detail that I got wrong the first time is the -i flag to docker exec. This flag is necessary to keep stdin open without a terminal session, which is required for the MCP server to work properly.

Here to help,

Joel

P.S. We recently published a new volume of our Laravel tips ebook. Pick up the new volume each quarter and collect them all.

Want a tip like this in your inbox every weekday?

Each one takes less than 2 minutes to read. Join 4,000+ Laravel developers who already get them.

email
No spam. Only real-world advice.
Toss a coin in the jar if you found this helpful.