Laravel Boost and MCP Servers: The Context Your AI Agent is Missing
Your AI agent doesn't write bad Laravel code because it's dumb. It writes bad code because it's blind.
I'm going to say something that might sound controversial: most Laravel developers using AI coding agents right now are doing it wrong.
Not because they're picking the wrong models or writing bad prompts. But because they're asking a brilliant developer to build something without giving them access to the codebase, the database schema, or even the framework docs. That's exactly what happens when you use Claude Code, Cursor, or Copilot on a Laravel project without any context layer. Your agent doesn't know you're on Laravel 12. It doesn't know your User model has a scopeActive method. It doesn't know you switched from Inertia to Livewire last month. So it guesses. And it guesses wrong. A lot.
Laravel Boost fixes this. And combined with Herd's MCP server, it creates a context system that genuinely transforms how AI writes your code. Let me show you how it all works together.
What Is MCP and Why Should You Care?
MCP stands for Model Context Protocol. Think of it as a standardized API between your AI agent and your local development environment. Instead of the agent reading your files and hoping for the best, MCP lets it ask structured questions. "What's the database schema?" "What routes exist?" "What version of Livewire is installed?"
The agent doesn't guess anymore. It asks. And your app answers.
Laravel's ecosystem now has two MCP servers that work together: Laravel Boost (the official package from the Laravel team) and Herd's MCP server (if you're running Laravel Herd for local development). Boost handles the application-level intelligence. Herd handles the infrastructure layer. Together, they give your AI agent the kind of context that would take a human developer days to build up when joining a new project.
Installing Laravel Boost: The Three-Minute Setup
Getting Boost running is almost embarrassingly simple. You need PHP 8.2+ and Laravel 10, 11, or 12.
composer require laravel/boost --dev
php artisan boost:install
That install command is interactive. It asks two important questions: which features you want (guidelines, skills, MCP server) and which AI agents you use (Cursor, Claude Code, Codex, Gemini CLI, GitHub Copilot, Junie). Pick your tools and Boost generates the right config files automatically.
For Claude Code, it typically auto-configures. If it doesn't, you can add it manually:
claude mcp add -s local -t stdio laravel-boost php artisan boost:mcp
For Cursor, open the command palette, go to MCP Settings, and toggle laravel-boost on. For JetBrains/Junie, search "MCP Settings" in the command palette and check the box. That's it.
One thing I'd recommend: add the generated files to your .gitignore. The .mcp.json, CLAUDE.md, AGENTS.md, and any junie/ directories are auto-regenerated by boost:install, so there's no point tracking them in version control.
The Three Pillars: Guidelines, Skills, and MCP Tools
Boost works on three layers, and understanding the distinction is important because they serve different purposes.
Pillar 1: AI Guidelines
Guidelines are instruction files that get loaded upfront into your AI agent's context window. They teach the agent how your Laravel project works, what conventions to follow, and what patterns to use.
Boost ships with guidelines for Laravel itself and over 16 packages in the Laravel ecosystem. When you run boost:install, it detects your installed packages from composer.json and assembles only the relevant guidelines. Running Livewire? You get Livewire-specific conventions. Using Filament? Those guidelines come along too. Not using Inertia? Those guidelines don't waste context space.
The guidelines are version-aware too. If you're on Livewire 3, you get Livewire 3 patterns. Not Livewire 2 patterns that would generate deprecated code. This is a bigger deal than it sounds. I've lost count of how many times a generic AI suggested wire:model.defer for a Livewire 3 project.
Here's the part most people miss: you can add your own guidelines. Create a .ai/guidelines/ directory in your project root and drop in .blade.php or .md files. Boost merges them with its own guidelines during install. This is where things get really powerful for teams.
Pillar 2: Agent Skills
Skills were introduced in Boost 2.0, and they solve a real problem with guidelines: context bloat. Guidelines load upfront, every time. If you stuff 50 pages of instructions into guidelines, your agent's context window fills up before it even starts working on your actual code.
Skills are different. They're loaded on-demand, only when the agent is working on something relevant. Building a Livewire component? The Livewire skill activates. Writing Pest tests? The Pest skill kicks in. Working on a Tailwind layout? That skill loads.
Boost 2.0 moved a lot of content from guidelines into skills, making the default guidelines roughly 40% leaner. The result is more focused context and higher quality output from your agent.
Pillar 3: The MCP Server (15+ Tools)
This is where the magic happens. The MCP server exposes 15+ tools that let your AI agent programmatically interact with your running Laravel application. Not read your files. Interact with your app.
Here's what your agent can do through Boost's MCP:
Application Introspection: Read your PHP and Laravel versions, database engine, installed ecosystem packages with their versions, and all your Eloquent models. Your agent knows exactly what it's working with.
Database Access: Inspect your complete schema (tables, columns, relationships), run queries against your database, and understand your data structure. When the agent needs to write a migration, it knows what already exists.
Route Analysis: List and inspect all your application routes. When your agent suggests a controller method, it knows which routes are already taken and what naming conventions you're using.
Artisan Integration: List available Artisan commands and even execute them. Need the agent to run php artisan make:model? It can.
Code Execution via Tinker: Run arbitrary PHP code in the context of your application. The agent can test hypotheses and verify behavior before committing to a solution. This one is underrated. It means your agent can check if User::active()->count() returns what it expects before building a feature around it.
Configuration Access: Read your config values and available keys. No more guessing at queue driver settings or cache configurations.
Log Reading: Access your application logs and even browser errors. When something breaks, the agent can read the actual error message instead of you copy-pasting stack traces.
Documentation Search: Query Laravel's hosted documentation API, filtered to your installed package versions. This is backed by over 17,000 indexed documentation entries with semantic search. When the agent needs to know how belongsToMany works in your exact Laravel version, it gets the right answer.
Adding Herd's MCP Server for Infrastructure Context
If you're using Laravel Herd for local development (and if you're running Laravel Herd for local development (and on macOS or Windows, you probably should be), there's a second MCP server you should set up. The good news is that Boost automatically installs the Herd MCP server when it detects Herd.
Herd's MCP adds a different layer of context. While Boost handles application-level intelligence, Herd covers your infrastructure:
Site Information: Your local URL, environment variables, PHP version, Node version. The agent knows your exact local setup.
Services Discovery: What services are running (MySQL, Redis, Typesense, Laravel Reverb) and the connection details for each. No more the agent suggesting Redis commands when you're running Memcached.
Debug Operations: This is the one that blew my mind. Herd's MCP has a debug_site prompt that captures executed queries, dispatched jobs, logs, dump calls, and outgoing HTTP requests. You can literally tell your agent "debug the slow page load" and it pulls the actual query log.
The combined setup looks like this in your .mcp.json:
{
"mcpServers": {
"laravel-boost": {
"command": "php",
"args": ["artisan", "boost:mcp"]
},
"herd": {
"command": "php",
"args": ["/Applications/Herd.app/Contents/Resources/herd-mcp.phar"],
"env": {
"SITE_PATH": "/path/to/your/project"
}
}
}
}
Two MCP servers, one covering your application logic and the other covering your local environment. Your agent now has the full picture.
The "Nip It in the Bud" Approach to Guidelines
Here's a workflow tip that Jeffrey Way demonstrated on Laracasts that I think is the single most valuable thing you can do with Boost's custom guidelines.
Every time your AI agent makes a mistake, don't just fix it and move on. Update your guidelines. Agent uses wire:model.defer in a Livewire 3 project? Add a line to your custom guidelines: "In Livewire 3, wire:model is deferred by default. The .defer modifier no longer exists. Use wire:model.live only when you need real-time reactivity." Agent puts business logic in controllers? Add: "All business logic goes in Action classes under app/Actions/."
This is the "nip it in the bud" approach. Fix the pattern, not just the instance. Over time, your custom guidelines become a living document of your team's conventions and your project's specific quirks. The agent gets better with every correction because the corrections persist.
Create a file at .ai/guidelines/project-conventions.md and start adding rules every time the agent gets something wrong:
## Project Conventions
- Use Action classes for business logic, never fat controllers
- Always write Pest tests, not PHPUnit
- Use Laravel Data DTOs for request validation
- Queue names follow the pattern: {domain}-{action} (e.g., billing-process-payment)
- All API responses use our ApiResponse class, never raw JSON
- Use route model binding with custom keys where possible
It doesn't need to be fancy. It just needs to be honest about how your project actually works.
When Context Makes the Difference: A Real Example
Let me walk through a scenario where Boost actually changes the outcome.
Without Boost, you ask Claude Code: "Add a feature to export users as CSV." The agent looks at your files, sees a User model, and generates a generic CSV export. Maybe it uses fputcsv directly. Maybe it reaches for a package you don't have installed. It invents a route name that conflicts with an existing one. The generated code works in isolation but doesn't fit your app.
With Boost, the same request triggers a completely different workflow. The agent first uses the app-info tool to check your installed packages. It sees you have Laravel Excel installed. It checks your routes with the routes tool to find a naming pattern. It inspects your User model through the schema tool to understand which columns exist. It searches the docs to confirm the current Laravel Excel API for your version.
The result? Code that uses your existing packages, follows your naming conventions, and works with your actual database schema. Not generic code. Your code.
This matters even more when you're working on something complex like a multi-tenant SaaS application where the agent needs to understand tenant scoping, database separation, and your specific routing strategy.
If you've been building AI-powered features with the Laravel AI SDK, you already know how important context is for quality output. The same principle applies to the AI writing your code. More context, better code. Every time.
Keeping Boost Updated
Boost is under active development (currently at v2.1.3 as of February 2026). The guidelines and skills evolve as Laravel ecosystem packages release new versions. Run this periodically:
php artisan boost:update
This refreshes your local guidelines and skills to match the latest available versions for your installed packages. It's a good habit to run it after composer update, especially when upgrading major package versions.
And if you're working with a team, establish a convention: whoever updates packages runs boost:update and verifies the agent still behaves correctly. Those custom guidelines in .ai/guidelines/ aren't touched by the update command, so your project-specific rules stay intact.
Quick Comparison: Boost vs. Going Without
I want to be fair here. You don't absolutely need Boost to use AI with Laravel. You can write your own CLAUDE.md files, manually maintain context documents, and copy-paste relevant information into prompts. Some developers do this successfully.
But the maintenance burden is real. You need to update those files when packages change. You need to remember to include database schema information. You need to track which conventions matter for which parts of the codebase. Boost automates all of that.
The documentation search tool alone saves time I used to spend formatting and pasting API docs into context windows. Even something as simple as checking your JSON config files or validating a response structure gets faster when the agent already knows your app. And the Tinker integration means the agent can verify its own assumptions, which cuts down on "looks right but doesn't work" code generation significantly.
Frequently Asked Questions
Does Laravel Boost work with Docker or WSL environments?
Yes, but it can require extra configuration to ensure the MCP server running inside your container can communicate with your IDE. The main gotcha is database connectivity: if your .env references mysql as the database host, the MCP server running outside Docker can't resolve that hostname. The fix is to run the MCP server inside the same container. You'll need to adjust your .mcp.json to use docker compose exec as the command.
Can I use Boost on older Laravel versions?
Boost supports Laravel 10, 11, and 12 on PHP 8.2 or higher. The guidelines are version-aware, so you get instructions appropriate for your specific version. If you're still on Laravel 9 or below, you'll need to upgrade first.
Does Boost send my code to external servers?
The MCP server runs entirely locally. The only external call is the documentation search API, which sends your query and installed package versions to Laravel's hosted search endpoint to return relevant docs. Your actual application code stays on your machine.
Should I commit Boost's generated files to version control?
I'd recommend adding them to .gitignore. The .mcp.json, CLAUDE.md, AGENTS.md, and agent-specific directories are regenerated by boost:install. Each developer can run the install command and get files configured for their own IDE and preferences.
How does Boost compare to just writing a good CLAUDE.md file?
A well-maintained CLAUDE.md can get you pretty far. The advantage of Boost is scale and maintenance. It provides guidelines for 16+ packages, version-aware documentation, and 15+ MCP tools that give the agent live access to your app. You could replicate some of this manually, but keeping it current across package updates is the hard part that Boost automates.
What's Next
If you're already using AI for Laravel development, adding Boost takes three minutes and the improvement in code quality is noticeable from the first prompt. Install it, run the interactive setup, and start building. Then adopt the "nip it in the bud" approach with custom guidelines and watch your agent get smarter over time.
The context problem is real, but it's solved. Your AI agent just needs you to open the door.
If you want help setting up an AI-powered development workflow for your Laravel project, or you need an experienced developer to build your MVP, let's talk.
Got a Product Idea?
I build MVPs, web apps, and SaaS platforms in 7 days. Fixed price, real code, deployed and ready to use.
⚡ Currently available for 2-3 new projects
About Hafiz
Full Stack Developer from Italy. I help founders turn ideas into working products fast. 9+ years of experience building web apps, mobile apps, and SaaS platforms.
View My Work →Get web development tips via email
Join 50+ developers • No spam • Unsubscribe anytime
Related Articles
Stop Vibe Coding Your Production Apps: A Case for Developer-Driven AI
Vibe coding is great for prototypes. But your production app deserves better. He...
How to Make Your Laravel App AI-Agent Friendly (The Complete 2026 Guide)
AI agents are browsing the web now. Here's how to make your Laravel app speak th...
OpenClaw + Laravel Forge: Deploy Your AI Assistant in 5 Minutes
Laravel Forge now supports OpenClaw servers. Here's how to deploy your own AI as...