Infrastructure

MCP Gateway vs API Gateway: What AI Agents Actually Need

API gateways route HTTP requests to backend services. MCP gateways route AI tool calls to the right adapter. They sound similar. They solve fundamentally different problems.

April 16, 20269 min readToolRoute Team

If you have built anything with APIs in the last decade, you know what an API gateway is. Kong, Apigee, AWS API Gateway, Traefik — these tools sit between clients and backend services, handling rate limiting, authentication, routing, and load balancing. They are mature, battle-tested infrastructure for serving REST and GraphQL APIs to human-built frontends.

Then MCP arrived. Anthropic's Model Context Protocol gave AI agents a standardized way to discover and call external tools. The ecosystem exploded: thousands of MCP servers, dozens of registries, and a new kind of client — autonomous agents that decide which tools to call at runtime based on what they are trying to accomplish, not what URL they were hardcoded to hit.

This new client broke the assumptions that traditional API gateways were built on. The result is a new infrastructure category: the MCP gateway.

What an API Gateway Does (and Does Well)

A traditional API gateway manages traffic between clients and backend services. Its job is straightforward:

  • Path-based routing: /api/users goes to the users service, /api/orders goes to the orders service.
  • Auth enforcement: Validate JWTs, API keys, or OAuth tokens before the request reaches the backend.
  • Rate limiting: Protect services from abuse with per-client or per-route limits.
  • Load balancing: Distribute requests across multiple instances of a service.
  • Protocol translation: Convert between REST and gRPC, or terminate TLS.

This works because the client — a web frontend, a mobile app, a third-party integration — knows exactly which endpoint it wants to hit. The developer hardcodes POST /api/orders into the application. The API gateway routes that request. The contract is static and known at build time.

What Changes When the Client Is an AI Agent

AI agents do not know which endpoints to call at build time. An agent given the task “research competitors and email me a report” needs to dynamically figure out that it should call a search tool, then a document generation tool, then an email tool. The tool selection happens at runtime based on the agent's reasoning, not a developer's hardcoded integration.

This changes the infrastructure requirements in five specific ways:

1. Routing by Capability, Not by URL Path

An API gateway routes GET /api/v2/search?q=term to a search service. An MCP gateway routes {"tool": "tavily", "operation": "search"} to a Tavily adapter. The agent does not know or care about Tavily's URL structure, authentication method, or response format. It knows it needs a “search” capability and the gateway resolves the rest.

2. Schema Discovery at Runtime

Traditional API gateways serve OpenAPI specs, but the client still needs a developer to read the spec, write the integration, and deploy it. MCP gateways serve tools/list responses that agents consume programmatically. The agent reads the schema, understands what parameters a tool expects, and calls it — all within a single conversation turn. At ToolRoute, the tool catalog serves 87 tools across 14 categories, each with machine-readable schemas that agents parse without human intervention.

3. Credential Management Across Dozens of Providers

When a frontend calls your own API, you manage one set of credentials. When an agent calls 30 different external tools in a single workflow, someone has to manage 30 sets of credentials. An API gateway was never designed for this. It authenticates the incoming request, not the outgoing ones. An MCP gateway manages both: it authenticates the agent (one API key) and then injects the correct credentials for each upstream tool.

4. Per-Tool Billing Instead of Per-Request Billing

API gateways bill by request volume or bandwidth. A search API call and an email send are the same from a rate-limiting perspective. But tools have wildly different costs: a web search might cost $0.001, a voice synthesis call might cost $0.05, and an image generation might cost $0.10. MCP gateways meter at the tool-and-operation level, deducting the right number of credits for each specific call.

5. Multi-Protocol Inbound Translation

An API gateway typically handles one inbound protocol (HTTP) and maybe translates to one outbound protocol (gRPC). An MCP gateway needs to accept requests from agents that speak different languages. Claude uses MCP natively. OpenAI-based agents use function calling. Google's agents use A2A. Custom agents just want REST. The gateway translates all of these into a uniform internal execution, then translates the response back.

Side-by-Side: API Gateway vs MCP Gateway

DimensionAPI GatewayMCP Gateway
ClientWeb apps, mobile apps, third-party integrationsAI agents, LLM frameworks, autonomous systems
Routing logicURL path + HTTP methodTool name + operation
DiscoveryOpenAPI spec (read by humans)tools/list schema (read by agents)
Auth modelValidates inbound credentialsValidates inbound + injects outbound credentials per tool
BillingPer-request or bandwidthPer-tool, per-operation credits
Inbound protocolsHTTP (REST, GraphQL)REST, MCP Streamable HTTP, A2A, OpenAI Functions, SDKs
Upstream integrationProxy to your own servicesAdapters for third-party tools (search, email, voice, data, etc.)
Rate limitingPer-client or per-routePer-tool + credit-based throttling
ExamplesKong, Apigee, AWS API Gateway, TraefikToolRoute, Cloudflare AI Gateway (partial)

What They Have in Common

MCP gateways and API gateways are not opposites. They share core infrastructure patterns:

  • Single entry point: Both consolidate access through one endpoint instead of letting clients talk directly to every backend.
  • Authentication layer: Both verify that the caller has permission before forwarding the request.
  • Logging and observability: Both record what happened — which request, which backend, how long, whether it succeeded.
  • Error normalization: Both translate varied backend error formats into something consistent for the client.
  • Abuse protection: Both throttle or block excessive usage to protect upstream services.

If you understand API gateways, you already understand 60% of an MCP gateway. The remaining 40% is what makes them a distinct category.

A Concrete Example: The Same Workflow Through Each Gateway

Suppose an agent needs to search the web for “MCP security best practices,” summarize the results, and email the summary to a user.

