MCP gateways & registries
One MCP server is easy; an organization with dozens of servers and many clients is a mess. An MCP gateway is the fix — a proxy that aggregates servers behind one endpoint and centralizes auth, security, and observability. Registries add discovery. The AI-gateway pattern, applied to MCP.
Written and reviewed by Shreyash Prashu Last reviewed
What you'll learn
- Why a fleet of MCP servers needs a gateway layer
- What a gateway centralizes — aggregation, auth, security, observability
- How registries provide discovery for MCP servers
- The parallel to AI gateways and the security stakes
Before you start
A single MCP server (a program that offers tools an AI agent can call) wired into one client is simple. Now scale it: an organization with dozens of servers (GitHub, databases, internal APIs) and many clients (the apps that talk to those servers: IDEs, chat apps, agents). Connect everything directly and you get a tangle — every client configures every server, each server handles its own authentication, and nobody has a central place for security, rate limits, or logging.
An MCP gateway untangles it: a proxy (a middleman that forwards requests) that sits between clients and servers, aggregates them behind one endpoint, and centralizes the cross-cutting concerns. It is exactly the AI-gateway pattern, applied to the MCP ecosystem.
One endpoint instead of a mesh
The first win is structural. Without a gateway, M clients each connect to N servers —
an M × N mesh of connections and credentials. A gateway collapses that to M + N:
clients, servers = 20, 12
direct = clients * servers # every client wires up every server
gatewayed = clients + servers # clients -> gateway -> servers
print(f"direct mesh: {direct} connections")
print(f"via gateway: {gatewayed} connections")
print(f"reduction: {direct / gatewayed:.1f}x")
direct mesh: 240 connections
via gateway: 32 connections
reduction: 7.5x
Twenty clients and twelve servers go from 240 point-to-point connections to 32. But the connection count is the least of it — the real value is that the gateway becomes the one place to enforce everything that should be uniform:
What the gateway centralizes
- Aggregation. Many servers appear as one MCP endpoint; a client connects once and gets the union of all tools.
- Auth and secrets. Authentication, per-user/team tool access control, and secret management live in the gateway — individual servers don’t each juggle credentials.
- Security. Input/output filtering, defense against tool poisoning (a server hiding malicious instructions in a tool description), rate limiting (capping how many calls per minute), and audit logging (a permanent record of who called what) in one chokepoint. MCP servers are a real attack surface, so a central enforcement point matters a lot (MCP security).
- Observability. All MCP traffic flows through one place, so logging and tracing are uniform rather than per-server.
- Routing. The gateway dispatches each tool call to the correct backend server.
What the stateless spec changed here
The 2026-07-28 revision was written partly for this layer, and three of its changes land straight on a gateway:
- No session to pin. The
initializehandshake and theMcp-Session-Idheader are gone. Every request carries its protocol version, client identity, and capabilities in_meta. The gateway no longer needs sticky routing or a shared session store — plain round-robin across replicas is correct. A backend can be restarted or scaled out mid-conversation without dropping anyone. - Routing without parsing the body. Streamable HTTP requests carry
Mcp-MethodandMcp-Nameheaders naming the operation and its target. The gateway — or a rate limiter or WAF in front of it — can treat atools/callonrefund_orderdifferently from atools/listwithout parsing the JSON at all (a WAF is a web application firewall, a filter that blocks bad requests). That is faster, and safer: no routing decision depends on trusting the payload. - Cacheable listings.
tools/list,prompts/list,resources/list,resources/templates/list, andresources/readnow returnttlMsandcacheScope. The gateway can serve its aggregated tool list from cache (a stored copy) forttlMs(how many milliseconds the copy stays valid) instead of fanning out to twelve servers every time a client connects. HonourcacheScope:publicresults may be shared across users.privateresults must not be shared — a shared cache that ignores that flag leaks one user’s tool list to another, the same mistake as a CDN caching a logged-in page.
Registries: discovery
A registry is the other half: a catalog of available MCP servers — name, description, capabilities, endpoint — so clients and gateways can discover servers instead of hard-coding them, much like a package index. There’s an official MCP registry for public servers, and organizations run private registries for internal ones. A gateway typically pulls its server list from a registry; a client browses the registry to find what’s available.
In one breath
- A fleet of MCP servers + many clients is an
M × Nmesh of connections and credentials; an MCP gateway proxies it down toM + N(240 → 32 in the demo) behind one endpoint. - The connection count is minor; the point is centralizing the following in one place:
- aggregation
- auth + secrets + access control
- security (filtering, rate limits, audit)
- observability
- routing
- Since 2026-07-28 the protocol is stateless:
- no session to pin (round-robin is fine);
Mcp-Method/Mcp-Nameheaders let you route without parsing the body;ttlMs+cacheScopemake list results cacheable — respectprivate.
- Registries provide discovery — a catalog of MCP servers (official + private) so clients/gateways find servers instead of hard-coding them.
- It’s the AI-gateway pattern one layer down (in front of tool servers, not model providers) — and, like any gateway, a critical dependency to run for high availability.
Quick check
Quick check
delete_ticket tool. Where is the best place to enforce it?Next
Gateways are the enforcement point for MCP security, and mirror the AI gateway for model providers. For the advanced server-side capabilities a gateway proxies, see advanced MCP primitives.
Practice this in an interview
All questionsMCP is an open protocol originally introduced by Anthropic that standardizes how an AI host discovers and uses tools, resources, and prompt templates exposed by separate servers. It solves bespoke integration sprawl by giving each server one common interface, while leaving model orchestration, permissions, and user approval to the host.
In a normal MCP deployment, blindly forwarding the client’s bearer token to a downstream API violates the token’s audience boundary and can create confused-deputy, replay, and audit risks. The server should validate a token intended for itself, authorize the tool call, and obtain a separate, narrowly scoped credential for the downstream resource.
Tool poisoning is malicious instruction content in a tool description or result; cross-server shadowing uses one server’s names or content to influence or misroute another server’s capability; a rug pull changes a previously reviewed capability later. Defenses combine origin-aware namespaces, isolated trust contexts, capability snapshots and change review, exact-argument authorization, sandboxing, and runtime monitoring.
A model registry is a central catalog for deployable model artifacts and their metadata, lineage, approvals, and immutable versions. Production systems promote a tested version through deployment controls, usually using a mutable alias such as champion while retaining the exact version for rollback and audit.