Context
Following a Slack discussion with @chr-hertel: with api-platform/mcp (4.3) and the MCP Client now in mcp/sdk (impl #192, docs #259), the publisher side is in good shape. The consumer side still requires hand-written #[AsTool] wrappers per remote tool, duplicating names, descriptions, and schemas that the MCP server already advertises.
@ineersa (Illia Vasylevskyi) shared a working implementation that illustrates the gap:
The wrapper has to redeclare each tool's description because the Toolbox doesn't pull them from the server. Add a remote tool, edit PHP. Rename a description on the server, drift.
Proposal
A bridge that registers MCP-server tools into the Agent Toolbox at runtime, sourcing metadata from the server's tools/list response.
Sketch:
ai:
agent:
my_agent:
mcp_servers:
api_platform:
transport: http
url: 'https://shop.example.com/mcp'
research:
transport: stdio
command: ['php', 'bin/mcp-research']
At boot (or first call), the bridge calls tools/list on each server, builds Tool metadata from the response, and adds a generic RemoteMcpTool executor to the Toolbox. The Agent sees these alongside #[AsTool]-tagged services with no per-tool PHP.
Open questions worth deciding in the issue
- Discovery timing — boot-time (cache friendly, stale on server changes) vs lazy on first call vs
tools/listChanged notifications.
- Naming collisions across servers — prefix by server alias (
api_platform.search_products) seems safest.
- Auth passthrough for HTTP transports — user token, service token, or per-server config.
- Failure mode when a server is unreachable — skip silently, log, or fail the agent call.
Claude and I are happy to draft the bridge against the mcp/sdk client if the direction is welcome.
Related: #41, #1259.
Context
Following a Slack discussion with @chr-hertel: with
api-platform/mcp(4.3) and the MCP Client now inmcp/sdk(impl #192, docs #259), the publisher side is in good shape. The consumer side still requires hand-written#[AsTool]wrappers per remote tool, duplicating names, descriptions, and schemas that the MCP server already advertises.@ineersa (Illia Vasylevskyi) shared a working implementation that illustrates the gap:
The wrapper has to redeclare each tool's description because the Toolbox doesn't pull them from the server. Add a remote tool, edit PHP. Rename a description on the server, drift.
Proposal
A bridge that registers MCP-server tools into the Agent Toolbox at runtime, sourcing metadata from the server's
tools/listresponse.Sketch:
At boot (or first call), the bridge calls
tools/liston each server, buildsToolmetadata from the response, and adds a genericRemoteMcpToolexecutor to the Toolbox. The Agent sees these alongside#[AsTool]-tagged services with no per-tool PHP.Open questions worth deciding in the issue
tools/listChangednotifications.api_platform.search_products) seems safest.Claude and I are happy to draft the bridge against the
mcp/sdkclient if the direction is welcome.Related: #41, #1259.