Skip to content

Gateways

Keep your gateway as the place access is enforced, and let Keycard decide who reaches the MCP servers behind it.

A gateway in front of your MCP servers gives clients one entry point and one place to enforce access. In each recipe here, Keycard issues the tokens and decides who gets them, and the gateway checks those tokens before it forwards a request. Access changes happen in Keycard, so the gateway config stays the same.

If you don’t run a gateway of your own, Keycard’s Unified Access Gateway gives your users one MCP endpoint for several servers.

You want the gateway to Recipes
Let through only people who sign in with Keycard agentgateway
Ask Keycard about each tool call, and refuse the calls policy doesn’t allow Kong AI Gateway, Azure API Management, Gravitee
Call an upstream API, such as GitHub, with the person’s own credential agentgateway upstream credentials

The Kong AI Gateway, Azure API Management, and Gravitee recipes follow one pattern. Only the gateway’s config differs.

  1. MCP client Calls a tool through the gateway with the person’s Keycard token.
  2. Your gateway Checks the token, reads the tool name from the request, and exchanges the token with Keycard, naming the tool.
  3. Keycard Decides through policy whether that person may call that tool, and issues a token for the MCP server or refuses with a reason.
  4. MCP server Receives the call with the new token, or never sees it, while the gateway answers 403 with Keycard’s reason.

The gateway names the tool in the exchange as an RFC 9396 authorization detail. That request format is provisional and may change, and each recipe’s Limits section says so. To write the policies that allow or refuse each tool, see Allow or deny specific tools.