Laravel Boost accelerates AI-assisted development by providing the essential guidelines and agent skills that help AI agents write high-quality Laravel applications. It includes a built-in MCP (Model Context Protocol) server that gives your AI coding agent access to your application's structure, database, routes, and over 17,000 pieces of Laravel-specific documentation — all enhanced by semantic search.
Because Spin runs your Laravel application inside Docker containers, the MCP server needs to run inside the container where PHP and Artisan are available. This guide walks you through installing Boost and configuring the MCP server for your preferred AI coding tool.
First, install the Laravel Boost package via Composer:
spin run php composer require laravel/boost --dev
Next, install the MCP server and coding guidelines. When prompted, select the AI agents you plan to use (Cursor, Claude Code, etc.):
spin run php php artisan boost:install
The boost:install command generates the relevant guideline and skill files for the coding agents you selected. Feel free to add the generated configuration files to your .gitignore since they are automatically regenerated when running boost:install or boost:update.
Laravel Boost's MCP server uses stdio (standard input/output) as its transport — not an HTTP port. This means your AI coding tool communicates with the MCP server by sending and receiving data directly through the process's stdin and stdout streams, much like a conversation over a pipe.
Since Spin runs PHP inside a Docker container, we need a way to bridge your host machine (where the IDE runs) to the container (where PHP and Artisan live). The spin exec -T command does exactly this — it runs the Artisan command inside the container while keeping the stdio streams connected back to your workstation. The -T flag disables pseudo-TTY allocation, which is critical because TTY mode would interfere with the raw stdio data that the MCP protocol relies on.
There's one more complication: AI coding tools typically start their MCP servers as soon as the IDE opens. At that point, your Spin containers might not be running yet. If the MCP command fails because the container isn't ready, the IDE may not retry it automatically.
To handle both of these concerns, we use a lightweight wrapper script that:
spin exec -TCreate a file called boost-mcp.sh in the root of your project:
#!/usr/bin/env bash
while true; do
spin exec -T php php artisan boost:mcp 2>/dev/null
exit_code=$?
if [ $exit_code -eq 0 ]; then
break
fi
sleep 3
done
Make the script executable:
chmod +x boost-mcp.sh
Once the wrapper script is in place, you need to tell your AI coding tool how to start the MCP server. Every tool has its own configuration file and location — there is no universal standard. However, the concept is the same across all of them: register an MCP server that runs bash boost-mcp.sh via stdio transport.
spin up (or spin up -d) before using your AI coding tool. The wrapper script will wait for the container to be available, but the containers must eventually come online for the MCP connection to succeed.Regardless of which tool you use, the important values are always the same:
| Property | Value |
|---|---|
| Command | bash |
| Args | boost-mcp.sh |
| Transport | stdio |
Cursor stores its MCP configuration at .cursor/mcp.json inside your project. Create or update this file:
{
"mcpServers": {
"laravel-boost": {
"command": "bash",
"args": ["boost-mcp.sh"]
}
}
}
After saving this file, enable the MCP server in Cursor:
Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux)laravel-boostClaude Code can be configured with the CLI. From your project directory, run:
claude mcp add --transport stdio --scope local laravel-boost -- bash boost-mcp.sh
Each tool has its own way of registering MCP servers. For Codex, Gemini CLI, GitHub Copilot, Junie, and others, refer to the official Laravel Boost documentation for their specific setup steps. The only difference with Spin is that your command should point to the boost-mcp.sh wrapper script instead of running php artisan boost:mcp directly.
As you update Laravel packages in your project, you should periodically update your local Boost resources to keep the AI guidelines and skills current:
spin run php php artisan boost:update
You can also automate this by adding it to your Composer post-update-cmd scripts:
{
"scripts": {
"post-update-cmd": [
"@php artisan boost:update --ansi"
]
}
}
Laravel Boost offers much more than what's covered here, including custom AI guidelines, agent skills, and a powerful documentation API. For the full reference, visit the official Laravel Boost documentation.
Migrating from Spin v2 to v3
Although Spin v3 doesn't ship with any breaking changes, there is a new structure for managing your configurations with Spin that you may want to upgrade to take advantage of.
Laravel Horizon
Laravel Horizon is a beautiful dashboard and configuration system for your Laravel queues. It provides dashboard and code-driven configuration for your Laravel powered Redis queues.