Est.
MCP GatewayLong read

Rate Limiting and Quota Management at the MCP Gateway Layer

A gateway layer enforces rate limits MCP servers cannot.

· 10 min read
Cover illustration for “Rate Limiting and Quota Management at the MCP Gateway Layer”
MCP Gateway · October 8, 2026 · 10 min read · 2,361 words

The MCP specification has no standardized throttling signal, and individual servers ship with wildly inconsistent or absent limits, so you can't put rate limiting and quota management for MCP agents at the server layer. The only architecturally sound place to enforce per-agent, per-tool, and per-role quotas is the gateway: a single governed checkpoint that understands the MCP protocol natively, ties every request to a verified identity, and applies policy before traffic ever reaches a downstream server. That requires OAuth 2.1 token-based identity, session-level rate accounting rather than raw HTTP counts, and tiered quotas mapped to roles already defined in an identity provider like Okta or Entra ID. This piece lays out why that's true, where it fails today, and how to build it.

Why MCP agents break the assumptions rate limiting was built on

Ask Claude to read through an active GitHub repository and it will hit the platform's rate ceiling in about two minutes. A human developer doing the same research, clicking through files, running a few searches, checking commit history, might take two hours to generate the same request volume. Nothing about GitHub's underlying API quota changed between those two scenarios. What changed is the shape of the thing making the requests.

