{"id":"b148f184-4ddc-4d58-8100-43d506894a22","shortId":"EgtZV2","kind":"skill","title":"laravel-mcp","tagline":"Laravel MCP server development. Use when building MCP servers, tools, prompts, or resources for AI client integration. Triggers on tasks involving laravel/mcp, MCP tools, MCP prompts, MCP resources, or AI client protocols.","description":"# Laravel MCP\n\nComprehensive guide for building MCP (Model Context Protocol) servers with Laravel. Contains 7 rules across 5 categories for exposing tools, prompts, and resources to AI clients.\n\n## When to Apply\n\nReference these guidelines when:\n- Creating MCP servers (web or local)\n- Building tools that AI clients can call\n- Defining prompts for reusable AI interactions\n- Exposing resources for AI context\n- Protecting MCP servers with OAuth or Sanctum\n- Testing MCP servers, tools, prompts, and resources\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Servers | CRITICAL | `server-` |\n| 2 | Tools | HIGH | `tool-` |\n| 3 | Prompts & Resources | MEDIUM | `prompt-`, `resource-` |\n| 4 | Authentication | HIGH | `auth-` |\n| 5 | Testing | HIGH | `test-` |\n\n## Quick Reference\n\n### 1. Servers (CRITICAL)\n\n- `server-create-register` - Create and register web or local MCP servers\n\n### 2. Tools (HIGH)\n\n- `tool-create` - Create tools with input/output schemas, DI, and annotations\n- `tool-responses` - Text, error, structured, streaming, and multi-content responses\n\n### 3. Prompts & Resources (MEDIUM)\n\n- `prompt-create` - Create prompts with arguments, validation, and responses\n- `resource-create` - Create resources and resource templates with URI patterns\n\n### 4. Authentication (HIGH)\n\n- `auth-protect` - Protect servers with OAuth 2.1, Sanctum, or custom auth\n\n### 5. Testing (HIGH)\n\n- `test-unit` - Test with MCP Inspector and unit tests\n\n## Essential Patterns\n\n### Creating an MCP Server\n\n```php\n<?php\n\nnamespace App\\Mcp\\Servers;\n\nuse Laravel\\Mcp\\Server;\nuse Laravel\\Mcp\\Server\\Attributes\\Instructions;\nuse Laravel\\Mcp\\Server\\Attributes\\Name;\nuse Laravel\\Mcp\\Server\\Attributes\\Version;\n\n#[Name('Weather Server')]\n#[Version('1.0.0')]\n#[Instructions('This server provides weather information.')]\nclass WeatherServer extends Server\n{\n    protected array $tools = [\n        CurrentWeatherTool::class,\n    ];\n\n    protected array $resources = [];\n\n    protected array $prompts = [];\n}\n```\n\n### Registering in routes/ai.php\n\n```php\nuse App\\Mcp\\Servers\\WeatherServer;\nuse Laravel\\Mcp\\Facades\\Mcp;\n\nMcp::web('/mcp/weather', WeatherServer::class);\nMcp::local('weather', WeatherServer::class);\n```\n\n### Creating a Tool\n\n```php\n<?php\n\nnamespace App\\Mcp\\Tools;\n\nuse Illuminate\\Contracts\\JsonSchema\\JsonSchema;\nuse Laravel\\Mcp\\Request;\nuse Laravel\\Mcp\\Response;\nuse Laravel\\Mcp\\Server\\Attributes\\Description;\nuse Laravel\\Mcp\\Server\\Tool;\n\n#[Description('Fetches the current weather for a location.')]\nclass CurrentWeatherTool extends Tool\n{\n    public function handle(Request $request): Response\n    {\n        $location = $request->get('location');\n\n        return Response::text(\"The weather in {$location} is sunny, 72°F.\");\n    }\n\n    public function schema(JsonSchema $schema): array\n    {\n        return [\n            'location' => $schema->string()\n                ->description('The location to get the weather for.')\n                ->required(),\n        ];\n    }\n}\n```\n\n## How to Use\n\nRead individual rule files for detailed explanations and code examples.\n\nEach rule file contains:\n- YAML frontmatter with metadata (title, impact, tags)\n- Brief explanation of why it matters\n- Bad Example with explanation\n- Good Example with explanation\n- Laravel 13 and PHP 8.3 specific context and references\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`","tags":["laravel","mcp","agent","skills","asyrafhussin","agent-rules","agent-skills","ai-agents","ai-slop","claude-code","code-quality","code-review"],"capabilities":["skill","source-asyrafhussin","skill-laravel-mcp","topic-agent-rules","topic-agent-skills","topic-ai-agents","topic-ai-slop","topic-claude-code","topic-code-quality","topic-code-review","topic-codex","topic-cursor","topic-laravel","topic-nodejs","topic-react"],"categories":["agent-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/AsyrafHussin/agent-skills/laravel-mcp","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add AsyrafHussin/agent-skills","source_repo":"https://github.com/AsyrafHussin/agent-skills","install_from":"skills.sh"}},"qualityScore":"0.469","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 39 github stars · SKILL.md body (3,461 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:58:24.683Z","embedding":null,"createdAt":"2026-05-16T18:57:14.438Z","updatedAt":"2026-05-18T18:58:24.683Z","lastSeenAt":"2026-05-18T18:58:24.683Z","tsv":"'/mcp/weather':311 '1':117,141 '1.0.0':273 '13':443 '2':121,156 '2.1':217 '3':125,182 '4':131,207 '5':53,135,222 '7':50 '72':383 '8.3':446 'across':52 'agents.md':462 'ai':18,33,62,80,88,93 'annot':169 'app':244,300,325 'appli':66 'argument':192 'array':285,290,293,390 'attribut':255,261,267,345 'auth':134,211,221 'auth-protect':210 'authent':132,208 'bad':434 'brief':428 'build':10,41,77 'call':83 'categori':54,110,114 'class':280,288,313,318,360 'client':19,34,63,81 'code':415 'compil':452 'complet':456 'comprehens':38 'contain':49,420 'content':180 'context':44,94,448 'contract':330 'creat':71,146,148,161,162,188,189,198,199,237,319 'critic':119,143 'current':355 'currentweathertool':287,361 'custom':220 'defin':84 'descript':346,352,395 'detail':412 'develop':7 'di':167 'document':453 'error':174 'essenti':235 'exampl':416,435,439 'expand':461 'explan':413,429,437,441 'expos':56,90 'extend':282,362 'f':384 'facad':307 'fetch':353 'file':410,419 'frontmatt':422 'full':451 'function':365,386 'get':372,399 'good':438 'guid':39,457 'guidelin':69 'handl':366 'high':123,133,137,158,209,224 'illumin':329 'impact':115,426 'individu':408 'inform':279 'input/output':165 'inspector':231 'instruct':256,274 'integr':20 'interact':89 'involv':24 'jsonschema':331,332,388 'laravel':2,4,36,48,248,252,258,264,305,334,338,342,348,442 'laravel-mcp':1 'laravel/mcp':25 'local':76,153,315 'locat':359,370,373,380,392,397 'matter':433 'mcp':3,5,11,26,28,30,37,42,72,96,103,154,230,239,245,249,253,259,265,301,306,308,309,314,326,335,339,343,349 'medium':128,185 'metadata':424 'model':43 'multi':179 'multi-cont':178 'name':262,269 'namespac':243,324 'oauth':99,216 'pattern':206,236 'php':241,242,298,322,323,445 'prefix':116 'prioriti':112,113 'prompt':14,29,58,85,106,126,129,183,187,190,294 'prompt-creat':186 'protect':95,212,213,284,289,292 'protocol':35,45 'provid':277 'public':364,385 'quick':139 'read':407 'refer':67,140,450 'regist':147,150,295 'request':336,367,368,371 'requir':403 'resourc':16,31,60,91,108,127,130,184,197,200,202,291 'resource-cr':196 'respons':172,181,195,340,369,375 'return':374,391 'reusabl':87 'routes/ai.php':297 'rule':51,109,409,418,460 'sanctum':101,218 'schema':166,387,389,393 'server':6,12,46,73,97,104,118,120,142,145,155,214,240,246,250,254,260,266,271,276,283,302,344,350 'server-create-regist':144 'skill' 'skill-laravel-mcp' 'source-asyrafhussin' 'specif':447 'stream':176 'string':394 'structur':175 'sunni':382 'tag':427 'task':23 'templat':203 'test':102,136,138,223,226,228,234 'test-unit':225 'text':173,376 'titl':425 'tool':13,27,57,78,105,122,124,157,160,163,171,286,321,327,351,363 'tool-creat':159 'tool-respons':170 'topic-agent-rules' 'topic-agent-skills' 'topic-ai-agents' 'topic-ai-slop' 'topic-claude-code' 'topic-code-quality' 'topic-code-review' 'topic-codex' 'topic-cursor' 'topic-laravel' 'topic-nodejs' 'topic-react' 'trigger':21 'unit':227,233 'uri':205 'use':8,247,251,257,263,299,304,328,333,337,341,347,406 'valid':193 'version':268,272 'weather':270,278,316,356,378,401 'weatherserv':281,303,312,317 'web':74,151,310 'yaml':421","prices":[{"id":"0a548a0a-08c6-4646-b1c7-652eeafe1015","listingId":"b148f184-4ddc-4d58-8100-43d506894a22","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"AsyrafHussin","category":"agent-skills","install_from":"skills.sh"},"createdAt":"2026-05-16T18:57:14.438Z"}],"sources":[{"listingId":"b148f184-4ddc-4d58-8100-43d506894a22","source":"github","sourceId":"AsyrafHussin/agent-skills/laravel-mcp","sourceUrl":"https://github.com/AsyrafHussin/agent-skills/tree/main/skills/laravel-mcp","isPrimary":false,"firstSeenAt":"2026-05-16T18:57:14.438Z","lastSeenAt":"2026-05-18T18:58:24.683Z"}],"details":{"listingId":"b148f184-4ddc-4d58-8100-43d506894a22","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"AsyrafHussin","slug":"laravel-mcp","github":{"repo":"AsyrafHussin/agent-skills","stars":39,"topics":["agent-rules","agent-skills","ai-agents","ai-slop","claude-code","code-quality","code-review","codex","cursor","laravel","nodejs","react","technical-debt","typescript","windsurf"],"license":"mit","html_url":"https://github.com/AsyrafHussin/agent-skills","pushed_at":"2026-05-16T19:24:02Z","description":"Agent skills for AI coding agents (Claude Code, Cursor, Codex, Windsurf) — Laravel, React, TypeScript, MySQL, code quality, technical debt, documentation, and security.","skill_md_sha":"9cd6240c01226efec36a71a73b1b2b7092e74d96","skill_md_path":"skills/laravel-mcp/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/AsyrafHussin/agent-skills/tree/main/skills/laravel-mcp"},"layout":"multi","source":"github","category":"agent-skills","frontmatter":{"name":"laravel-mcp","license":"MIT","description":"Laravel MCP server development. Use when building MCP servers, tools, prompts, or resources for AI client integration. Triggers on tasks involving laravel/mcp, MCP tools, MCP prompts, MCP resources, or AI client protocols."},"skills_sh_url":"https://skills.sh/AsyrafHussin/agent-skills/laravel-mcp"},"updatedAt":"2026-05-18T18:58:24.683Z"}}