mcp -bundle
A Symfony Bundle to create MCP servers
claude mcp add --transport stdio edouardcourty-mcp-server-bundle php -d vendor/bin/symfony bin/console mcp:serve --no-interaction \ --env APP_ENV="prod" \ --env APP_DEBUG="0" \ --env MCP_SERVER_NAME="My MCP Server" \ --env MCP_SERVER_TITLE="My MCP Server Display Name" \ --env MCP_SERVER_VERSION="1.0.0"
How to use
This MCP Server Bundle provides the tooling to build MCP-compatible servers within a Symfony application. It offers a structured way to define Tools (executable actions), their input schemas, and the JSON-RPC endpoints that clients use to invoke them. You can register Tool classes using attributes, define OpenAPI-aware input schemas for validation, and expose Tool results as a standardized ToolResult payload. Use the included configuration to initialize the server, then expose an /mcp endpoint (as configured) for clients to discover and call tools, pass prompts, and receive structured responses. Tools are designed to be dependency-injected like other Symfony services, enabling you to leverage your existing services, repositories, and external integrations when implementing tool logic.
How to install
Prerequisites:
- PHP (recommended >= 8.0) and Composer installed
- A Symfony project or a compatible PHP environment
-
Install the MCP Server Bundle via Composer: composer require ecourty/mcp-server-bundle
-
Register the bundle (if not using Symfony Flex): // config/bundles.php return [ // ... Ecourty\McpServerBundle\McpServerBundle::class => ['all' => true], ];
-
Configure routes for MCP (example): // config/routes/mcp.yaml mcp_controller: path: /mcp controller: mcp_server.entrypoint_controller
-
Create and configure MCP server settings: // config/packages/mcp_server.yaml mcp_server: server: name: 'My MCP Server' # The name used in initialization title: 'My MCP Server Display Name' # The display title version: '1.0.0' # Server version
-
Run your Symfony application as usual (e.g., via PHP built-in server or a webserver). Access the MCP endpoint (e.g., http://localhost/mcp) and use the supported tools via JSON-RPC calls.
Notes:
- This bundle is deprecated. Consider newer solutions for MCP servers when starting a new project.
- Ensure dependencies are compatible with your Symfony version.
- Refer to the CHANGELOG for historical changes and migration notes.
Additional notes
Important notes and tips:
- This MCP Server Bundle is marked as deprecated. It may still work, but it won’t receive updates or long-term support.
- MCP tooling relies on Symfony attributes to register Tool handlers; ensure PHP 8+ and Annotations/Attributes support are enabled.
- The MCP specification version referenced is 2025-06-18; verify compatibility if you upgrade the spec in your implementation.
- When debugging, check that your config/routes/mcp.yaml is loaded and that the /mcp endpoint is reachable.
- If you encounter tool invocation issues, verify that the Tool input schemas are correctly defined and that dependencies are injectable (via constructor) as shown in the examples.
- Environment variables in the MCP config are placeholders; tailor them to your deployment (e.g., enabling prod mode, securing endpoints).
Related MCP Servers
drift
Codebase intelligence for AI. Detects patterns & conventions + remembers decisions across sessions. MCP server for any IDE. Offline CLI.
laravel
A Laravel package for implementing secure Model Context Protocol servers using Streamable HTTP and SSE transport, providing real-time communication and a scalable tool system for enterprise environments.
php
基于 PHP 实现的 MCP (Model Control Protocol) 服务器框架,通过注解优雅地定义 MCP 服务,支持 Tool、Prompt、Resource 三种处理器,支持Stdio、Sse 两种 transport。
mcp-profiler-bundle
The Symfony MCP Profiler Bundle mimics the WebProfiler Bundle. It bridges the gap between Profiler data and your favorite MCP-enabled AI-powered IDE.
elementor
Comprehensive Elementor MCP Server plugin.
mcp
Model Context Protocol for Hyperf