[MCP Bundle] Add MCP profiler support to display server capabilities#866
Conversation
chr-hertel
left a comment
There was a problem hiding this comment.
Thanks, this looks great already, but let's please switch to a TraceableRegistry once modelcontextprotocol/php-sdk#150 gets merged - makes sense?
|
Would love to see some infos around the MCP Profiler and the screenshot in the documentation |
chr-hertel
left a comment
There was a problem hiding this comment.
We should be able to use/decorate the Registry directly now and skip the ProfilingLoader, right?
chr-hertel
left a comment
There was a problem hiding this comment.
Looks good & works with the demo - one last thing about the service registration tho 👍
Thanks already!
| ->set('ai.mcp.registry.inner', Registry::class) | ||
| ->args([service('event_dispatcher'), service('monolog.logger.mcp')]) | ||
|
|
||
| ->set('ai.mcp.registry', TraceableRegistry::class) | ||
| ->args([service('ai.mcp.registry.inner')]) |
There was a problem hiding this comment.
let's shift that into McpBundle, make it conditional, drop the ai. prefix in favor of just mcp. and use the decoration feature of the container:
if ($container->getParameter('kernel.debug')) {
$traceableRegistry = (new Definition('mcp.traceable_registry'))
->setClass(TraceableRegistry::class)
->setArguments([new Reference('.inner')])
->setDecoratedService('mcp.registry');
$container->setDefinition('mcp.traceable_registry', $traceableRegistry);
}
chr-hertel
left a comment
There was a problem hiding this comment.
Thanks for kicking this off - we can build up on this now with more features :)
9904c9c to
1860e5f
Compare
|
Thank you @camilleislasse. |
Description
This PR adds a Web Profiler integration for the MCP Bundle that displays MCP server capabilities (tools, prompts, resources, resource templates) in the Symfony debug toolbar and profiler panel.
Features
Note: This implementation depends on the loader pattern. If MCP SDK PR #146 (direct Registry injection via DI) is merged, this approach may need adjustment.