# MCP rate limits

Cap each agent's traffic through the security definition it authenticates with.

An agent caught in a loop can call a tool endpoint far faster than any human client would. Rate limits cap that traffic, per agent, before any tool runs.

## Limits per identity {#limits-per-identity}

Limits for [MCP gateways](https://zato.io/docs/ai/mcp/index.html) are identity-aware - they are configured on the [security definition](https://zato.io/docs/ai/mcp/security.html) an agent authenticates with, not on the gateway. The limits configured on the definition apply to everything its holder calls, MCP gateways and [REST channels](https://zato.io/docs/dev/rest/authentication.html) alike, as one shared budget.

This means:

- Two agents calling the same gateway with different credentials each have their own limit.
- One agent calling three gateways with one credential has a single limit across all three.
- An agent that also calls REST APIs with the same credential draws from the same budget there too.

Limits are configured in the dashboard on the security definition - [API key](https://zato.io/docs/security/api-keys.html), [Basic Auth](https://zato.io/docs/security/basic-auth.html) or [bearer token](https://zato.io/docs/security/bearer-tokens/index.html) - and everything about rules, per-second bursts, per-day and per-month hard caps, CIDR address lists and time ranges is described on the [rate limiting and firewall](https://zato.io/docs/admin/guide/rate-limit.html) page. It all applies to MCP traffic unchanged.

## Rejected requests {#rejected-requests}

A request over the limit is refused before it reaches any tool, as described for all clients on the [rate limiting](https://zato.io/docs/admin/guide/rate-limit.html#denied-requests) page, and with the [audit log](https://zato.io/docs/ai/mcp/audit-log.html) on, the refusal is recorded as a `rate-limited` event naming the caller, and the gateway's `Throttled callers` [alert](https://zato.io/docs/ai/mcp/alerts.html) counts these events.

> **Sizing tip:** Agents retry aggressively when a tool call fails, so prefer burst limits that absorb short spikes plus a daily hard cap, over a single tight per-second limit - the [rate limiting guide](https://zato.io/docs/admin/guide/rate-limit.html) shows how to combine both on one rule.

## See also {#see-also}

- [Security](https://zato.io/docs/ai/mcp/security.html) - The security definitions where the limits are set
- [Rate limiting and firewall](https://zato.io/docs/admin/guide/rate-limit.html) - Rules, bursts, hard caps, CIDR lists and time ranges in full
- [Cost and limits](https://zato.io/docs/ai/cost-and-limits.html) - Every limit that applies to AI traffic, in one place
- [Audit log](https://zato.io/docs/ai/mcp/audit-log.html) - What is recorded for requests that reach the gateway

## Learn more {#learn-more}

- [MCP tutorial](https://zato.io/tutorials/mcp/01.html) - Expose Python services as AI tools and connect Claude Code in minutes
- [AI Integrations overview](https://zato.io/docs/ai/) - Both directions of AI traffic in one platform, and where to start
- [MCP gateway reference](https://zato.io/docs/ai/mcp/) - Configuration, endpoint behavior and the governance controls
- [Tool schemas](https://zato.io/docs/ai/mcp/tool-schemas.html) - How a service's docstring and declared I/O become its tool definition
- [MCP gateway security](https://zato.io/docs/ai/mcp/security.html) - API keys, Basic Auth and bearer tokens for AI agents
- [MCP response controls](https://zato.io/docs/ai/mcp/response-controls.html) - PII removal, prompt-injection safeguards and token-denominated size caps
- [MCP audit log](https://zato.io/docs/ai/mcp/audit-log.html) - What each agent did, when and with what outcome - payloads never recorded
- [MCP alerts](https://zato.io/docs/ai/mcp/alerts.html) - Failing backends, agents stuck in a loop and gateways with too many tools
- [Cost and limits](https://zato.io/docs/ai/cost-and-limits.html) - Every setting that caps AI cost and traffic, with worked examples
- [GitOps for AI integrations](https://zato.io/docs/ai/enmasse.html) - LLM connections and MCP gateways as YAML in version control
- [AI examples](https://zato.io/docs/ai/examples/) - Complete, runnable scenarios - one real-world need per file
