As organizations rapidly adopt the Model Context Protocol (MCP) to connect services and data to AI models through AI agents, they’re encountering familiar challenges: securing access to MCP servers and tools while providing routing, rate limiting, observability, and developer portals. This move reflects broader industry trends towards cloud-native technologies and the need for more sophisticated API management.
The question on everyone’s mind is: can we just use our existing API gateway for MCP? The short answer is “maybe,” but the real question is, should you? API gateways were not built for MCP use cases, and eventually, most API gateway vendors will build dedicated MCP gateways.
To understand why, let’s explore the fundamental differences between APIs and MCP. APIs are stateless services that operate on each request individually, whereas MCP is stateful, maintaining critical context and state between interactions. This difference is crucial, as it affects how gateways handle requests, responses, and session management.
MCP requests contain minimal routing information in the HTTP layer, with the entire protocol living in the body of the HTTP request. In contrast, API gateways are designed to operate on the HTTP layer, making intelligent decisions based on headers, methods, and URL structures. This mismatch makes it challenging for API gateways to handle MCP traffic effectively.
There are four common MCP gateway patterns, ranging from simple passthrough proxies to more complex MCP brokering and multiplexing. However, traditional API gateways struggle with these patterns, lacking native JSON-RPC understanding and session-aware policy engines.
Agentgateway, an open-source Linux Foundation project, is a purpose-built MCP gateway that natively understands JSON-RPC message structures and maintains stateful session mappings. It handles bidirectional communication patterns inherent to MCP, allowing for proper multiplexing and demultiplexing of MCP sessions.
In conclusion, while API gateways can be used for MCP traffic, they are not the best choice. A purpose-built MCP gateway like Agentgateway is essential for providing the security, observability, and governance capabilities that traditional API gateways cannot deliver.
Source: https://thenewstack.io/mcp-vs-api-gateways-theyre-not-interchangeable