Rate limiting as a discipline grew up around human-driven traffic: a person clicking a button, a browser issuing a request, a developer polling an endpoint every few seconds because that's as fast as they could reasonably work. MCP agents don't work that way. They operate statefully across multi-turn sessions, moving through a discovery-then-call cycle, listing available tools, then invoking them in rapid sequence, often many times per task. Over the Streamable HTTP transport, every one of those operations, a tools/list, a tools/call, a resources/read, lands as its own separate HTTP POST. (Over stdio, there's no HTTP at all, just newline-delimited JSON-RPC messages fired as fast as the process can write them.) A rate limit sized in raw request counts doesn't map cleanly onto a tool-call session, so limits built for the old traffic shape undercount the new one by a wide margin. The fix isn't a bigger number.

How MCP Servers Handle Rate Limiting Today

The gap isn't theoretical, and it isn't a case of server authors cutting corners. Public MCP servers today fall into one of three structural categories, and once an agent starts driving the traffic, you can't throttle it safely with any of them.

The first category has no MCP-layer limit. GitHub's MCP server documentation contains no rate-limit section. Cloudflare's and Stripe's servers sit in the same spot: no documented MCP-layer ceiling. Every tool call goes straight at the underlying API's quota with nothing in between to slow it down.

The second category applies limits, but tunes them for a request pattern that no longer exists. A threshold set for how often a human might click "refresh" gets saturated in seconds once an agent starts issuing calls back to back. The limit measures the wrong kind of traffic now, not the traffic it was originally designed around.

A third problem compounds the first two: the MCP spec itself has no standardized way to signal that a limit has been hit. There's no Retry-After convention borrowed from HTTP, no token-bucket header, no JSON-RPC error code that means "slow down, try again in N seconds." So even a server that has made a good-faith effort to throttle requests ends up producing an error an agent has no systematic way to interpret or recover from. The evidence shows up in production already: GitHub's server shows user REST quota climbing sharply within seconds once an editor extension starts driving it, and Sentry's server has recorded parallel agents sharing a single user bucket, blowing past its 60-per-minute limit within seconds of starting work. There is no configuration of the server layer that fixes this, because the servers don't control the traffic shape arriving at their door. Something upstream has to.

Why the MCP gateway is the only layer where reliable rate limiting is architecturally possible

A gateway built for MCP traffic solves this by reading the protocol itself, not just the HTTP envelope around it. It parses the JSON-RPC body, works out who is calling which tool, then checks that against a policy before letting the request through. Speakeasy is an enterprise AI control plane with native MCP protocol awareness, and it gives organizations that kind of governed checkpoint, so they can apply consistent rate-limiting and quota rules across every MCP server and agent, and no server has to build its own throttling logic from scratch.

That consistency matters because the gateway sits as the one entry and exit point for all tool-based AI activity in an organization. Without it, every MCP server would need to implement its own authentication, authorization, and throttling independently, an approach that scales poorly and fails inconsistently, since no two teams will implement the same safeguards the same way.

A traditional API gateway can't be dropped in to do this job. Ordinary API traffic is stateless: one request, one response, and no memory between calls. MCP traffic is stateful and multi-turn, often spanning a discovery phase before a single tool is even invoked. A gateway that only understands HTTP sees a stream of POST requests and nothing more, so it can't tell a tools/list from a tools/call, can't apply a tighter ceiling to an expensive tool versus a cheap one, and can't filter which tools a given agent is even allowed to discover. Per-tool limiting, filtered discovery, schema-level policy: you can't see any of it at the HTTP layer alone.

The obvious objection is latency: doesn't inserting a policy-aware layer in front of every tool call slow everything down? You solve it by separating the control plane from the data plane. The control plane's job is to distribute policy and collect analytics, and you don't need that work to happen on the hot path of every request. The actual enforcement, authentication, authorization, routing, rate limiting, happens in lightweight data-plane instances running close to the agents and MCP servers themselves. Deployment topology then becomes a tuning knob rather than a blocker: an in-process data-plane gateway gives the lowest latency, a sidecar comes close while offering better isolation, and a centralized gateway is simpler to manage but can turn into a throughput bottleneck at very large scale. None of these options force you to accept slow enforcement as the price of safe enforcement.

What rate limiting and quota management at the gateway layer enforce

Once the gateway has visibility into the MCP protocol itself, it can apply limits at a level of granularity the server layer never could. Per-agent caps restrict a specific agent to a fixed number of requests per hour, which stops one runaway pipeline from hammering a critical internal service or third-party API into the ground. Per-tool limits go a step further: since some tools cost more to run or carry more risk than others, an enterprise rate-limiting service can inspect the MCP request body, read the tool name, and apply a different ceiling to each one.

Microsoft Foundry's AI gateway shows what this looks like in a shipped product. It gives organizations a single, governed entry point, and rate limits, IP restrictions, and audit logging get enforced there without touching the underlying MCP servers or the agent code calling them. The policies run through Azure API Management, and they include rate limiting scoped by project or by user, IP filtering, correlation ID injection, and stripping of sensitive headers before a request goes further downstream. None of it requires rewriting a tool or patching an agent.

Tier-based quota management follows the same logic one level up. A limit sized for an enterprise research agent running continuous workloads would be ruinous if applied to a free-tier evaluator poking at a new integration, so quotas need to flex by consumer tier. Filtered discovery closes the loop: the gateway shows an agent only the tools it's permitted to see in the first place, so rate limiting works alongside access scoping instead of being bolted onto an unrestricted tool catalog after the fact.

Rate limiting without reliable agent identity is enforcement theater

None of the mechanisms above work if the gateway can't tell which agent is actually making the call. A per-agent cap is only as good as the thing identifying the agent, and right now, most organizations don't have that figured out. The Okta AI Agents at Work 2026 report found that most organizations have no reliable way to govern what agents running in production are actually doing, and only a minority apply the same security controls to AI agents that they apply to human users.

2026 closed that gap at the standards level, at least on paper. Every major identity architecture released that year, Microsoft Entra Agent ID (general availability in April 2026), Okta for AI Agents (general availability August 24, 2026), and Auth0's Auth for MCP (general availability May 6, 2026), converged on the same primitive: OAuth 2.0 tokens paired with standardized agent-to-agent protocols, MCP for tool access and A2A for agent-to-agent calls. Entra Agent ID treats an agent identity as a specialized service principal with no credentials of its own; tokens get acquired on its behalf by its blueprint only after a user or tenant admin consents to specific scopes, so a compromised agent has no keys of its own to steal. Auth0's On-Behalf-Of Token Exchange works on the same principle from a different angle: servers can trade a user's access token for a correctly scoped downstream token instead of sharing one credential across every agent in the fleet. That shared-credential pattern is what makes rate limiting fall apart: a limit applied to an IP address or a shared service account governs a location, not an actor, and once ten agents share one account, the gateway has no way to tell which one is responsible for the traffic it sees.

The gap hasn't fully closed. The MCP OAuth 2.1 profile handles authentication well, but it still has no standardized audit trail format, so compliance logging suffers and it's harder to attribute quota consumption to the agent that actually generated it. Identity resolution has to happen first. Everything described in the previous section, per-agent caps, per-tool ceilings, tiered quotas, only functions once the gateway can read a verified agent identity out of the token in front of it.

The Cost of Ungoverned Agent Traffic

Skip gateway-layer enforcement and two kinds of damage follow from the same root cause: no governed checkpoint watching the traffic. One is cost. Uber burned through its entire annual AI budget in four months of Claude Code usage, and it had few control mechanisms tying spend to actual outcomes. That's what happens when nothing upstream of the API bill is counting or capping agent activity in real time.

The other is security exposure: shadow AI appears whenever agent requests reach systems without passing through a gateway. Teams stand up their own integrations, ungoverned and undocumented, leaving no audit trail for security to review later. The fix isn't necessarily prohibition. When a healthcare system gave clinicians approved, governed AI tools instead of simply banning unauthorized use, it saw a dramatic drop in unauthorized AI activity alongside meaningful daily time savings per clinician. Early visibility into what agents are actually doing, not after-the-fact forensics once something has gone wrong, is what separates a governed deployment from one running blind.

Implementing Rate Limiting and Quota Management at the MCP Gateway Layer

Building this well comes down to four decisions: the identity model, the enforcement granularity, the quota tier structure, and what the gateway does when a limit is actually hit.

Identity comes first. Rate limits need to key off verified agent identities rather than IP addresses or shared service credentials. The 2026 identity standards, Entra Agent ID, Okta Agent SSO, Auth0 Auth for MCP, are the token primitives the gateway needs to tell agents apart.

Enforcement granularity comes next. A single MCP tool-call session can involve several HTTP round-trips, so if you size limits in raw HTTP requests instead of sessions, a request-count limit will blow past expectations before anyone notices. Per-tool ceilings need to track the actual cost and risk of each tool, not one number across the whole catalog.

Tier structure maps quotas to roles. What's reasonable for an enterprise research agent running continuous workloads is excessive for a developer kicking the tires on a new integration, and the gateway's access-control model, typically RBAC tied to an existing identity provider, determines which tier a given agent falls into.

Signaling behavior closes the loop. If the gateway doesn't return clear, machine-readable information when a limit is hit, the calling agent has no way to learn it should slow down, and it hits the gateway with the exact same request pattern again immediately. This has to be solved at the gateway, because the MCP spec itself has no standardized throttling signal to fall back on.

Microsoft Foundry's implementation shows one version of this working end to end: Azure API Management enforcing limits like 60 calls per minute per counter key, applied through policy XML scoped by project or user, with traffic routed through the gateway URL rather than hitting the MCP server directly, and metrics confirming the policy is live before any agent goes to production. Speakeasy's AI control plane applies the same architectural principle at the enterprise level: a single governed layer connecting agents to internal and external systems, enforcing RBAC tied to identity providers like Okta and Entra ID, and surfacing cost and usage telemetry broken down by agent, tool, and role. At the gateway layer, rate limiting becomes a policy instrument tied directly to identity and role, enforcing per-agent, per-tool, and per-user quotas in real time, with audit trails showing which agent hit which limit and why. Platforms built for this kind of governance can surface that telemetry alongside usage and cost data, giving security and platform teams something concrete to tune policy against. Whichever implementation an organization chooses, the governing principle stays the same: rate limiting and quota management have to be built into the gateway from the start, because that's what makes fast AI adoption safe to scale.

Sources

  1. Govern MCP Tools by Using an AI Gateway - Microsoft Foundry
Filed underMCP Gateway

More in MCP Gateway