part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
A gateway handles identities and tokens across two legs and in two roles. The rule that organises everything: the token a host presents never travels towards a server.
authorization_servers (your AS or the corporate IdP), minimal scopes_supported and resource = your canonical URI.exp, audience (= your URI), iss, scopes. 401 if missing or invalid; 403 insufficient_scope with the exact scope of the operation.mcp:catalog, srv:<id>:tools, srv:<id>:resources. Precise and consistent challenges.iss in responses, refresh token rotation, warnings for localhost redirects.private_key_jwt as a confidential client), flow (PKCE, resource = the server's canonical URI, state, iss validation), encrypted token storage keyed by issuer + resource + principal, proactive refresh.If the gateway uses a static client_id with third-party ASs and allows hosts to register dynamically, it MUST request per-host consent before forwarding to the third party's AS, with the exact cookie, state and redirect rules of 10.2.
| Entity | How it is identified | Where it is used |
|---|---|---|
| User | sub of the host's token (or of the SSO ID token) |
Policy, audit, binding of handles and tasks, private cache |
| Host (MCP client) | client_id of the token; clientInfo informational only |
Per-host policy, per-client consent |
| Gateway | Your client_id (CIMD) with each AS |
South leg |
| Server | Canonical URI (resource) + issuer of its AS |
Token store, PRM |
getToken(principal, server, scopes) that encapsulates discovery, registration, flow, cache and refresh; the rest of the gateway never sees tokens.insufficient_scope into a URL elicitation towards the host or into an actionable error.1. Which token does the gateway use to call a remote server?
Passing the host's token through is forbidden; each server has its own audience.
2. Which identifier must the gateway use as the principal for the private cache and task binding?
clientInfo is self-declared; the sub comes from the validated token.