Laravel Boost MCP — Let AI Agents Understand Your Codebase
AI assistants like Cursor and Claude Code write decent generic PHP. They fall apart with Laravel — ask a question about your models and get a hallucinated accessor back, or suggest Route::resource() when your routes are already defined a different way. The problem isn't the model, it's missing context. Laravel Boost is an MCP server that runs locally and gives AI agents structured access to your app's internals so they stop guessing.
Worth being clear on the distinction up front: Boost is not the same as laravel/mcp, which lets your app act as an MCP server for external AI clients. Boost is a dev-only tool that feeds context about your codebase into your editor's AI assistant.
Install Laravel Boost MCP
Boost is a dev dependency only — nothing changes in production:
composer require laravel/boost --dev
php artisan boost:install
The install command is interactive. It reads your composer.json, detects which packages you have installed, then asks which AI editors you use. Pick the right ones — it generates the correct config files for each agent (.mcp.json for most, plus CLAUDE.md, AGENTS.md, etc. as needed).
If you're running Laravel Sail, use sail artisan instead of plain php artisan to preserve the Sail-specific rules in generated guidelines:
./vendor/bin/sail artisan boost:install
Keep skills and guidelines current as Laravel releases happen:
php artisan boost:update
Add this to your composer.json post-update scripts so it runs automatically after every composer update:
{
"scripts": {
"post-update-cmd": [
"@php artisan boost:update --ansi"
]
}
}
One thing worth clarifying: Boost helps you write better Laravel code, while the Laravel AI SDK is what you'd reach for to add AI features that your users actually interact with at runtime. Different tools, different jobs.
Connect to Your AI Editor
The boost:install command auto-generates the right config for whatever agents you selected. If your editor needs manual wiring:
Claude Code:
claude mcp add -s local -t stdio laravel-boost php artisan boost:mcp
Cursor:
Open the command palette (Cmd+Shift+P), run "Open MCP Settings", and toggle on laravel-boost.
Any MCP-compatible editor (Windsurf, GitHub Copilot Chat, etc.):
{
"mcpServers": {
"laravel-boost": {
"command": "php",
"args": ["artisan", "boost:mcp"]
}
}
}
If php isn't on your system PATH — common with Herd or custom local setups — use the absolute path instead:
{
"mcpServers": {
"laravel-boost": {
"command": "/Users/you/.config/herd/bin/php",
"args": ["artisan", "boost:mcp"]
}
}
}
Boost is one of those tools that quietly earns its place in the standard Laravel development environment — not flashy, but you'll notice when it's not there.
What the Laravel Boost MCP Server Exposes
Once connected, Boost registers a set of MCP tools your editor can call automatically during a conversation. The most useful ones:
| Tool | What it gives the agent |
|---|---|
| Application Info | PHP and Laravel versions, installed packages, registered Eloquent models |
| Database Schema | Full schema including column types, defaults, and indexes |
| Database Query | Execute read-only queries to inspect actual data |
| Last Error | Most recent exception from your application logs |
| Read Log Entries | Last N log lines — useful when tracing a bug |
| Search Docs | Semantic search across 17,000+ pieces of current Laravel ecosystem docs |
The Search Docs tool is the one that surprises people most. When you ask the agent about a package that released a new API recently, it queries the hosted documentation index rather than falling back on training data from months ago. It covers Laravel 10–12, Livewire 2–4, Inertia, Pest, Filament, Nova, Tailwind, and more — with versioned results.
Beyond tools, Boost also installs AI guidelines: instruction files that load at the start of each session and tell the agent exactly how to work with the packages in your project. If your composer.json includes livewire/livewire, the Livewire guidelines load automatically. Same for Pest, Inertia, Flux UI, Wayfinder, and about a dozen others. The agent goes into the session already knowing how those packages work.
Tips for Better Results
A few habits that make a real difference:
Warm the agent up with a schema check first. Before asking it to generate a migration or write a query, open with "Check the current database schema for the users table." The Database Schema tool means the agent works from your actual columns, not guesses.
Use Last Error when debugging. Instead of copy-pasting a stack trace, ask the agent to "check the last error." It pulls the full exception with context directly from your logs. This integrates well with more automated approaches too — I've covered how to build a pipeline that sends errors straight to an agent, which is where this tool really shines.
Run boost:update after composer update. New package versions often ship updated guidelines. The update command regenerates everything based on your current composer.json.
Don't commit the generated files. Add these to .gitignore — they're regenerated automatically and create noisy diffs:
# .gitignore
.mcp.json
CLAUDE.md
AGENTS.md
boost.json
junie/
Gotchas and Edge Cases
Sail and boost:update: Running php artisan boost:update directly (instead of sail artisan boost:update) regenerates guidelines without the Sail-specific config. It quietly replaces ./vendor/bin/sail references with php throughout every guideline file. Always use sail artisan on Sail projects.
Docker setups: Boost's MCP server is a local stdio process — it executes php artisan boost:mcp on your host machine. If your PHP runtime lives inside a container, your editor can't reach it via the standard config. You'll need to either point the MCP command at a shell script that execs into the container, or run your editor from inside a dev container where PHP is available directly.
Composer version conflicts: Boost depends on laravel/mcp internally. If you're also requiring laravel/mcp directly in your project, version constraint conflicts can surface during installs. Check the Boost changelog before adding both packages to the same project.
Inertia + React install bug: Some versions of boost:install on fresh Inertia+React projects throw Call to undefined method Laravel\Boost\Install\Assists\Inertia::pagesDirectory(). If that happens, check the GitHub issues — it's usually fixed in a patch release within a few days.
Wrapping Up
Install Boost once, run boost:install, and your editor's AI assistant immediately has real context about your application — routes, models, schema, logs, and current documentation. It's a ten-minute setup that pays back every time you ask the agent to write a query or trace a bug.
Once the agent understands your app, the logical next step is building AI features into the app itself. Getting started with Laravel Prism is the fastest path there — it handles multi-provider LLM calls with a clean, Laravel-idiomatic API. If you want agents that can take actions within your application, Laravel Prism's tool-calling is where to go next.
Steven is a software engineer with a passion for building scalable web applications. He enjoys sharing his knowledge through articles and tutorials.