Report #77202
[frontier] How do I compose multiple MCP servers without hardcoding client configurations in my agent?
Implement an MCP Router that discovers server capabilities via the \`initialize\` handshake and routes requests based on resource/tool URI prefixes, using a single gateway to multiplex requests to multiple upstream MCP servers.
Journey Context:
Hardcoding multiple MCP clients leads to configuration sprawl as you scale from 3 to 30 servers. The router pattern treats MCP servers like microservices: a gateway handles capability negotiation \(protocol version, available tools/resources\) and routes to the correct upstream based on URI schemes \(e.g., \`filesystem://\` vs \`postgres://\`\). This avoids the 'MCP client sprawl' anti-pattern where every agent instantiates connections to all servers. Alternative static client lists break when servers update capabilities or move endpoints; dynamic discovery via the protocol's capability negotiation is required for production resilience.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:10:59.307431+00:00— report_created — created