This is a demo project showcasing the Symfony MCP Server bundle.
- Symfony 6.4 framework
- MCP (Model Context Protocol) server integration
- Custom demo tool example
- Built-in example tools (hello-world, stream-data, check-version)
A simple greeting tool that demonstrates how to create custom MCP tools.
Parameters:
name(required): The name to greetmessage(optional): Custom message (default: "Hello")
Example:
php bin/console mcp:test-tool demo_tool --input='{"name":"Developer","message":"Welcome"}'hello-world: Basic greeting toolstream-data: Demonstrates streaming data processingcheck-version: Returns current Symfony version
List all available tools:
php bin/console mcp:test-tool --listTest a specific tool:
php bin/console mcp:test-tool [tool_name] --input='{"param":"value"}'The server provides the following endpoints:
/mcp/message- Main MCP message endpoint/mcp/sse- Server-Sent Events endpoint for streaming/mcp/streamable-http- StreamableHTTP transport endpoint
The MCP server is configured in config/packages/klp_mcp_server.yaml with:
- Server name: "Demo MCP Server"
- Enabled transports: StreamableHTTP and SSE
- Redis adapter for caching (localhost)
- Ping functionality enabled
To add a new tool:
- Create a class implementing
StreamableToolInterface - Add it to the
toolssection inconfig/packages/klp_mcp_server.yaml - Test with
php bin/console mcp:test-tool [tool_name]