- Platform: YouTube
- Channel/Creator: nunomaduro
- Duration: 01:26:23
- Release Date: Sep 20, 2025
- Video Link: https://www.youtube.com/watch?v=ClxzgtwUhTQ
Disclaimer: This is a personal summary and interpretation based on a YouTube video. It is not official material and not endorsed by the original creator. All rights remain with the respective creators.
This document summarizes the key takeaways from the video. I highly recommend watching the full video for visual context and coding demonstrations.
- I summarize key points to help you learn and review quickly.
- Simply click on
Ask AIlinks to dive into any topic you want.
Teach Me: 5 Years Old | Beginner | Intermediate | Advanced | (reset auto redirect)
Learn Differently: Analogy | Storytelling | Cheatsheet | Mindmap | Flashcards | Practical Projects | Code Examples | Common Mistakes
Check Understanding: Generate Quiz | Interview Me | Refactor Challenge | Assessment Rubric | Next Steps
Laravel MCP is a new package that adds a dedicated entry point for AI agents (Cursor, Claude, Junie, etc.) to interact with your Laravel app — just like you already have web routes, API routes, and console commands. Think of it as “an API for agents”. It lets agents perform actions on behalf of the user without the user ever touching a browser or Postman.
Key analogy from Nuno:
Imagine a hotel. Reservations can come in via:
- Phone call
- Website form
- Third-party API (booking.com)
- MCP → AI agents call your app directly with natural language
We’re building a tiny chat app (“Nuno Nation Chat”) from scratch so anyone can:
- Open Cursor (or Claude)
- Say “I am Nuno, say good morning to the Nuno nation”
- The agent uses MCP → sends the message → fetches the timeline → shows it just works
No frontend yet – everything happens through AI agents via the MCP protocol.
Nuno uses his own strict starter kit (Pint, Rector, PHPStan level max, Pest, Laravel Essentials, etc.).
php artisan make:model Message -mMigration:
$table->string('name');
$table->text('body');
$table->timestamps();Model is left completely open (Model::unguard()) – Nuno prefers this over $fillable for small/internal tools.
Factory + model test for toArray() (ensures no hidden attributes leak).
All committed, pushed, reviewed by CodeRabbit (more on that below).
Ask AI: Laravel Message Model Setup
Nuno has been using CodeRabbit for a week and is genuinely impressed:
- Auto-reviews every PR
- Generates accurate sequence diagrams
- Learns your preferences (e.g. final/readonly classes, no down() method, prefer Model::unguard)
- Suggests real architectural improvements (add index on created_at, avoid key order in tests, etc.)
- Free for open-source, 14-day trial for private repos, then Pro plan
He shows multiple live reviews where CodeRabbit catches bugs, suggests better practices, and even backs off when told “I actually like Model::unguard”.
Ask AI: CodeRabbit AI Code Review
php artisan make:action CreateMessagepublic function handle(string $name, string $body): Message
{
return Message::create([
'name' => $name,
'body' => $body,
]);
}Action is unit-tested and reused everywhere (MCP tool, future web controller, queue jobs, etc.). This is why Nuno loves actions — single source of truth for business rules.
Ask AI: Laravel Actions Pattern
composer require laravel/mcp
php artisan vendor:publish --tag=mcp-routesRoutes file: routes/ai.php – this is the entry point agents will hit (e.g. /mcp/chat).
Create server:
php artisan make:mcp-server NunoNationChatServer class gets:
- name, version
- detailed $instructions (most important part!)
- tools[], resources[], prompts[]
Nuno’s instructions example:
“This is the Nuno Nation chat server. It’s a friendly chat that allows users to have a conversation about various topics. Users can send messages or get messages to see what others have shared.”
Ask AI: Laravel MCP Server Setup
php artisan make:mcp-tool SendMessageKey points Nuno emphasizes:
- Tool description must be crystal clear
- Schema defines exact JSON structure the agent must follow
- Always validate the incoming data (schema is public but not enforced)
Schema example:
Schema::string('name')
->description('The name of the user sending the message. Ask the user for their first name if unknown. Never use "user", "assistant", "AI", etc.')
->minLength(1)
->maxLength(50)
->required(),
Schema::string('content')
->description('The message content')
->minLength(1)
->maxLength(500)
->required(),Handle method:
- Validates request
- Resolves CreateMessage action
- Returns markdown response: “Your message has been successfully sent…”
The tool reuses the same CreateMessage action we wrote earlier — perfect separation of concerns.
Ask AI: Laravel MCP Tool Creation
- GetMessages tool
- Authentication / rate limiting
- Deploying to production
- Actually chatting with Nuno via Cursor/Claude in real time
About the summarizer
I'm Ali Sol, a Backend Developer. Learn more:
- Website: alisol.ir
- LinkedIn: linkedin.com/in/alisolphp