Through an API Gateway (Kong / Apigee)

  1. Developer signs up for Tavily, gets an API key, stores it in the agent config.
  2. Developer signs up for Resend, gets an API key, stores it separately.
  3. Developer writes a Tavily integration: specific URL, specific headers, specific response parsing.
  4. Developer writes a Resend integration: different URL, different headers, different response format.
  5. Developer configures Kong routes for both, sets rate limits per route.
  6. Agent calls POST /api/tavily/search and POST /api/resend/send with separate auth headers.
  7. Developer maintains both integrations as APIs change.

Through an MCP Gateway (ToolRoute)

  1. Developer gets one ToolRoute API key.
  2. Agent calls POST /api/v1/execute {tool: "tavily", operation: "search"}.
  3. Agent calls POST /api/v1/execute {tool: "resend", operation: "send_email"}.
  4. Gateway handles both upstream integrations. Agent sees identical response shapes.

Seven steps collapsed to four. Two API keys collapsed to one. Two integration formats collapsed to zero custom code. And if you swap Tavily for Exa or Resend for SendGrid, the agent's code does not change — only the gateway's adapter config does.

Why You Cannot Just “Put Kong in Front of MCP”

A reasonable question: can you configure Kong or Apigee to proxy MCP traffic and get the same result? Technically, you can proxy the HTTP layer. But you lose everything that makes an MCP gateway useful:

  • No schema awareness. Kong does not know that the incoming JSON contains a tool name and operation. It cannot validate that the agent is calling a real tool with valid parameters.
  • No credential injection. Kong validates inbound auth but cannot inject different outbound credentials per tool. You would build that yourself.
  • No per-tool metering. Kong counts requests. It cannot deduct 2 credits for a search and 10 credits for a voice synthesis from the same prepaid balance.
  • No protocol translation. Kong will not translate an MCP JSON-RPC tools/call request into an OpenAI function calling format or a Google A2A task. An MCP gateway handles five inbound protocols natively.
  • No tool catalog. Kong does not serve a tools/list response. Agents have no way to discover what is available.

You could build all of this as custom Kong plugins. At that point, you have built an MCP gateway — you just started with Kong as the HTTP layer.

When You Need Both

Most production AI applications will use both types of gateway in their architecture:

  • API gateway sits in front of your own services: user auth, data APIs, webhooks, admin endpoints. It protects your backend from the internet.
  • MCP gateway sits between your agents and external tools. It gives your AI layer access to 87 tools across 14 categories through one key and one interface.

They operate at different layers of your stack. The API gateway manages your API. The MCP gateway manages your agent's toolbox.

How ToolRoute Implements This

ToolRoute is an MCP gateway. It exposes 87 tools across 14 categories through five inbound protocols:

  • REST: POST /api/v1/execute
  • MCP Streamable HTTP: POST /mcp (JSON-RPC)
  • A2A: POST /api/a2a (Google Agent-to-Agent)
  • OpenAI Functions: GET /api/v1/tools?format=openai
  • SDKs: Python and TypeScript client libraries

Each tool has a dedicated adapter. The adapter handles the upstream tool's specific API contract: authentication format, request shape, response parsing, error codes. When you call {"tool": "firecrawl", "operation": "scrape"}, the gateway resolves the Firecrawl adapter, injects the Firecrawl API key, transforms your input, makes the upstream call, normalizes the response, deducts credits, and returns a standard JSON envelope. Your agent never touches the Firecrawl API directly.

Billing is credit-based with per-tool pricing. A web search costs different credits than a voice synthesis call. Users who already have their own API keys for specific tools can use BYOK (bring-your-own-key) to skip the credit charge for those tools. See pricing details.

The Bottom Line

API gateways were designed for a world where developers write integrations and frontends make predictable HTTP calls. MCP gateways are designed for a world where AI agents pick their own tools at runtime and need a unified interface to call any of them.

They share infrastructure DNA — single entry point, auth enforcement, rate limiting, logging. But MCP gateways add capability-based routing, schema discovery, credential injection, per-tool billing, and multi-protocol translation that traditional API gateways were never built to handle.

Different problem. Different solution. If you are building AI agents that need external tools, you need an MCP gateway.

Frequently Asked Questions

Can I use Kong or Apigee as an MCP gateway?

They can proxy MCP traffic at the HTTP level, but they cannot interpret tool schemas, route by capability, meter per-tool usage, or translate between protocols like MCP Streamable HTTP, A2A, and OpenAI function calling. You would need to build all of that logic yourself on top of the gateway.

What is the difference between an API gateway and an MCP gateway?

An API gateway routes HTTP requests to backend services based on URL paths and methods. An MCP gateway routes AI tool calls to the correct adapter based on tool name and operation, handling schema discovery, multi-protocol translation, per-tool billing, and credential management. API gateways think in endpoints; MCP gateways think in capabilities.

Do MCP gateways replace API gateways?

No. They solve different problems. API gateways protect your backend services from the internet. MCP gateways give your AI agents access to external tools. Most production architectures will use both.

How does an MCP gateway handle tools that use different protocols?

Through dedicated adapters. Each tool gets an adapter that knows the upstream tool's API contract. The gateway translates the agent's standard request into whatever the tool expects, executes it, and normalizes the response. The agent always sees the same interface.

What protocols can agents use to connect to an MCP gateway?

ToolRoute supports five: REST API, MCP Streamable HTTP (JSON-RPC), Google A2A, OpenAI-compatible function calling, and native SDKs. Any AI framework can connect regardless of which protocol it prefers.

ToolRoute is an MCP gateway. One API key, 87 tools, five protocols. Read the docs or see pricing.