-
-
Notifications
You must be signed in to change notification settings - Fork 137
[MCP Bundle] Add MCP profiler support to display server capabilities #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good & works with the demo - one last thing about the service registration tho 👍
Thanks already!
src/mcp-bundle/config/services.php
Outdated
| ->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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.