AgentCat v2.0.1 β FastMCP Code Mode support
AgentCat now fully supports servers built on FastMCP Code Mode β and, more generally, any server that calls itself mid-request: catalog meta-tools fetching the hidden catalog, sandboxes chaining tools through call_tool, one tool composing another.
The bug this fixes
Code Mode's meta-tools fetch the real tool catalog from inside a tools/call (fastmcp's CatalogTransform.get_tool_catalog, which lists with run_middleware=True). That mid-call listing re-entered AgentCat's injection pass and rebuilt the strip registries from the raw backend catalog β replacing the agent-facing ones. On any Code Mode server:
- Broken calls: after the first
execute, the injectedsession_id/contextarguments were no longer stripped, so an agent echoing the handle it was just issued failed FastMCP validation withUnexpected keyword argumenton every subsequent call. - The outer call's structured
_mcp_instructionsmirror was silently dropped.
Separately, inner sandbox calls each minted their own session β fragmenting one logical execute across several β and their results carried mint-back decoration into the sandbox, where generated code trips over the extra key.
What v2.0.1 does
The community adapter now distinguishes agent-facing traffic from server-internal traffic. While a tracked call is in flight:
- A nested
tools/listis served verbatim β no injection, no registry writes. Agent-facing registries survive, and sandbox-facing catalogs stay clean. - A nested
tools/callis still tracked β you get per-tool analytics inside Code Mode blocks β but it joins the enclosing call's session (oneexecute, one session), carries the new presence-gatedagentcat_nested: "true"tag, and is never decorated, so your tool code always sees your own data.
agentcat_session_id_source keeps the outer call's value on nested events, so existing dashboards, queries, and exporter pipelines are unaffected; nested events are filterable via the new tag.
Verified across the supported matrix β mcp 1.x with fastmcp 3.0.0 through 3.4.5, mcp 2.x with fastmcp 4.0.0b1 β including end to end over streamable HTTP against a live Code Mode server.
Full Changelog: v2.0.0...v2.0.1