Route tool calls across multiple MCP servers with per-agent context isolation and on-demand discovery. For developers managing complex multi-agent systems who need fine-grained control over which tools each agent can access.
io.github.roddutra/agent-mcp-gateway
Agent MCP Gateway runs locally over stdio. Test it on your machine with MCP Playground Desktop:
Local install
STDIO
No auth required
How models use it and what it is built for.
Route tool calls across multiple MCP servers with per-agent context isolation and on-demand discovery. For developers managing complex multi-agent systems who need fine-grained control over which tools each agent can access.
Local install — runs as a subprocess.
Configuration this server reads at startup.
Path to MCP servers configuration file (default: .mcp.json)
Path to gateway access control rules file (default: .mcp-gateway-rules.json)
Default agent ID when not provided in tool calls
Enable debug mode and expose diagnostic tools (default: false)
Where to find authoritative docs and source for Agent MCP Gateway.
Paste any of these into Agent Studio after connecting Agent MCP Gateway.
Common questions about connecting and running Agent MCP Gateway.
What is the agent-mcp-gateway and why would I use it?
It's a gateway that routes tool calls to multiple MCP servers and enforces per-agent access control. Use it when you have multiple agents that need different subsets of tools to avoid wasting context window on irrelevant capabilities.
How do I configure which MCP servers the gateway connects to?
Create a `.mcp.json` configuration file (or set GATEWAY_MCP_CONFIG to a custom path) that lists your MCP servers. The gateway will discover and route tools from all configured servers.
How do I restrict which tools each agent can access?
Create a `.mcp-gateway-rules.json` file (or set GATEWAY_RULES to a custom path) that defines access control rules per agent. The gateway will enforce these rules when routing tool calls.
What does the GATEWAY_DEFAULT_AGENT environment variable do?
It sets a fallback agent ID when a tool call doesn't explicitly specify which agent is making the request. This ensures tool routing works even if the agent context is missing.
How do I troubleshoot tool routing or connection issues?
Set GATEWAY_DEBUG=true to enable debug mode, which exposes diagnostic tools and logs. This will help you see which servers are connected, which tools are available, and how calls are being routed.
MCP Playground runs 10,000+ hosted MCP servers — GitHub, Linear, Notion, Stripe, Sentry and more — across Claude, GPT, Gemini, DeepSeek and 60+ AI models. Compare model answers side-by-side, save agent presets, share runs. Zero install.
Open Agent StudioIn your browser
MCP Agent Studio
Server has a public URL? Chat with 90+ models on it, watch every tool call, and compare models side by side.
Open MCP Agent Studio →On your computer
MCP Playground Desktop
Server runs on localhost or over stdio? The browser can’t reach it. The desktop app can, with 90+ models in Agent Studio. Download free
Judges Panel
45 judges that evaluate AI-generated code for security, cost, and quality with built-in AST.
Addozhang Nexus
Query Sonatype Nexus Repository (OSS/Pro) for Maven, Python, and Docker artifacts
Cyanheads MCP Ts Template
TypeScript template for building MCP servers with declarative tooling, observability, and auth.
Chernistry Bernstein
Declarative agent orchestration for engineering teams