Skip to content

Conversation

@soyuka
Copy link
Member

@soyuka soyuka commented Dec 9, 2025

Q A
Branch? main
Tickets na
License MIT
Doc PR needed

Rework of #7458

Now with a simpler approach, this gives the ability to add McpTool (upcoming McpResource) to any API Platform environment giving access to:

  • automatic input JSON Schema's (waiting for feat: Add output schema support to MCP tools modelcontextprotocol/php-sdk#153 for output schema compatiblity)
  • automatic structured content
  • reuses the Symfony serializer under the hood (with all the capabilities of API Platform including optional iris using item_uri_template)
  • allows to return a custom CallToolResult (from the php-sdk itself for images, sound etc.)
  • ability to reuse Symfony validation constraints as usual
  • works with doctrine entities if needed (calls the provider and the processor on demand)
  • integrates with the symfony security features

TODO:

  • test with #[McpTool] attribute
  • test using an entity
  • test custom CallToolResult content
  • test validation
  • test #[McpResource]

Because MCP uses JSON-RPC under the hood with some particular response objects (from php-sdk) we can not change returned headers yet (we'll work on an extension point).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant