Context
I’m running symfony/mcp-bundle over HTTP transport behind FrankenPHP worker mode with:
The MCP endpoint is reachable and authenticated. initialize succeeds, but tools/list can return an empty array
even though MCP tools were discovered at startup.
────────────────────────────────────────────────────
Expected behavior
If tools are discovered (e.g. 4 tools), tools/list should return them consistently for subsequent requests in
the same MCP session.
Actual behavior
- initialize succeeds
- tools/list returns:
At the same time, MCP logs show discovery finding tools and then clearing discovered elements before/around
subsequent request handling.
────────────────────────────────────────────────────
Logs / evidence
MCP channel logs show:
- Attribute discovery finished. with context like tools: 4
- followed by: Removed 4 discovered elements from internal registry.
After that, tools/list may return empty.
────────────────────────────────────────────────────
Reproduction (HTTP MCP)
- Configure MCP bundle with HTTP transport and attribute-based tools in src/ (#[McpTool(...)]).
- Run in FrankenPHP worker mode with debug enabled (APP_DEBUG=1).
- POST /_mcp initialize:
{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": { "name": "repro", "version": "1.0" }
},
"id": 1
}
- Use returned Mcp-Session-Id and call:
{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 2
}
- Observe empty tools in affected runs.
────────────────────────────────────────────────────
Additional observations
- Setting APP_DEBUG=0 in the same environment makes tools/list return the discovered tools correctly.
- Behavior appears intermittent / client-flow dependent (request sequence/timing), but logs consistently show
discovered tools being cleared in debug worker mode.
────────────────────────────────────────────────────
Suspected cause
Potential interaction between worker lifecycle + debug registry reset in:
Symfony\AI\McpBundle\Profiler\TraceableRegistry
reset() calls clear(), which seems to remove discovered MCP capabilities across requests in worker mode.
Possibly related to:
────────────────────────────────────────────────────
Versions
- symfony/mcp-bundle: v0.8.0
- Symfony: 8.0.*
- Runtime: FrankenPHP worker mode
- Transport: HTTP (/_mcp)
- Env where reproduced: APP_ENV=dev, APP_DEBUG=1
Context
I’m running symfony/mcp-bundle over HTTP transport behind FrankenPHP worker mode with:
The MCP endpoint is reachable and authenticated. initialize succeeds, but tools/list can return an empty array
even though MCP tools were discovered at startup.
────────────────────────────────────────────────────
Expected behavior
If tools are discovered (e.g. 4 tools), tools/list should return them consistently for subsequent requests in
the same MCP session.
Actual behavior
{"tools":[]}At the same time, MCP logs show discovery finding tools and then clearing discovered elements before/around
subsequent request handling.
────────────────────────────────────────────────────
Logs / evidence
MCP channel logs show:
After that, tools/list may return empty.
────────────────────────────────────────────────────
Reproduction (HTTP MCP)
{ "jsonrpc": "2.0", "method": "initialize", "params": { "protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": { "name": "repro", "version": "1.0" } }, "id": 1 }{ "jsonrpc": "2.0", "method": "tools/list", "id": 2 }────────────────────────────────────────────────────
Additional observations
discovered tools being cleared in debug worker mode.
────────────────────────────────────────────────────
Suspected cause
Potential interaction between worker lifecycle + debug registry reset in:
Symfony\AI\McpBundle\Profiler\TraceableRegistry
reset() calls clear(), which seems to remove discovered MCP capabilities across requests in worker mode.
Possibly related to:
ResetInterfaceto prevent memory leaks #1533────────────────────────────────────────────────────
Versions