The MCP Server: the robot chef that serves up code to your Laravel!
We call it MCP because it handles Models and Contexts so that the AI can generate or modify code intelligently and “compliantly” with the Laravel paradigm.
1️⃣ Why does your project need an MCP?
Because coding without AI is like cooking without a spatula: the splashes of “Where is $user?” and “How do I install package X?” will quickly multiply.
AI = your conductor.
MCP = your kitchen server that translates AI’s commands into recipes (code, migrations, tests…).
Laravel Boost = the chef who invented the recipe, only cooking in their own kingdom.
2️⃣ Installation & setup in your IDE
Think of IDEs as your kitchen: they let you write your recipes (code) and install plugins to bring in your kitchen server (MCP). Here’s the step-by-step recipe with a pinch of humor:
2.1 PhpStorm
Step | Action | Details |
---|---|---|
1 | Press Shift × 2 | Opens the Command Palette. |
2 | Type “MCP Settings” | The kitchen setup appears. |
3 | Check laravel-boost | Activates the MCP server. |
4 | Apply | Launches the change. |
5 | Look for the green check | The server is running. |
“1. Press shift twice … 5. If you see a green checkmark, you're ready to go!”
2.2 VS Code
Step | Action | Details |
---|---|---|
1 | Open “Command Palette” (Cmd+Shift+P or Ctrl+Shift+P) | Magic menu. |
2 | Type “MCP: List Servers” | Displays the servers. |
3 | Select laravel-boost | Target the right server. |
4 | Click “Start server” | Launches the MCP server. |
“1. Open the Command Palette … 4. Choose 'Start server' and you're good to go!”
2.3 Cursor
Step | Action | Details |
---|---|---|
1 | Cmd+Shift+P | Opens the palette. |
2 | Search “/open MCP Settings” | Enters the settings. |
3 | Toggle laravel-boost | Activates the server. |
“1. Open the Command Palette … 3. Turn the toggle on for laravel-boost”
2.4 Claude Code
Claude’s already on the job, but double-checking never hurts.
Step | Action | Details |
---|---|---|
1 | Open a console in the project directory | The right context. |
2 | Run the command: | claude mcp add -s local -t stdio laravel-boost php ./artisan boost:mcp |
“1. Claude is enabled automatically … 3. Run claude mcp add -s local -t stdio laravel-boost php ./artisan boost:mcp”
2.5 Adding an unsupported IDE
Parameter | Value |
---|---|
Command | php |
Args | ./artisan boost:mcp |
“Add an IDE that we don’t yet support … Command php … Args ./artisan boost:mcp”
3️⃣ The tools: AI’s infinite buffet
Here are the “main dishes” your MCP server serves up:
Tool | Dish | Why? |
---|---|---|
Application Info | Full cocktail | PHP, Laravel, plugins, models versions. |
Database Schema | CRUD salad | Visualize schema without opening migrations. |
Search Docs | Manual soup | Search docs, even offline. |
Tinker | Chef at work | Write code on the fly and see results instantly. |
List Routes | Dashboard | Full menu of all API endpoints. |
⚠️ Kitchen note: Some tools are powerful – lock down your config (permissions) before serving.
4️⃣ How does it work, really?
You ask a question.
The AI sends an MCP request (JSON-RPC-style) to the server.
The server executes the command in your app’s context (
php artisan boost:mcp
) and returns the result.The AI formats and delivers the answer in your IDE – sometimes copy-paste ready.
👨🍳 Chef tip: use the promptboost:ask "How to add a slug field to the users migration?"
The AI will answer like a “team head chef.”
5️⃣ When AI messes around?
Imagine it suggests creating an old-school UserController
:
You reply: “No thanks, I prefer RESTful!”
Quickly, the AI rewrites cleaner code.
Even a greedy AI knows to avoid greasy bacon. 🥓
6️⃣ Why is everyone talking about AI?
Fast: In seconds, your request is served.
Customizable: Add your own guidelines (in
.ai/guidelines/
).Saves effort: AI handles the copy-pasting, you keep the ideas.
7️⃣ A light note to finish
MCP: My Chef Partner
Boost: The dish served with every order
Laravel: The restaurant where we all work every day
TL;DR: Install Laravel Boost, start the MCP server, connect your IDE, and let AI order up the code you want.
And don’t forget: even the best chef needs a splash of oil — watch your logs to keep the kitchen clean.
💡 Final quote (inspired by an old master chef):
“AI gives the recipe, but you decide how to serve it to your audience.”
🍳 Happy coding, and may your MCP always be chasing the next flavor!