Est.

MCP Gateway Architecture for Enterprise Deployments

MCP needs purpose-built gateways, not API gateways, to control tool access securely.

· 9 min read · Updated
Cover illustration for “MCP Gateway Architecture for Enterprise Deployments”
MCP Server Management · August 22, 2026 · 9 min read · 2,003 words

The Model Context Protocol ships without authentication, without rate limiting, without audit logging, and without access control, and that absence is not an oversight waiting on a future spec release. The protocol's own roadmap names audit trails, enterprise-managed auth, and gateway and proxy patterns as gaps, and it doesn't intend to fill them itself. That matters because it means the people who built MCP already agreed the governance work belongs somewhere else, not to critics pointing out a flaw after the fact. So if an agent makes a tool call through a bare MCP connection, it runs unauthenticated, unlogged, and unscoped, unless something outside the protocol stops to check it first.

The instinct to reach for an existing API gateway here is reasonable and wrong. API gateways were designed assuming deterministic app-to-app traffic, static key authentication, and attacks like SQL injection or DDoS floods. MCP's actual threat surface looks nothing like that: tool poisoning, context leakage, and indirect prompt injection are the live risks, and none of them trip the inspection logic a traditional API gateway runs. These are solid products solving a problem that isn't this one.

There's also a coverage gap that has nothing to do with inspection logic. An API gateway only governs traffic that actually passes through it. If a developer wires an open MCP tool straight into an editor like Cursor, that connection never touches the API gateway at all. No amount of policy configured on the gateway does anything for traffic that routes around it. MCP needs a purpose-built control point, and nothing already sitting in most enterprise stacks is built to be that point.

Why STDIO Local Servers Are a Security Liability

Before anyone designs what a gateway enforces, they have to decide where the gateway can physically sit, and that decision runs straight into MCP's two transport options. STDIO and Streamable HTTP are not interchangeable preferences; they're a fork in the road, and for any shared resource STDIO is the wrong branch. STDIO runs an MCP server as a local process on a developer's own machine. IT and security teams get no centralized audit trail, no access controls, and no way to revoke permissions the day someone leaves the company. The server lives wherever the laptop lives.

The risk compounds when that local server has credentials to anything valuable. A single compromised laptop becomes a complete credential exfiltration path, because the exposure isn't one hardened, monitored server in a data center but every enrolled device in the company, each running its own invisible process with its own standing access.

That gives the architecture a usable rule of thumb: if the MCP server touches any shared resource, a database, an internal API, a SaaS system, it has to run as a remote Streamable HTTP service sitting behind real authentication and access controls. This isn't a stylistic preference about transports. Streamable HTTP is the precondition for a gateway having anything to govern in the first place. A gateway can only enforce policy on the requests that reach it, and a local STDIO server never reaches it, which makes any governance architecture built around that gateway irrelevant for that traffic. Research from firms like Wiz and OX Security on local-server security has confirmed the same pattern from the attacker's side: the moment an MCP server touches a shared resource, whatever security model existed for it collapses.

None of this means STDIO is wrong everywhere. A single developer running local tooling against only their own files is the one scenario where STDIO is still the right call, because there's no shared resource for a compromised laptop to leak and no second user whose access needs tracking. Enterprise production workloads rarely stay inside that boundary. Once a tool touches a shared database, an internal API, or anything another team depends on, the STDIO model is indefensible, and that's most of what enterprises are actually building.

The authentication layer: why OAuth 2.1 with IdP integration is the only viable foundation

Once the transport decision puts a gateway in the request path, the first job that gateway has to do is figure out who, exactly, is making each request. Every agent and every human user has to resolve to a real principal in the enterprise identity provider. A gateway-local principal, a virtual key, a Consumer record, a shared service account, works fine for a demo and turns into a liability the day someone leaves the company. Revoking a person in Okta or Entra does nothing to a gateway-issued key if the two were never actually linked.

OAuth 2.1 is the standard the specification itself points to for solving this. The enterprise security model for MCP rests on OAuth 2.1 to handle authentication, zero-trust validation of each request, and least-privilege scoping of what each tool call is allowed to touch. In practice, the gateway takes on the role of OAuth client to every upstream service it talks to: it signs a person in once, stores and refreshes the tokens for every system behind it, and holds shared API keys for the services that don't support per-user OAuth yet. That one design choice is what keeps credentials from sprawling across every agent and every client someone happens to configure.

A newer piece of the standard, Enterprise-Managed Authorization, addresses this at the organizational level, but only a specific part of it. EMA reached stable status, and Anthropic, Microsoft, and Okta have adopted it, so a user now signs in once and gets access to every approved server instead of facing a per-server consent prompt. Under the hood it runs on an Identity Assertion JWT Authorization Grant, an ID-JAG, and the MCP server's own authorization server exchanges this for an access token. That solves the sign-on experience cleanly. It does not solve what happens after sign-on: EMA governs initial access, not what an agent is allowed to do on any given call once it's inside a system. Organizations still need their own runtime controls for that, which is what the policy layer covers next.

