You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Server] Compatibility of Capabilities with Symfony's Container #67
Passing container and using ->get() won't work with Symfony by default since services are private.
The \"App\\Tools\\PythonTool\" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.
only way to make it work is to set service public.
While this will work with containers like PHP-DI for example, it won't work with Symfony.
All services inside Symfony container are private, so ->container->has(CLASSNAME) will return false unless it explicitly set as public.
I don't really see how to fix it, since it's not a bug.
Maybe there should be Symfony specific documentation which will explicitly say that Tools/Resources/Prompts must be public if they have any dependencies:
For example this in services.yaml will fix those issues
services:
...# Make ALL services in App\Tools\ publicApp\Tools\:
resource: '../src/Tools'public: true
That's alright, we can use a locator build with the services that have the attributes on them - that'll work :)
I'll take care while patching up the mcp-bundle
Activity
ineersa commentedon Sep 14, 2025
It's slightly different from what was in PHP-MCP package (for some reason I was using it before swapping to this one), but it still persists.
When we try to resolve how to get tool handler we will call
->container->has(CLASSNAME)While this will work with containers like PHP-DI for example, it won't work with Symfony.
All services inside Symfony container are private, so
->container->has(CLASSNAME)will returnfalseunless it explicitly set as public.I don't really see how to fix it, since it's not a bug.
Maybe there should be Symfony specific documentation which will explicitly say that Tools/Resources/Prompts must be public if they have any dependencies:
For example this in
services.yamlwill fix those issueschr-hertel commentedon Sep 14, 2025
That's alright, we can use a locator build with the services that have the attributes on them - that'll work :)
I'll take care while patching up the mcp-bundle
chr-hertel commentedon Nov 11, 2025
This should be solved with the bundle - fair to close @ineersa?
ineersa commentedon Nov 12, 2025
Sure! I need to try bundle =)
chr-hertel commentedon Nov 14, 2025
Closing for now - feel free to re-open if there are issues with the bundle.
axi commentedon Nov 18, 2025
Hi,
I'm facing the same error, for others reading this, I think the discussion mentions the "bundle".