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.
Before authorising, the client needs a client_id recognised by the AS. MCP defines three mechanisms and a priority order.
Clients that support all of them SHOULD use this order:
client_id_metadata_document_supported: true.registration_endpoint (deprecated).The client_id is an HTTPS URL that serves a JSON document with the client's metadata. It solves the typical MCP case: client and server with no prior relationship. ASs and clients SHOULD support it.
{ "client_id": "https://app.example.com/oauth/client-metadata.json",
"client_name": "Example MCP Client", "client_uri": "https://app.example.com", "logo_uri": "https://app.example.com/logo.png",
"redirect_uris": ["http://127.0.0.1:3000/callback", "http://localhost:3000/callback"],
"grant_types": ["authorization_code"], "response_types": ["code"], "token_endpoint_auth_method": "none" }
Client MUST: host the document over HTTPS; client_id with the https scheme and with a path component; include at least client_id, client_name, redirect_uris; the client_id in the document MUST match its URL exactly. It MAY use private_key_jwt with a JWKS.
AS: SHOULD fetch the document on seeing a URL-shaped client_id; MUST validate that client_id matches the URL, that the JSON is valid with the required fields and that the request's redirect_uri is in the list; SHOULD cache honouring HTTP headers; SHOULD follow the security considerations (SSRF, localhost, trust policies).
Key advantage: CIMDs are portable across ASs; there is no need to re-register if the AS changes.
Clients SHOULD allow static credentials: a client_id (and secret where applicable) built in for an AS, or a UI where the user enters them after registering themselves.
RFC 7591: a POST to the registration_endpoint without interaction. Kept for compatibility. It MUST indicate application_type: native for desktop, mobile, CLI and local web apps on localhost; web for remote apps. Omitting it is equivalent to web under OIDC and clashes with native redirect URIs. The client MUST be prepared for failures due to redirect URI restrictions and SHOULD show a useful error; it MAY retry with adjustments.
Pre-registered credentials or credentials persisted via DCR MUST be associated with the AS that issued them, by its issuer. If the AS changes (detected via the PRM), the client MUST NOT reuse them and MUST re-register; with pre-registration, it SHOULD show an error instead of attempting non-matching credentials.
client_id for every AS that supports it, no dynamic secrets, and the option of authenticating as a confidential client with private_key_jwt.issuer; AS-change detector per server.1. What form does the client_id take in Client ID Metadata Documents?
The URL is the identity and the AS resolves it on demand.
2. Which application_type must a desktop CLI use in DCR?
Local apps and CLIs are native; omitting it is equivalent to web.
3. If a server's AS changes, what happens to the credentials obtained via DCR?
Credentials are bound to the issuer that issued them.
4. What is the registration order of preference?
Pre-registration if it exists, then CIMD if the AS supports it, DCR as a fallback, and finally asking the user.