An MCP gateway is a checkpoint between AI agents and the MCP servers they call. Every tool call passes through it, and the gateway decides, before the call reaches the tool, whether this agent may make this call right now with this data. In practice that means verifying the agent, checking the tool against the agent’s grant, applying rate limits, inspecting the payload and recording the outcome.
The Model Context Protocol (MCP) is a common way for AI agents to use tools. An agent connects to an MCP server and calls the tools it exposes, for example searching a ticketing system or updating a record. Without a gateway, each server decides for itself what to allow, and you only see what each server chooses to log.
Why a token is not enough
The usual answer to “how do we stop an agent doing too much?” is a narrowly scoped token. That helps, but a token is only as good as the server that checks it. Some MCP servers do not validate tokens at all, and others accept the token but ignore its scope. If the server belongs to a third party, you also have no way to audit what it allowed.
Even a well-behaved server leaves gaps, because nothing in the token limits how fast the agent calls or what it sends. An agent can make thousands of calls a minute with a perfectly valid token, or put customer data in a request. A gateway moves the decision to a point you control and can see, for every server, whoever built it.
What an MCP gateway does
The first job is knowing who is calling. The gateway checks which agent this is, whether it is still active, and whether its owner still exists. It then checks scope: is this tool, on this server, within what the agent was granted?
Rate limits come next, and they need to work across servers as well as per server. An agent that stays under each server’s limit can still fan out across many of them, so a per-agent limit over all servers closes that gap.
The gateway also reads the data. Requests can carry personal data or secrets out, and responses can bring a secret back to the agent, so both directions get inspected. On top of that sit policies: some calls should be allowed, some refused, and some held until a person approves them.
Finally, every call becomes an audit event, whether it was allowed, denied or flagged. When someone asks what an agent actually called last Tuesday, you answer from one log instead of piecing it together from each server.
Where the gateway sits
The path is agent → gateway → MCP server. The agent never calls the server directly. It sends the tool call to the gateway’s endpoint for that server, with its own credential, and the gateway forwards it only if the checks pass. The reply comes back the same way, which is what lets the gateway inspect it before the agent reads it.
Access-control architecture has two useful terms for this. The policy decision point works out the answer (allow, deny or hold for approval) from the agent’s identity, its grants, the tool, the arguments and the policies that apply. The policy enforcement point carries the answer out by forwarding the call, refusing it or waiting. An MCP gateway can be both, or it can be the enforcement point that asks a separate decision service. The second shape suits teams that already run an API gateway and would rather not add a second proxy.
Placement only works if the gateway is the only path. If an agent knows the server’s real URL and holds a key the server accepts, it can go around the gateway, and that call is never seen. Closing the path is a deployment task on the server side: the server should accept only calls that carry a credential the gateway issued for it.
There is one gap a network gateway cannot close. Many MCP servers run as a local process that a desktop or IDE client starts and talks to over stdin and stdout, and that traffic never crosses a network.
MCP gateway vs API gateway
An API gateway such as Envoy or Kong routes HTTP traffic, terminates TLS, authenticates clients and applies rate limits. An MCP gateway overlaps with that, but it understands what the traffic means.
Where an API gateway sees a POST to a path, an MCP gateway reads the MCP message, knows which tool is being called with which arguments, and checks that tool against the agent’s grant on that server. Its decisions are made per agent identity, with an owner and a status, rather than per API key shared by many callers.
It also inspects payloads for sensitive data in both directions, since a tool reply can carry a secret back. And because it sees every server, it can connect calls that look harmless on their own: an agent that reads a customer record from one server and then sends it out through another.
Tool definitions are the last difference. A tool’s description is read by the model, so if it changes after you approved the server, or contains text written to instruct the model, the agent may follow it. An MCP gateway can watch for that; a generic API gateway has no idea what a tool description is.
The two are not rivals. Your existing API gateway can act as the enforcement point and ask an MCP-aware service for the decision on each tool call.
Rolling one out safely
Blocking calls you did not expect is how you break production. Start the gateway in observe mode, where every check runs, nothing is blocked and would-be denials are logged. Read that log for a while, then switch to enforcing once you know what would change. Doing it server by server, starting with the servers that can change data, keeps the blast radius of a wrong rule small.
What to look for when choosing one
When your team evaluates gateways, these are the questions worth asking:
- Does each agent authenticate as itself, with a registered owner, or do agents share keys?
- Can grants name individual tools on a server?
- Is there an observe mode per server, with a preview of what enforcing would have blocked?
- Do rate limits apply per agent across all servers?
- Are both requests and responses inspected, and can you add your own rules?
- Can a sensitive call be held for a person without rewriting the agent?
- Can the server verify that a call came through the gateway?
- Does it fail closed when it cannot decide?
- Do agent calls land in the same audit trail as the people who granted and approved them?
- What is the plan for local servers the gateway cannot see?
How AtmanID approaches it
The AtmanID gateway sits inline on every agent → MCP call, and each server has one of three modes:
- Shadow: full checks run and would-be denials are logged, but nothing is blocked.
- Enforce: the same checks block.
- Direct: a break-glass bypass.
Promoting a server from shadow to enforce first shows a preview of what the shadow log would have denied. Rate limits apply per agent globally and per agent per server, and DLP checks scan requests and responses, with tenant-authored rules on top of the built-in ones (MCP Gateway guide). Agents get scoped tokens through the MCP bearer-token flow.
Intent policies decide whether a call is allowed, denied or held for a person to approve, and a call that matches no policy is denied. When an agent asks the gateway for a server’s tool list, it gets the descriptions the server’s owner approved rather than whatever the server says today.
To make the gateway the only way in, it can send each server a short-lived token that AtmanID signs for that server only, and you configure the server to refuse calls without it. If the gateway cannot decide, the call fails instead of going through (Deploying so nothing bypasses the gateway). If you already run Envoy or Kong, you can keep it as the enforcement point and ask AtmanID for each decision (Enforce AtmanID decisions in your own gateway). Local stdio servers are outside what the gateway sees today, and the docs say so.
FAQ
Is an MCP gateway the same as an MCP proxy?
A proxy forwards MCP traffic. A gateway forwards it only after checking identity, tool scope, rate, payload and policy. Many gateways are built as proxies, but it is the checks and the audit record that make one a gateway.
Do I still need tokens if I have a gateway?
Yes. The gateway needs a credential to know which agent is calling, and the token’s scope is what it checks the tool against. What the gateway adds is that the check happens on every call, whoever built the server.
Does an MCP gateway add latency?
Every inline check adds some time to a call, with payload inspection and policy evaluation the main costs. Measure it on your own traffic while the gateway is in observe mode, before you depend on it.
What happens if the gateway is down?
That depends on the gateway, so ask before you choose one. One that lets calls through when it cannot decide is no longer a control, which is why failing closed is the safer default for tools that change data.
Can an MCP gateway stop prompt injection?
Not on its own, because it cannot see what the model was told inside a document it read. It can limit the damage: a tool outside the agent’s grant is refused, a secret in a request is blocked, and a changed or suspicious tool description can be held for review.
Do local MCP servers go through a gateway?
Not when they run over stdin and stdout on the same machine as the client. Host the servers that do not need local files over HTTP behind the gateway, and give the ones that must stay local the narrowest access the operating system allows.
Related: AI agent access control · What is a non-human identity? · How to govern AI agents