- MCP
- A2A
- HTTP
Model Context Protocol (MCP)
Model Context Protocol is the standard for connecting AI agents to tools, resources, and prompts. Agentgateway acts as an MCP proxy: it receives MCP requests from clients (AI agents), applies policies, and forwards them to one or more upstream MCP servers.What Agentgateway provides for MCP
Protocol translation
Transparently proxy MCP requests between any combination of transports — SSE, Streamable HTTP, or Stdio.
Authentication
Enforce JWT, API key, or mTLS authentication before MCP requests reach backend servers.
Tool-level authorization
Use CEL expressions to allow or deny access to specific MCP tools, resources, or prompts by name.
Aggregation
Expose multiple upstream MCP servers as a single MCP endpoint with merged tool lists.
MCP transports
MCP supports three transport mechanisms. Agentgateway handles all three.Streamable HTTP (/mcp)
Streamable HTTP (/mcp)
The modern MCP transport, introduced in the MCP specification. Clients POST requests to Clients connect by sending
/mcp and receive streaming responses. This is the recommended transport for new deployments.POST /mcp with a Content-Type: application/json body.SSE (/sse)
SSE (/sse)
The original MCP transport using Server-Sent Events. The client connects to
/sse to establish a persistent event stream, then sends requests via POST /message.SSE is supported for backwards compatibility with existing MCP clients. The Mcp-Session-Id header tracks sessions across the SSE connection.Stdio
Stdio
Agentgateway can spawn MCP servers as child processes and communicate with them over stdin/stdout. This is useful for running local MCP servers (e.g., Node.js MCP packages) without requiring them to bind to a network port.The
cmd is the executable to run. args are passed as command-line arguments. The process inherits the gateway’s environment.Stdio backends are started when the configuration is loaded and restarted automatically if the process exits.
MCP backend configuration
Themcp backend accepts a list of targets. Each target represents one upstream MCP server.OpenAPI-to-MCP transformation
Agentgateway can transform legacy REST APIs into MCP-compatible tool servers using an OpenAPI specification. This allows AI agents to call existing HTTP APIs through MCP without any changes to the underlying service.When configured, the gateway reads the OpenAPI spec and exposes each operation as an MCP tool. The tool name, description, and input schema are derived from the OpenAPI operation definition.Protocol summary
| Protocol | Transport | Gateway endpoint | Backend type |
|---|---|---|---|
| MCP | Streamable HTTP | POST /mcp | mcp.targets[].host or stdio |
| MCP | SSE | GET /sse + POST /message | mcp.targets[].host or stdio |
| A2A | HTTP | All paths | host with a2a: {} policy |
| HTTP | HTTP/1.1, HTTP/2 | Configurable paths | host |
MCP proxy guide
Step-by-step guide to proxying MCP servers with authentication and authorization
A2A proxy guide
Set up agent-to-agent communication with the A2A protocol
OpenAPI guide
Transform REST APIs into MCP tools using OpenAPI specifications
CEL expressions
Write tool-level authorization rules using CEL expressions