Guide10 min read
What is an MCP gateway, and when does your team need one?
An MCP gateway puts many MCP servers behind one endpoint, with one sign-in, one place to decide who can call which tool, and one record of every call. How it works, how it differs from an MCP proxy, an API gateway and an AI gateway, what it cannot fix, and when you need one.
Zenitya TeamZenitya
An MCP gateway is a server that sits between AI agents and the MCP servers they use. Agents connect to one gateway endpoint instead of to every server, and the gateway signs them in, shows each caller only the tools it is allowed to use, routes each tool call to the right server with that server's credentials, and records what happened. It is to MCP tools what an API gateway is to HTTP APIs, with one difference that matters: it understands MCP, so it can filter tools/list and inspect tools/call instead of only forwarding requests.
A gateway is not something the MCP specification defines. The architecture in the current revision, 2026-07-28, has three roles: a host (the AI application), clients inside it, and servers, with each client talking to exactly one server. The words gateway and proxy do not appear. A gateway is a server to the agent and a client to every server behind it, which is why it fits the protocol without changing it.
Why MCP gateways exist
Connecting one agent to one MCP server is easy. The trouble starts with the tenth server and the fiftieth person. Without a gateway, every person adds every server to every agent they use: Claude Code, Cursor, Codex, ChatGPT. Each connection has its own sign-in, its own API key or token on someone's laptop, and its own idea of which tools are safe to call. Nobody can answer simple questions such as who can create issues in Linear from an agent, or which tools support used last week.
AWS's prescriptive guidance for MCP puts the fix in one sentence: a gateway acts as a centralized proxy between MCP clients and servers, so an agent connects to a single endpoint that handles authentication, authorization, routing and protocol translation. At larger scale the pattern looks like Uber's: its MCP Gateway, described in October 2026, fronts over 800 MCP servers and more than 5,000 tools for the company's agents.
How an MCP gateway works
- The agent connects to the gateway's URL as if it were one remote MCP server, over Streamable HTTP, and signs in once, usually with OAuth for people and an API key for scripts and CI.
- When the agent asks for tools/list, the gateway gathers the tools of every server behind it, namespaces them (linear.create_issue, sentry.list_issues) so names never collide, and returns only the tools this caller is granted.
- When the agent calls a tool, the gateway checks the grant again, picks the server that owns the tool, attaches that server's credential and forwards the call.
- It records the call: who made it, which tool, when, and whether it succeeded, so usage and access can be reviewed in one place.
The 2026-07-28 revision made MCP stateless: there is no session or initialize handshake any more, and every request carries its protocol version and capabilities. For gateways that removes the hardest routing problem of earlier revisions, keeping a session pinned to the one server replica that held its state.
What an MCP gateway does
- One endpoint for every agent and every person, so adding a server is done once for the whole team, not on every laptop.
- Inbound authentication: people sign in with their own identity, and automation uses keys that can be scoped and revoked.
- Upstream credentials held centrally, so API keys and OAuth tokens for the servers behind it never reach anyone's machine.
- Per-tool access control: a support group can read tickets while only engineering can merge pull requests, enforced on both listing and calling.
- Tool namespacing and curation: hiding tools nobody should call, and keeping names unambiguous across servers.
- Usage and audit: which tools are called, by whom and how often.
- Rate limits and quotas, so one runaway agent cannot exhaust an upstream API for everyone.
MCP gateway vs MCP proxy vs API gateway vs AI gateway
Vendors use these names loosely, so it helps to define them by what each one decides.
- MCP proxy: forwards MCP traffic to one server, often to bridge transports (a local stdio server exposed over HTTP). It does not decide who may call what.
- MCP gateway: an MCP proxy for many servers plus identity, per-tool policy, credentials and audit. It decides whether this caller may use this tool.
- API gateway: routes and secures HTTP APIs. It can sit in front of MCP traffic, but without understanding MCP it sees one endpoint and opaque JSON-RPC, so it cannot filter tools/list per caller.
- AI gateway (LLM gateway): sits between applications and model providers, handling model routing, token budgets and prompt filtering. It governs calls to models, not calls to tools, so many teams run both.
- MCP registry: a catalog of which MCP servers exist and are approved. It answers what is available; the gateway enforces who can use it.
When do you need an MCP gateway?
You probably need one when two or more of these are true:
- More than a handful of people use agents with MCP tools, and you set them up one laptop at a time.
- Servers need credentials you would rather not hand to every person, such as a production database or an admin API.
- Different teams should see different tools, or some tools should be read-only for most people.
- You use several agents (Claude Code, Cursor, Codex, ChatGPT) and want the same tools in all of them.
- Someone has to answer what agents did: for a security review, an incident or a customer.
- People join and leave, and access should follow their team instead of their personal config files.
You probably do not need one yet if a single developer uses two or three local servers, or if every server is public and read-only. Connecting only the servers a task needs, and turning off unused tools in the client, solves most early problems without new infrastructure.
Shared or per-user credentials?
Every gateway has two separate sign-ins: the caller to the gateway, and the gateway to each server behind it. The second one is the design decision that shapes everything else.
- Shared credentials: the gateway holds one token or key per server, used for every permitted caller. Simple, works for automation and service accounts, and access is controlled by the gateway's grants. When someone leaves, removing them from the gateway is enough. The upstream service sees the organization, not the person.
- Per-user credentials: each person authorizes each server with their own account, and the gateway keeps a token per person per server. The upstream service applies its own permissions and audit per person, at the cost of a consent step for every user and server, and no clean path for automation.
A useful rule: shared credentials for shared resources such as a knowledge base, an error tracker or internal tools, and per-user credentials where the upstream permissions differ per person, such as email or personal drives.
What an MCP gateway cannot fix
A gateway is a control point, not a cure. It limits how much damage a mistake can do, but it does not make the model careful.
- Prompt injection: text in an issue, email or web page can still steer the model. A gateway limits what a steered agent is allowed to call, which is why least-privilege grants matter more than detection.
- Malicious or compromised servers: a gateway forwards calls to the server you connected. Vet servers, prefer ones you or a trusted vendor run, and watch for tool descriptions that change.
- Bad tool design: an agent that has to chain ten generic API calls to answer one question will still be slow, expensive and sometimes wrong. A gateway routes those calls; it does not shorten the chain.
- Too many tools: aggregating servers can put hundreds of tool definitions in front of the model, which costs tokens and hurts tool choice. Grants that narrow the list per team, and tool search for the rest, keep it manageable.
How to choose an MCP gateway
- Hosted or self-hosted: Docker's MCP Gateway runs MCP servers in isolated containers with restricted privileges, Microsoft's open-source mcp-gateway targets Kubernetes, and API platforms such as Kong, Cloudflare and AWS (Bedrock AgentCore Gateway) add MCP to infrastructure you may already run.
- Identity: does it sign people in with your identity provider, and does it support service accounts with scoped keys for CI and bots?
- Upstream authentication: OAuth 2.1 to remote servers, static headers, shared or per-user credentials, and whether it refreshes tokens for you.
- Granularity: grants per tool, not only per server, enforced on tools/list and tools/call.
- Clients: works as a plain remote MCP server in Claude, Claude Code, Cursor, Codex and ChatGPT without a custom plugin.
- Your own tools: whether you can add tools your team writes, not only forward servers someone else runs.
- Network reach: whether calls can reach systems inside your VPC or VPN.
How Zenitya works as an MCP gateway
We built Zenitya for teams that want one MCP connection for everything their agents use. Everyone adds the same URL, https://api.zenitya.com/mcp, to Claude, Claude Code, Cursor, Codex or ChatGPT and signs in with OAuth; scripts, bots and CI use a service account key. Owners connect remote MCP servers such as Linear or Sentry once, with no credential, a static header or OAuth 2.1, and Zenitya keeps the credential and refreshes its tokens. Their tools appear namespaced, such as linear.list_issues, beside the rest.
Access goes through groups of people, service accounts and Slack or Discord channels, granted tool by tool. A connected server's instructions arrive as a skill agents can load, and search_tools lets an agent find a tool granted after it connected without reconnecting. The usage page shows every invocation by day and the busiest tools.
The part we care about most sits beside the gateway. Teams write their own tools in TypeScript and deploy them with zya deploy, so a workflow an agent used to improvise through a dozen generic calls becomes one deterministic tool. In our own measurement of one task, the custom tool used 31% fewer tokens, cost 23% less and had 55% fewer failures than an agent working through the same workflow on its own, by the median of 3 runs each way. When those tools need a database or an API inside your network, a runner on your own machine runs their calls there, so the systems never have to be exposed to us.
Is an MCP gateway part of the MCP specification?
No. The specification defines hosts, clients and servers, and each client talks to exactly one server. A gateway is a server to the agent and a client to the servers behind it, so it works with any MCP client without changes to the protocol.
What is the difference between an MCP gateway and an MCP proxy?
An MCP proxy forwards MCP traffic, usually to one server or to bridge a transport. An MCP gateway fronts many servers and adds identity, per-tool access control, central credentials and audit.
Can I use my API gateway as an MCP gateway?
It can route and protect the endpoint, but a gateway that does not understand MCP cannot filter tools/list per caller or authorize individual tool calls. Several API gateway vendors now add MCP-aware features for that reason.
Does an MCP gateway reduce token usage?
Only indirectly. Aggregating servers can increase the number of tool definitions an agent sees. Gateways reduce tokens when they narrow the tool list per caller or offer tool search, and the larger savings usually come from replacing multi-step improvised workflows with purpose-built tools.
Does an MCP gateway protect against prompt injection?
Not on its own. It limits which tools a manipulated agent can call and records what it did, which reduces the damage. Least-privilege grants, vetted servers and careful tool design are still needed.
Do I need an MCP gateway for Claude Code or Cursor?
Not for personal use with a few servers. It becomes worth it when a team wants the same tools in several agents, central credentials, per-team access or a record of tool calls.
What did the MCP 2026-07-28 revision change for gateways?
It made the protocol stateless by removing sessions and the initialize handshake, so a gateway no longer has to pin a client's session to one server replica. It also deprecated Dynamic Client Registration in favor of Client ID Metadata Documents for OAuth client registration.
Further reading
- Model Context Protocol: Specification 2026-07-28: Architecture
- Model Context Protocol: Specification 2026-07-28: Key changes
- AWS: Prescriptive Guidance: MCP hosting strategy
- Uber: Designing MCP Gateway: Uber's MCP management platform
- Docker: MCP Gateway
- Microsoft: mcp-gateway on GitHub
- Zenitya docs: Connecting agents over MCP
Zenitya Team writes about building tools for agents, MCP, and the practical side of turning a team's workflows into code every agent can call.
zenitya