The hardest piece of this puzzle remains unresolved at the protocol level. The MCP roadmap calls out agent identity as a priority because autonomous agents need their own identity and delegation patterns, not a pasted API key or a long-lived token copied into a config file somewhere. When an agent requests a tool execution, the gateway has to confirm that agent is acting within the permission scope of the specific user it's representing, not whoever originally set up the integration and not a shared service account, through user-delegated OAuth flows at the time of the request, not at setup time. Standards bodies are still working out the cleanest way to do this, and the gateway is, for now, the only place in the architecture where that resolution can actually happen.

The routing layer: how the gateway maps tool namespaces to backend servers without creating new sprawl

With identity resolved, the gateway's next job is to make sure requests land on the right backend without turning into a second sprawl problem of its own. Routing is what turns the gateway into a single endpoint rather than another coordination headache: it maps tool namespaces to the backend MCP servers that actually implement them, and it hides the topology of those servers from the agents calling in. Without that layer, every agent needs direct credentials to every MCP server it might ever call. With it, platform teams point every agent at one gateway and manage tool access from one place.

The mechanics are straightforward on the surface: the gateway takes in all requests through a single URL, routes each tool call to the correct backend server, and runs health checks to know which backends are alive. So the platform team handles server topology centrally as an operational concern rather than a configuration burden every agent developer has to solve from scratch.

Internal APIs make this layer more complicated than it sounds, because gateways differ sharply on how an internal API becomes an MCP tool in the first place. Some convert an existing OpenAPI contract directly, so no new server code is required. Others generate and host a server from that contract. Some package the whole thing as a container, and some require a fully running MCP server with its own credentials before setup even begins. That difference decides whether the platform team becomes a bottleneck for every single new integration request or stays out of the way.

Left unmanaged, routing produces its own version of the sprawl it's supposed to prevent. MCP servers get pulled from third-party repositories with no cryptographic verification and no security review, and they tend to stay running indefinitely with no lifecycle management attached, so they turn into zombie servers nobody remembers to decommission (a documented supply chain risk in its own right). Microsoft's internal approach treats a single allowlist as the fix: every approved server and connector lives in one catalog with a documented owner, a defined scope, and clear data boundaries, and anyone building something new picks off that shelf.

The July 2026 spec update complicates the routing picture further, because it introduces stateless architecture, and that changes some long-standing assumptions about how a session's identity gets tracked across requests. Akamai flagged three specific risks tied to the new stateless tracking identifiers: an attacker hijacking an active workflow, one agent accessing data that belongs to a different agent, and unauthorized actions triggered across tenant boundaries. Maxim Zavodchik, senior director of threat research at Akamai, put the implication this way: "critical security boundaries are now entirely dependent on how developers implement them." The spec doesn't enforce those boundaries on its own, so the routing layer is where they have to be enforced instead.

The policy engine: enforcing RBAC and tool-level access control tied to real identity

Authentication settles who someone is and routing settles where their request goes. What's still unresolved at that point is which tools that specific person or agent is actually allowed to call, and that's the policy engine's job. It has to filter two different things, the list of tools a principal is even allowed to see and the individual calls that principal attempts to make, not just gate the connection at the front door.

Several products marketed as MCP gateways stretch the word "gateway" past what it should mean, functioning closer to proxies that move traffic from agent to server competently but never actually filter which tools a given principal is permitted to see or call. A real policy engine filters both the tools/list response and the tools/call request. An agent that can discover a restricted tool, even if it's blocked from calling it, has already learned that tool exists, and that discovery itself is a leak. So the standard fix is per-key or per-team allow-lists, enforced at both the listing stage and the call stage.

None of this works if role assignments live only inside the gateway. Tying RBAC to the enterprise identity provider rather than managing it as a separate table inside the gateway itself is the only version of this that survives organizational change. Roles defined only in the gateway go stale the moment someone's group membership changes in Okta or Entra, because the policy engine has to evaluate every authorization decision against identity and group data sourced from the IdP directly, not from a role table the gateway maintains on its own and nobody remembers to update. The same policy engine typically carries rate limits and budget caps per consumer, giving platform teams one place to control both who can act and how much they can do.

Put together, authentication, routing, and policy form the architecture that MCP itself was never going to ship with. The protocol was built minimal on purpose, and the gateway is where enterprises have to build everything the protocol left out: identity that traces back to a real person, routing that scales without creating a second sprawl problem, and access control granular enough to stop a leak before it happens rather than log it afterward.

Sources

  1. What are the best MCP gateways for enterprise in 2026?

More in MCP Server Management