Laravel MCP
An official Laravel package for Model Context Protocol integration, enabling Laravel applications to expose tools, data, and prompt templates to AI agents via the Model Context Protocol. The package supports fine-grained permission control and a searchable tool directory.
Core Facts
Timeline (last 90 days)
It is recommended to make inspector testing a fixed step in the development process, running it once after every change to a tool definition before connecting to a real client.
The Laravel MCP package generates a separate routes/ai.php route file, isolated from web.php and api.php, to avoid routing and security policies contaminating each other.
Laravel MCP provides Mcp::web() for registering servers in remote/production environments and Mcp::local() for registering servers in local development.
Laravel MCP server classes use the #[Name], #[Version] and #[Instructions] attributes, which AI clients read to determine when to call the server.
#[IsReadOnly] indicates that a tool only reads data and produces no side effects; #[IsIdempotent] indicates that the result is the same no matter how many times it is called; #[IsDestructive] warns that a tool may modify or delete data.
The built-in interactive session started by php artisan mcp:inspector is essentially a built-in MCP client that can initiate a handshake according to the protocol specification, request the list of capabilities, display tool JSON Schemas and allow calls to be triggered manually.
AI models read the #[Description] of a tool class and the description of each field to decide how to call the tool, and leaving descriptions blank or overly generic noticeably increases the failure rate of calls.
Security annotations are lightweight contractual declarations that convey risk levels to AI clients; they do not replace permission checks at the code level but complement them.
When already exposed to hosted AI clients, Mcp::web() must be used and rate-limiting middleware considered; for local debugging only, Mcp::local() is simpler.
The official Laravel MCP package requires PHP 8.2 or above and Laravel 12.x or 13.x.
8 more timeline events
All Facts (18)
Laravel MCP can be integrated into an application with a single command: composer require laravel/mcp
65%UnverifiedIt is recommended to make inspector testing a fixed step in the development process, running it once after every change to a tool definition before connecting to a real client.
50%UnverifiedLaravel MCP provides Mcp::web() for registering servers in remote/production environments and Mcp::local() for registering servers in local development.
50%UnverifiedLaravel MCP server classes use the #[Name], #[Version] and #[Instructions] attributes, which AI clients read to determine when to call the server.
50%Unverified#[IsReadOnly] indicates that a tool only reads data and produces no side effects; #[IsIdempotent] indicates that the result is the same no matter how many times it is called; #[IsDestructive] warns that a tool may modify or delete data.
50%UnverifiedThe built-in interactive session started by php artisan mcp:inspector is essentially a built-in MCP client that can initiate a handshake according to the protocol specification, request the list of capabilities, display tool JSON Schemas and allow calls to be triggered manually.
50%UnverifiedAI models read the #[Description] of a tool class and the description of each field to decide how to call the tool, and leaving descriptions blank or overly generic noticeably increases the failure rate of calls.
50%UnverifiedSecurity annotations are lightweight contractual declarations that convey risk levels to AI clients; they do not replace permission checks at the code level but complement them.
50%UnverifiedWhen already exposed to hosted AI clients, Mcp::web() must be used and rate-limiting middleware considered; for local debugging only, Mcp::local() is simpler.
50%UnverifiedThe official Laravel MCP package requires PHP 8.2 or above and Laravel 12.x or 13.x.
50%UnverifiedThe Laravel MCP package generates a separate routes/ai.php route file, isolated from web.php and api.php, to avoid routing and security policies contaminating each other.
50%UnverifiedThe core of a Laravel MCP tool is the handle method, and the two methods schema and outputSchema constrain the AI's inputs and outputs, where schema defines parameters and validation rules, and outputSchema defines the returned data structure.
50%UnverifiedThe original author ran 17 tools on one MCP server and saved a significant amount of context space after adopting an on-demand discovery mechanism
50%UnverifiedLaravel MCP version 1.0 introduces stateless servers support
50%UnverifiedLaravel MCP can expose tools, data, and prompts within an application for invocation by any MCP-compatible Agent
50%UnverifiedThe searchable tool catalog reduces context usage from O(total number of tools) to O(number of tools relevant to the current task)
50%UnverifiedLaravel MCP version 1.0 introduces a stricter OAuth authentication mechanism
50%UnverifiedThe MCP (Model Context Protocol) package officially released by Laravel has reached its stable version 1.0
50%