News Turn any service into MCP tools - Released EE v2.12

Document updated on Oct 29, 2025

MCP Gateway

MCP Gateway

The Model Context Protocol (MCP) Gateway in KrakenD enables transparent communication between an MCP agent and a third-party MCP server through a no-op endpoint. This setup allows KrakenD to forward messages with minimal processing while enriching the communication path with additional layers and functionality such as:

Use KrakenD’s MCP Gateway to connect MCP agents to external MCP servers that lack sufficient Enterprise-ready features, leveraging KrakenD as a secure, observable, and manageable gateway. This feature relays MCP agent content directly to the MCP server while enabling configurable middlewares to enhance protocol flow control and monitoring.

KrakenD can also be the MCP Server if needed Enterprise

Example use cases:

  • Secure MCP Agent Communication: Inject authentication and authorization to restrict MCP agent interactions with third-party MCP servers.
  • Rate Limiting MCP Traffic: Protect MCP servers from overload by applying rate limits at the gateway.
  • Observability and Logging: Add tracing and metrics on MCP message exchanges to improve operational insight.
  • Enterprise MCP Server: For deployments needing an in-house MCP server, KrakenD Enterprise includes the MCP Server feature that can be integrated or proxied using this gateway.

MCP Gateway configuration

To configure an endpoint in KrakenD acting as an MCP gateway to forward raw MCP messages, you only need a configuration like this:

{
  "endpoints": [
    {
      "endpoint": "/mcp",
      "output_encoding": "no-op",
      "input_headers": [
        "HeaderNeededByYourMCP"
      ],
      "method": "POST",
      "backend": [
        {
          "url_pattern": "/mcp",
          "host": [
            "https://third-party-mcp-server.local"
          ]
        }
      ]
    },
    {
      "endpoint": "/mcp",
      "output_encoding": "no-op",
      "input_headers": [
        "HeaderNeededByYourMCP"
      ],
      "method": "GET",
      "@comment": "The high timeout avoids repeating connections on SSE",
      "timeout": "5m",
      "backend": [
        {
          "url_pattern": "/mcp",
          "host": [
            "https://third-party-mcp-server.local"
          ]
        }
      ]
    },
    {
      "endpoint": "/mcp",
      "output_encoding": "no-op",
      "input_headers": [
        "HeaderNeededByYourMCP"
      ],
      "method": "DELETE",
      "backend": [
        {
          "url_pattern": "/mcp",
          "host": [
            "https://third-party-mcp-server.local"
          ]
        }
      ]
    }
  ]
}

Line-by-Line:

  • method: Three endpoints, as we want to allow MCP communication through GET, POST and DELETE. Being the POST the most important.
  • output_encoding: The no-op encoding allows transparent MCP communication. This is a must.
  • input_headers: Depending on the MCP technology, you might need forwarding headers to the MCP server. Or you can add Martian and inject them at the gateway level if they have constant values and you don’t want the MCP agent to know.
  • endpoint: /mcp defines the KrakenD endpoint exposed to MCP agents, whatever route you want this to be.
  • host: Remote MCP server address to forward MCP messages.
Supported MCP Server types
The MCP server connected to KrakenD must be HTTP-based, like JSONRPC or SSE. Stdio communication is out of scope for this functionality. If you plan to use SSE, make sure to add also a timeout with a value large enough to not close the session on the GET method only.

From here, you can add Authorization, Telemetry, Rate Limiting, or any other KrakenD component that is compatible with no-op.

KrakenD’s MCP Gateway feature enables infrastructure teams to transparently connect MCP agents to third-party MCP servers while adding vital control layers such as authorization, observability, and rate limiting. The no-op proxy behavior ensures the integrity of the MCP protocol, enabling integration and operational management.

For advanced MCP deployments, KrakenD Enterprise offers a native MCP Server option that complements or replaces third-party MCP resources.

Unresolved issues?

The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.

See all support channels