Get the FREE Ultimate OpenClaw Setup Guide →

mcp -bundle

A Symfony Bundle to create MCP servers

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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
  1. Install the MCP Server Bundle via Composer: composer require ecourty/mcp-server-bundle

  2. Register the bundle (if not using Symfony Flex): // config/bundles.php return [ // ... Ecourty\McpServerBundle\McpServerBundle::class => ['all' => true], ];

  3. Configure routes for MCP (example): // config/routes/mcp.yaml mcp_controller: path: /mcp controller: mcp_server.entrypoint_controller

  4. 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

  5. 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

Sponsor this space

Reach thousands of developers