What happened?
Problem
When using MCPConfigTransport with a multi-server MCPConfig, if any single server in
mcpServers is unreachable at connection time, the entire session fails and the client
receives 0 tools — even if every other server is healthy.
Concrete use case
We run a proxy aggregating 6 upstream RemoteMCPServer entries. In production, servers go
down independently for maintenance. Currently, 1 unreachable server takes down all 6. In CI,
we often start only a subset of servers; we have to generate a trimmed MCPConfig dynamically
to work around this.
Expected behavior
Servers that fail to connect are skipped (with a warning); the session continues with whichever
servers connected successfully. The session only fails if all servers are unreachable.
Actual behavior
connect_session iterates mcpServers and calls _create_proxy() for each, which eagerly
connects via await client.__aenter__(). The first connection failure raises immediately,
cleaning up all transports:
# from MCPConfigTransport.connect_session()
try:
for name, server_config in self.config.mcpServers.items():
transport, _client, proxy = await self._create_proxy(
name, server_config, timeout, stack
)
except Exception:
for t in self._transports:
await t.close()
self._transports = []
raise # one unreachable server kills everything
Investigation
We worked around this by overriding connect_session to duplicate the parent's loop with
per-server try/except, rebuilding the MCPRouter composite manually. The workaround is
functional but breaks on any upstream refactor of connect_session.
Example Code
Version Information
FastMCP version: 3.1.1
MCP version: 1.26.0
Python version: 3.14.3
Platform: Linux-6.8.0-101-generic-x86_64-with-glibc2.35
FastMCP root path: /home/rdhupar/w/mcp/mcp-server/.venv/lib/python3.14/site-packages
What happened?
Problem
When using
MCPConfigTransportwith a multi-serverMCPConfig, if any single server inmcpServersis unreachable at connection time, the entire session fails and the clientreceives 0 tools — even if every other server is healthy.
Concrete use case
We run a proxy aggregating 6 upstream
RemoteMCPServerentries. In production, servers godown independently for maintenance. Currently, 1 unreachable server takes down all 6. In CI,
we often start only a subset of servers; we have to generate a trimmed
MCPConfigdynamicallyto work around this.
Expected behavior
Servers that fail to connect are skipped (with a warning); the session continues with whichever
servers connected successfully. The session only fails if all servers are unreachable.
Actual behavior
connect_sessioniteratesmcpServersand calls_create_proxy()for each, which eagerlyconnects via
await client.__aenter__(). The first connection failure raises immediately,cleaning up all transports:
Investigation
We worked around this by overriding
connect_sessionto duplicate the parent's loop withper-server
try/except, rebuilding theMCPRoutercomposite manually. The workaround isfunctional but breaks on any upstream refactor of
connect_session.Example Code
Version Information