php-llm/mcp-bundle
A Symfony bundle that turns your app into a Model Context Protocol server for AI clients. Register tools, resources, and prompts with PHP attributes, then expose them over JSON-RPC transports such as stdio and HTTP.
composer require php-llm/mcp-bundle. This pulls in php-llm/mcp-sdk transitively — the bundle pins the SDK to 0.1.x, so don't try to bump the SDK independently.composer.json constraint ("php-llm/mcp-bundle": "0.1.*") rather than using ^0.1.mcp-bundle is a Symfony bundle — the DI wiring, service tags, and config tree are Symfony's. In a Laravel app you will mostly be using the underlying mcp-sdk classes directly and hand-wiring the server, or waiting for/using a Laravel-specific bridge. Confirm what auto-registration you actually get before designing around it.Server/ServerBuilder service. That's the object everything hangs off.handle() returning a result), register it, and smoke-test over stdio with an MCP client — Claude Desktop or mcp-inspector. Getting one tool round-tripping end-to-end is the fastest way to validate the whole stack.stdio for local desktop clients (Claude Desktop, CLI agents). The server is a child process spawned by the client.php artisan mcp:serve) so local dev and desktop-client config share one entry point.php-llm/mcp-sdk, Composer will either fail or silently give you a mismatched SDK. Run composer why php-llm/mcp-sdk if you see protocol weirdness after adding packages.dump(), echo, a stray dd(), Laravel's debug output, some log drivers — corrupts the stream and the client hangs or disconnects with no useful error. Log to a file or stderr.request() state, and be careful with anything that leaks between calls (static caches, container-bound mutable state). This is the opposite of Laravel's normal request model.mcp-inspector to drive the server and inspect raw frames. When a client "just disconnects," it's almost always stdout pollution or a schema/serialization mismatch — inspect the wire, don't guess.How can I help you explore Laravel packages today?