laravel-mcp
Skill0 starsChanged 30 days agoMITView on GitHub
Serveur MCP (Model Context Protocol) pour Laravel. Exposer des données et actions via le protocole MCP pour les outils AI. Utiliser quand on crée un serveur MCP, on expose des données à un assistant AI, ou on configure Laravel Boost.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- rawveg/skillsforge-marketplacetheir own version, first seen Feb 19, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- rawveg/skillsforge-marketplace★ 40same name
- davidanthonyn/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/laravel-core/templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- dokploy-deploySkill
- laravel-adminSkill
- laravel-aiSkill
- laravel-apiSkill
- laravel-coreSkill
- laravel-deploySkill
- laravel-inertiaSkill
- laravel-livewireSkill
- laravel-microserviceSkill
- laravel-multi-tenancySkill
- laravel-nuxtSkill
- laravel-performanceSkill
- laravel-queueSkill
- laravel-securitySkill
- laravel-testingSkill
- laravel-websocketSkill
- nuxt-coreSkill
- nuxt-uiSkill
- pestSkill
- project-definerSkill
- scribeSkill
- searxng-mcpSkill
- sentrySkill
- skill-creatorSkill
- skill-health-checkerSkill
- spatie-query-builderSkill
The file
Files
Laravel MCP — Serveur MCP pour Laravel 13
Tu es un expert en MCP (Model Context Protocol) avec Laravel. Ton rôle est d'exposer des données et actions Laravel via le protocole MCP pour les outils AI.
Quand utiliser
- Créer un serveur MCP pour Laravel
- Exposer des données à un assistant AI
- Configurer Laravel Boost
- Créer des tools MCP personnalisés
Installation (Laravel Boost)
composer require laravel/boost --dev
php artisan boost:installArchitecture MCP
MCP Server
├── Tools — Actions exécutables (GET, POST, etc.)
├── Resources — Données exposées (lecture seule)
└── Prompts — Templates de prompts réutilisablesTool MCP
<?php
namespace App\Mcp\Tools;
use Laravel\Mcp\Tool;
use Illuminate\Support\Facades\DB;
class SearchUsers extends Tool
{
protected string $name = 'search_users';
protected string $description = 'Recherche des utilisateurs par nom ou email';
protected array $inputSchema = [
'type' => 'object',
'properties' => [
'query' => [
'type' => 'string',
'description' => 'Terme de recherche (nom ou email)',
],
'limit' => [
'type' => 'integer',
'description' => 'Nombre max de résultats',
'default' => 10,
],
],
'required' => ['query'],
];
public function execute(array $params): array
{
$users = DB::table('users')
->where('name', 'LIKE', "%{$params['query']}%")
->orWhere('email', 'LIKE', "%{$params['query']}%")
->limit($params['limit'] ?? 10)
->get();
return [
'content' => [
[
'type' => 'text',
'text' => json_encode($users, JSON_PRETTY_PRINT),
],
],
];
}
}Resource MCP
<?php
namespace App\Mcp\Resources;
use Laravel\Mcp\Resource;
use App\Models\Post;
class PostResource extends Resource
{
protected string $name = 'posts';
protected string $uri = 'laravel://posts';
protected string $description = 'Liste des articles du blog';
public function read(): array
{
$posts = Post::with('user')
->latest()
->limit(50)
->get();
return [
'contents' => [
[
'uri' => $this->uri,
'mimeType' => 'application/json',
'text' => json_encode($posts),
],
],
];
}
}Prompt MCP
<?php
namespace App\Mcp\Prompts;
use Laravel\Mcp\Prompt;
class AnalyzePost extends Prompt
{
protected string $name = 'analyze_post';
protected string $description = 'Analyse un article et suggère des améliorations';
public function arguments(): array
{
return [
[
'name' => 'post_id',
'description' => 'ID de l\'article à analyser',
'required' => true,
],
];
}
public function execute(array $params): array
{
$post = Post::findOrFail($params['post_id']);
return [
'description' => "Analyse de l'article : {$post->title}",
'messages' => [
[
'role' => 'user',
'content' => [
'type' => 'text',
'text' => "Analyse cet article et suggère des améliorations :\n\nTitre : {$post->title}\nContenu : {$post->content}",
],
],
],
];
}
}Configuration
// config/mcp.php
return [
'servers' => [
'default' => [
'driver' => 'stdio',
'tools' => [
\App\Mcp\Tools\SearchUsers::class,
\App\Mcp\Tools\GetPost::class,
],
'resources' => [
\App\Mcp\Resources\PostResource::class,
],
'prompts' => [
\App\Mcp\Prompts\AnalyzePost::class,
],
],
],
];.mcp.json pour les agents
{
"mcpServers": {
"laravel": {
"command": "php",
"args": ["artisan", "mcp:serve"],
"env": {
"APP_ENV": "local"
}
}
}
}Bonnes pratiques
- Principe du moindre privilège — Exposer uniquement les données nécessaires
- Validation — Valider les entrées MCP comme des API classiques
- Description claire — Chaque tool doit avoir une description précise
- Rate limiting — Sur les endpoints MCP
- Authentification — Restreindre l'accès aux données sensibles
- Logging — Tracer les appels MCP
- Tests — Tester chaque tool individuellement
- Documentation — Décrire les inputs/outputs de chaque tool
Validation
- Tools MCP créés avec descriptions
- Resources exposées
- Prompts configurés
- .mcp.json généré
- Validation des entrées
- Rate limiting configuré
- Tests des tools
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

