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

@soyuka soyuka force-pushed the mcp-bundle-integration branch 3 times, most recently from d136520 to b904a0d Compare January 12, 2026 08:37
Copy link
Contributor

@rvanlaak rvanlaak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting that the mcp repo's schema PR is merged now, and you're able to spend time on API Platform integration.

Tried reviewing this PR without checking it out and testing it, so please feel free to ignore all my comments / suggestions / nitpicks 🙌 Just trying to provide you with another pov at some classes.

@soyuka
Copy link
Member Author

soyuka commented Jan 12, 2026

Exciting that the mcp repo's schema PR is merged now, and you're able to spend time on API Platform integration.

Yeah it was the missing part + now I can also test out to use only the json-schema component's of API Platform to produce MCP SDK's schemas!

OskarStark added a commit to symfony/ai that referenced this pull request Jan 13, 2026
This PR was merged into the main branch.

Discussion
----------

[MCP Bundle] bump php-sdk to 0.3

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Docs?         | no
| Issues        | api-platform/core#7595
| License       | MIT

Commits
-------

ce5758f bump php-sdk to 0.3
symfony-splitter pushed a commit to symfony/mcp-bundle that referenced this pull request Jan 13, 2026
This PR was merged into the main branch.

Discussion
----------

[MCP Bundle] bump php-sdk to 0.3

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Docs?         | no
| Issues        | api-platform/core#7595
| License       | MIT

Commits
-------

ce5758fc bump php-sdk to 0.3
@soyuka soyuka force-pushed the mcp-bundle-integration branch 5 times, most recently from 192498f to 7ff8ba8 Compare January 14, 2026 10:55
@soyuka soyuka force-pushed the mcp-bundle-integration branch from 7ff8ba8 to f4151f8 Compare January 14, 2026 11:21
@soyuka soyuka force-pushed the mcp-bundle-integration branch from 620cc60 to 13f91e9 Compare January 14, 2026 16:32
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.

2 participants