You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenIdProviderDiscoveryMetadataSchema strips revocation_endpoint, so clients can't revoke against OIDC-only authorization servers #3213
When authorization server metadata comes from OpenID Connect discovery, parsing it with OpenIdProviderDiscoveryMetadataSchema silently drops revocation_endpoint, along with any other RFC 8414 field that isn't declared. A client that later looks for revocation_endpoint concludes the server doesn't support revocation, even though the discovery document lists it.
Where
src/shared/auth.ts in @modelcontextprotocol/sdk 1.32.2 (with zod 4.6.7):
OpenIdProviderMetadataSchema is a z.looseObject, but spreading .shape into a plain z.object drops the loose behaviour. In zod v4, unknown keys are stripped.
The only OAuth metadata field picked in is code_challenge_methods_supported.
So the parsed result never contains revocation_endpoint.
Impact
Some authorization servers publish metadata only through OpenID discovery and return an error for the RFC 8414 paths. Amazon Cognito is one. Against those servers, clients built on the SDK never revoke on logout.
We see this in Claude Code 2.1.328: claude mcp logout <server> deletes the local credentials but logs Server does not support token revocation, and no revoke request reaches the server. The discovery document does list revocation_endpoint.
By contrast, anthropics/claude-code#105134 reports that logout does send revoke requests for servers that serve RFC 8414 metadata. That fits this being specific to the OpenID discovery path.
(Run against 1.32.2: the first line prints undefined, the second prints the URL.)
Suggested fix
Either:
keep unknown keys, by building the schema with z.looseObject({...}) or .loose(); or
spread the optional RFC 8414 fields that OpenID discovery documents commonly carry, such as revocation_endpoint, introspection_endpoint and revocation_endpoint_auth_methods_supported.
Related:#2733 and #2734 (the same schema, about over-strict validation rather than dropped fields), and the closed #739 (a client revocation helper).
Thanks for the write-up — the repro and the "loose behaviour disappears when you spread .shape into z.object" diagnosis were both right and made this quick to fix.
I've opened #3214 against v1.x: the schema is a z.looseObject again, and the three RFC 7009 revocation fields are picked from OAuthMetadataSchema so they arrive typed (and keep the javascript:/data:/vbscript: URL guard). Undeclared fields now pass through instead of being stripped, so the parsed metadata no longer contradicts the discovery document.
One note for your client: discoverAuthorizationServerMetadata() returns the parsed metadata as AuthorizationServerMetadata, so after this lands revocation_endpoint will be there for OIDC-only servers — worth re-checking your revocation path against it once a release ships.
Activity
fix(auth): keep OAuth revocation fields in OIDC discovery metadata
fix(auth): keep OAuth revocation fields in OIDC discovery metadata
marcus-beauregard commentedon Nov 19, 2026
Thanks for the write-up — the repro and the "loose behaviour disappears when you spread
.shapeintoz.object" diagnosis were both right and made this quick to fix.I've opened #3214 against
v1.x: the schema is az.looseObjectagain, and the three RFC 7009 revocation fields are picked fromOAuthMetadataSchemaso they arrive typed (and keep thejavascript:/data:/vbscript:URL guard). Undeclared fields now pass through instead of being stripped, so the parsed metadata no longer contradicts the discovery document.One note for your client:
discoverAuthorizationServerMetadata()returns the parsed metadata asAuthorizationServerMetadata, so after this landsrevocation_endpointwill be there for OIDC-only servers — worth re-checking your revocation path against it once a release ships.