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.
Once the token has been obtained, what remains are the rules for how it is presented, how it is validated and what is returned when it fails.
In accordance with OAuth 2.1 §5:
Authorization: Bearer <token> header; it MUST be included in every HTTP request to the MCP server.Clients MUST NOT send the MCP server tokens that were not issued by its AS.
401.Clients: MUST keep them confidential in transit and at rest; SHOULD include refresh_token in grant_types; MAY add offline_access to the scope if the AS lists it in scopes_supported; MUST NOT assume they will be issued. For public clients, the AS MUST rotate refresh tokens. MCP servers SHOULD NOT include offline_access in the scope of WWW-Authenticate or in scopes_supported (it is not a requirement of the resource). SEP-2207 gives additional guidance for OIDC.
| Status | Use |
|---|---|
401 Unauthorized |
Authorisation required or invalid/expired token |
403 Forbidden |
Insufficient scopes or insufficient permissions |
400 Bad Request |
Malformed authorization request |
Clients and servers MUST store tokens securely (OAuth 2.1 §7.1). ASs SHOULD issue short-lived access tokens.
issuer + resource).exp, aud/resource, iss and scopes on every request; respond 401/403 with a correct WWW-Authenticate. Cache the JWKS with rotation.1. Where MUST the access token go?
Never in the query; always in the header and in every request.
2. What does the server return for an expired token?
Invalid or expired → 401.
3. Should the MCP server include offline_access in scopes_supported?
Refresh tokens are not a requirement of the resource.