AgentHub

MCP Gateway vs. API Gateway: What's the Difference?

·5 min read

If you have worked with microservices, you know what an API Gateway does: terminate TLS, rate-limit requests, authenticate callers, route to backend services, aggregate responses. Tools like Kong, Envoy, AWS API Gateway, and NGINX are well-understood pieces of infrastructure.

An MCP Gateway is newer and less familiar. It routes tool calls rather than HTTP requests, and it operates at the protocol level of the Model Context Protocol rather than REST or gRPC. The two gateways solve different problems, but in a production AI infrastructure stack, you will likely need both.

Similarities

At a high level, both gateways sit between a client and a backend, intercepting traffic to add cross-cutting concerns:

ConcernAPI GatewayMCP Gateway
AuthenticationOAuth, API keys, JWTOAuth, API keys, JWT
LoggingRequest/response logsTool-call audit trail
Rate limitingPer-route, per-clientPer-tool, per-agent
Transit encryptionTLS terminationStreamable HTTP (TLS)

Key Differences

Despite the architectural similarities, the two gateways differ in what they actually do with the traffic:

What They Route

An API Gateway routes HTTP requests to HTTP services. It understands URLs, methods, headers, and bodies. It can rewrite paths, transform payloads, and aggregate responses from multiple upstreams. An MCP Gateway routes CallToolRequest messages to MCP servers. It understands tool names, arguments, and MCP protocol semantics. It cannot aggregate tool calls or transform arguments the way an API gateway transforms HTTP payloads.

Policy Granularity

API Gateway policies are typically URL-level or path-level: allow GET on /users, deny DELETE on /users/:id. MCP Gateway policies are tool-level: allowdb.query, block db.drop_table, require-approval ondeploy.push. This maps naturally to the way AI agents consume tools — not by URL but by named function.

Security Semantics

An API Gateway protects against HTTP-level attacks: SQL injection in query parameters, path traversal in URLs, malformed JSON bodies. An MCP Gateway protects against MCP-level attacks: SSRF in tool arguments, prompt injection through tool chains, and policy bypass by tool-name manipulation. It also provides readonly modesthat introspect the content of the call — something an API Gateway does not do.

Approval Workflow

API gateways do not have a queuing mechanism for human approval. If a request fails auth, it is rejected immediately or not. MCP Gateways can queue high-risk tool calls for human-in-the-loop approval. An agent calls deploy.production, the gateway sends a Slack message, a human approves it, and then the gateway forwards the call to the server. This is fundamentally different from the synchronous pass/fail of API gateways.

When You Need an API Gateway

  • Your MCP servers expose REST or gRPC APIs that other services consume
  • You need TLS termination, load balancing, or circuit breaking
  • You have traditional HTTP services alongside your MCP servers

When You Need an MCP Gateway

  • AI agents (Claude Code, Cursor, custom agents) connect via the MCP protocol
  • You need per-tool access control policies
  • You want SSRF and injection protection on tool arguments
  • You need immutable audit logs of every agent tool call
  • High-risk operations require human approval before execution

Running Both

In a production deployment, the two gateways do not compete — they compose. The API Gateway sits at the edge, handling TLS, auth, and routing. It forwards MCP traffic to the MCP Gateway, which adds tool-level policy enforcement, SSRF protection, audit logging, and approval gates before forwarding to the upstream MCP server.

Agent → API Gateway (TLS, auth, rate-limit)
         → MCP Gateway (SSRF, policy, audit, approval)
         → MCP Server (database, filesystem, API)

This layered approach gives you the operational maturity of traditional API gateway infrastructure and the AI-specific security controls of an MCP gateway.