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
This is a follow-up to #832 and #992, not a report that the check is missing — it is deliberately
permissive, and this is about the spec moving underneath that decision.
#992 made startAuthorization treat an absent code_challenge_methods_supported as "assume PKCE is
supported", to unblock Azure AD and AWS Cognito, whose OIDC discovery documents omit the field while
the providers do support S256. The reasoning in #832 was explicitly "if the list isn't present,
assume it's there, and rely on the requests later failing if you send PKCE parameters that the AS
doesn't support."
The MCP specification has since taken the opposite position. The 2025-11-25 revision's
"Authorization Code Protection" section requires clients to verify PKCE support from
authorization-server metadata and to refuse when the field is absent — stated separately for RFC
8414 metadata and for OpenID Connect Discovery, the latter precisely because OIDC provider metadata
does not define the field. It also tells OIDC providers to publish it for MCP compatibility.
The 2025-06-18 revision does not mention code_challenge_methods_supported at all, so this
requirement post-dates #992. The SDK currently implements the #992 behavior and therefore does not
satisfy the 2025-11-25 requirement.
if(metadata.code_challenge_methods_supported&&!metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)){thrownewError(`Incompatible auth server: does not support code challenge method ...`);}
The leading truthiness check makes an absent field a no-op. At the schema level the field is .optional() on OAuthMetadataSchema, and OpenIdProviderDiscoveryMetadataSchema picks that same
optional field, so an OIDC document without it parses clean and proceeds to authorization.
Reproduction
Serve authorization-server metadata with no code_challenge_methods_supported (issuer, authorization_endpoint, token_endpoint, response_types_supported: ["code"]) and run the auth() flow. It completes; nothing is raised or surfaced.
Why this is worth revisiting rather than closing
The #832 rationale holds for the common case and I am not arguing it should be reverted: PKCE
parameters are still sent, so a server that supports PKCE but omits the advertisement remains fully
protected. The gap is narrower than "no PKCE".
What the current behavior cannot do is distinguish that server from one that ignores code_challenge
outright, and it gives an embedder no signal that the distinction was unresolvable. "Rely on the
requests later failing" does not hold for this specific failure mode: an authorization server with
no PKCE support does not reject a request carrying code_challenge, it ignores the parameter, and
the flow succeeds with the protection silently absent.
Summary
This is a follow-up to #832 and #992, not a report that the check is missing — it is deliberately
permissive, and this is about the spec moving underneath that decision.
#992 made
startAuthorizationtreat an absentcode_challenge_methods_supportedas "assume PKCE issupported", to unblock Azure AD and AWS Cognito, whose OIDC discovery documents omit the field while
the providers do support S256. The reasoning in #832 was explicitly "if the list isn't present,
assume it's there, and rely on the requests later failing if you send PKCE parameters that the AS
doesn't support."
The MCP specification has since taken the opposite position. The 2025-11-25 revision's
"Authorization Code Protection" section requires clients to verify PKCE support from
authorization-server metadata and to refuse when the field is absent — stated separately for RFC
8414 metadata and for OpenID Connect Discovery, the latter precisely because OIDC provider metadata
does not define the field. It also tells OIDC providers to publish it for MCP compatibility.
The 2025-06-18 revision does not mention
code_challenge_methods_supportedat all, so thisrequirement post-dates #992. The SDK currently implements the #992 behavior and therefore does not
satisfy the 2025-11-25 requirement.
Current behavior
@modelcontextprotocol/client2.0.0,startAuthorization:The leading truthiness check makes an absent field a no-op. At the schema level the field is
.optional()onOAuthMetadataSchema, andOpenIdProviderDiscoveryMetadataSchemapicks that sameoptional field, so an OIDC document without it parses clean and proceeds to authorization.
Reproduction
Serve authorization-server metadata with no
code_challenge_methods_supported(issuer,authorization_endpoint,token_endpoint,response_types_supported: ["code"]) and run theauth()flow. It completes; nothing is raised or surfaced.Why this is worth revisiting rather than closing
The #832 rationale holds for the common case and I am not arguing it should be reverted: PKCE
parameters are still sent, so a server that supports PKCE but omits the advertisement remains fully
protected. The gap is narrower than "no PKCE".
What the current behavior cannot do is distinguish that server from one that ignores
code_challengeoutright, and it gives an embedder no signal that the distinction was unresolvable. "Rely on the
requests later failing" does not hold for this specific failure mode: an authorization server with
no PKCE support does not reject a request carrying
code_challenge, it ignores the parameter, andthe flow succeeds with the protection silently absent.
Possible resolutions
the returned discovery state — so embedders can apply their own policy. This preserves Default to S256 code challenge if not specified in authorization server metadata #992 and is
the smallest change.
Azure OIDC discovery metadata missing code_challenge_methods_supported breaks S256 PKCE validation #832 breakage as the default.
We implemented (1) plus (2) at the gateway layer and would be happy to send a PR for whichever
direction you prefer here.
Environment
@modelcontextprotocol/client2.0.0 (latest at time of filing).