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.
Pick a recipe by what the gateway does
Section titled “Pick a recipe by what the gateway does”| 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 |
How each tool call is decided
Section titled “How each tool call is decided”The Kong AI Gateway, Azure API Management, and Gravitee recipes follow one pattern. Only the gateway’s config differs.
- MCP client Calls a tool through the gateway with the person’s Keycard token.
- Your gateway Checks the token, reads the tool name from the request, and exchanges the token with Keycard, naming the tool.
- Keycard Decides through policy whether that person may call that tool, and issues a token for the MCP server or refuses with a reason.
- MCP server Receives the call with the new token, or never sees it, while the gateway answers
403with 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.