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.
MCP promotes progressive least privilege: request few scopes at the start and escalate when an operation demands it, guided by the server via WWW-Authenticate.
Servers SHOULD include scope in the WWW-Authenticate of the 401 (RFC 6750 §3). The scopes in the challenge MAY match scopes_supported, be a subset, a superset or neither; the client MUST NOT assume any relationship and MUST treat those in the challenge as authoritative for the current operation.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource", scope="files:read"
scope from WWW-Authenticate if present.scopes_supported from the PRM; if there are none either, omit scope.scopes_supported represents the minimum for basic functionality; everything else is obtained via step-up.
With a valid token but without permissions, the server SHOULD respond:
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope", scope="files:write",
resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource",
error_description="File write permission required for this operation"
The scope in the challenge describes what is needed for that operation (there is no need to repeat what has already been granted). Servers SHOULD include in a single challenge all the scopes the operation requires (not one at a time), be consistent and consider the impact on UX. Possible strategies: minimal (the operation only), recommended (operation + related), extended (+ foreseeable).
Clients acting on behalf of a user SHOULD attempt the step-up; client_credentials clients MAY attempt it or abort. Servers MUST take scope hierarchies into account (a broad scope implies the narrow ones) when deciding whether a token is sufficient.
Avoid: publishing every possible scope in scopes_supported; omnibus scopes (*, all, full-access); grouping unrelated privileges; returning the whole catalogue in every challenge; changing scope semantics without versioning; trusting the token's scopes without authorisation logic on the server. Servers SHOULD emit precise challenges and log escalations with correlation ids.
mcp:tools:read, srv-a:tools:call) and emit challenges per operation.insufficient_scope into an elicitation or a clear error towards the host.1. Which set of scopes does the client request in a step-up?
This way it keeps previous permissions when the server emits per-operation challenges.
2. Which status and error does the server use for insufficient scope with a valid token?
403 with WWW-Authenticate error=insufficient_scope and the required scope.
3. If the initial 401 does not include scope, the client…
It is the second option of the selection strategy.