Skip to content

Wolfgang-check24/symfony-mcp-test-project

Repository files navigation

MCP Demo Project

This is a demo project showcasing the Symfony MCP Server bundle.

Features

  • Symfony 6.4 framework
  • MCP (Model Context Protocol) server integration
  • Custom demo tool example
  • Built-in example tools (hello-world, stream-data, check-version)

Tools Available

Demo Tool (demo_tool)

A simple greeting tool that demonstrates how to create custom MCP tools.

Parameters:

  • name (required): The name to greet
  • message (optional): Custom message (default: "Hello")

Example:

php bin/console mcp:test-tool demo_tool --input='{"name":"Developer","message":"Welcome"}'

Built-in Example Tools

  • hello-world: Basic greeting tool
  • stream-data: Demonstrates streaming data processing
  • check-version: Returns current Symfony version

Testing Tools

List all available tools:

php bin/console mcp:test-tool --list

Test a specific tool:

php bin/console mcp:test-tool [tool_name] --input='{"param":"value"}'

MCP Server Endpoints

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

Configuration

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

Development

To add a new tool:

  1. Create a class implementing StreamableToolInterface
  2. Add it to the tools section in config/packages/klp_mcp_server.yaml
  3. Test with php bin/console mcp:test-tool [tool_name]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages