Laravel MCP
Official Laravel package for rapidly building Model Context Protocol (MCP) servers
Repository Health
Technical Analysis
Laravel MCP is the official package from the Laravel team for building Model Context Protocol servers directly inside a Laravel application. It provides a fluent, Artisan-driven way to register MCP tools, resources, and prompts so an AI client (Claude, an IDE agent, or any MCP-compatible host) can call into your application’s business logic.
Under the hood it handles the MCP transport layer (local/stdio and web/HTTP), request/response schema validation via illuminate/json-schema, and routing of MCP calls to plain PHP classes — meaning a Laravel developer can expose an existing application’s actions to an AI agent using patterns (controllers, facades, validation) already familiar from the rest of the framework.
What You Get
- Artisan commands to scaffold new MCP servers, tools, resources, and prompts
- A fluent
Mcp::local()/Mcp::web()registration API mirroring Laravel’s routing conventions - Built-in local (stdio) and web (HTTP) transport implementations
- Automatic JSON schema generation/validation for tool inputs via
illuminate/json-schema - A test client (
Client/WebClient) for asserting MCP server behavior in Pest/PHPUnit
Common Use Cases
- Exposing an existing Laravel app’s business logic as callable tools for Claude or another MCP client
- Building an internal AI assistant that can query and act on application data through defined MCP resources
- Adding an MCP server to a SaaS product so customers can connect it to their own AI agents
- Prototyping agentic workflows against a Laravel backend without hand-rolling the MCP transport/protocol layer
Under The Hood
Architecture - The package splits cleanly into Server (the MCP server definition and its registered tools/resources/prompts), Transport (local stdio and web HTTP implementations), Schema (JSON schema generation for tool arguments), and Client/WebClient (a first-party test harness that speaks the MCP protocol back to a server under test). Mcp::local()/Mcp::web() register server classes the same way Laravel registers route groups, and each server class declares its tools/resources/prompts as PHP classes rather than config arrays. Tech Stack - PHP 8.2+, layered directly on Laravel’s own illuminate/routing, illuminate/validation, illuminate/container, and the newer illuminate/json-schema package (used to derive JSON Schema from PHP method signatures/attributes for tool inputs), plus symfony/process for spawning local transport processes. Dev tooling includes Pest, PHPStan, Rector, and Laravel Pint, reflecting current first-party Laravel package conventions. Code Quality - 145 test files under tests/, a notably large suite for a package created in mid-2025, covering server registration, both transports, schema generation, and tool/resource/prompt dispatch; CI runs Pest, PHPStan, and Rector, and the codebase is exclusively PHP (96.9%) with a thin JS/Blade slice for developer tooling. API Design - Server, tool, resource, and prompt classes are generated via Artisan (make:mcp-server, etc.) and registered with route-like fluent calls, so a Laravel developer’s existing mental model of controllers and route registration transfers almost directly, minimizing the learning curve despite MCP itself being a newer protocol.
Used by 3 apps in this directory
Coolify
Devops · Hosting Control Panel
Open-source self-hosted PaaS — deploy apps, databases and 280+ services on your own servers with no vendor lock-in
Databasement
Databases · Devops · Developer Tools
Self-hosted database backup manager with a web UI for scheduling, encrypting, and restoring MySQL, PostgreSQL, MongoDB, SQL Server, SQLite, Firebird, and Redis to S3, SFTP, Samba, or local storage.
Leantime
Productivity · Project Management · Collaboration
Project management built for ADHD, autism, and dyslexia — simple as Trello, powerful as Jira