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.
With the AS discovered and the client registered, the flow is an OAuth 2.1 authorization code flow with three mandatory MCP additions: PKCE, the resource parameter and validation of iss.
sequenceDiagram
participant B as Browser
participant C as Client
participant M as MCP server
participant A as AS
C->>M: request without token
M->>C: 401 + WWW-Authenticate
C->>M: PRM
C->>A: AS metadata
Note over C: Registration (CIMD / DCR / pre-registration)
Note over C: Generates PKCE, picks scopes, includes resource, records the expected issuer
C->>B: opens authorization URL (code_challenge, resource, scope, state)
B->>A: /authorize
Note over A: the user authorises
A->>B: redirect with code + iss
B->>C: callback
Note over C: validates iss against the recorded issuer (RFC 9207)
C->>A: /token (code, code_verifier, resource)
A->>C: access_token (+ refresh_token)
C->>M: request with Authorization: Bearer
M-->>C: MCP response
Clients MUST implement PKCE (OAuth 2.1 §7.5.2) and MUST use S256 whenever technically possible. Since OAuth does not define PKCE discovery, the client MUST verify it via metadata: if code_challenge_methods_supported is missing (in RFC 8414 or in OIDC Discovery), the client MUST refuse to proceed. ASs using OIDC Discovery MUST include that field to be MCP-compatible.
iss, RFC 9207)Before redirecting, the client MUST record the issuer from the validated AS metadata, alongside the code_verifier (and state) for that request. ASs SHOULD include iss in the response (in error responses too) and, if they do, MUST announce authorization_response_iss_parameter_supported: true.
…_iss_parameter_supported |
iss present |
Action |
|---|---|---|
| true | yes | Compare with the recorded issuer by simple string equality |
| true | no | Reject |
| false/absent | yes | Compare all the same |
| false/absent | no | Proceed |
No normalisation whatsoever before comparing (no case folding, no default port, no trailing slash, no percent-encoding). On a mismatch, the client MUST NOT act on error, error_description or error_uri. A future revision is expected to raise the AS's iss to a MUST.
stateClients SHOULD use and verify state and discard responses without it or with a mismatch (CSRF protection and, in proxies, consent bound to the callback).
grant_type=authorization_code, code, code_verifier, redirect_uri, client_id (plus client authentication if confidential), and resource (lesson 9.5).
{code_verifier, state, expected issuer, resource, requested scopes, AS, server} with a short expiry and single use.iss and granted scopes.1. What does the client do if code_challenge_methods_supported is missing from the AS metadata?
MCP requires verifying PKCE support via metadata; if it is missing, the client MUST abort.
2. The AS announces iss_parameter_supported true but the response carries no iss. The client…
According to the RFC 9207 table, absence with announced support means rejection.
3. How is iss compared with the recorded issuer?
With no normalisation at all.