Fix OAuth metadata validation for compliant servers#778
Closed
jalehman wants to merge 2 commits intomodelcontextprotocol:mainfrom
Closed
Fix OAuth metadata validation for compliant servers#778jalehman wants to merge 2 commits intomodelcontextprotocol:mainfrom
jalehman wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
The OAuthMetadata validation was too restrictive, rejecting valid OAuth 2.0 server configurations that advertise additional authentication methods beyond the minimum required set. Changes: - Allow 'client_secret_basic' in token_endpoint_auth_methods_supported - Allow 'plain' in code_challenge_methods_supported This fixes compatibility with MCP servers like Asana (mcp.asana.com) that advertise support for multiple OAuth authentication methods as allowed by the OAuth 2.0 specification and MCP specification. The MCP specification does not restrict which authentication methods servers can support, only requiring that PKCE is used. These changes ensure the client can connect to any compliant MCP server regardless of which optional authentication methods they also support.
Closed
9 tasks
|
Does anyone know why this isn’t being actively discussed? I couldn’t find any documentation mentioning that this isn’t supported I only found out by digging through the source code. cc @dsp-ant |
Member
|
We dropped the constraints. Now it is possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The OAuth metadata validation was overly restrictive, causing connection failures with
compliant MCP servers like Asana that support multiple OAuth authentication methods.
The validation rejected servers advertising additional authentication methods beyond
the minimum required set, even though these methods are allowed by both the MCP and
OAuth 2.0 specifications.
Specifically, servers returning:
token_endpoint_auth_methods_supported:["client_secret_basic","client_secret_post","none"]code_challenge_methods_supported:["plain","S256"]Were rejected because the client only accepted a limited subset of these methods.
How Has This Been Tested?
https://mcp.asana.com/sseBreaking Changes
No - this change maintains backward compatibility while expanding support for
additional compliant servers.
Types of changes
change)
Checklist
Additional context
Changes made:
client_secret_basicto allowedtoken_endpoint_auth_methods_supportedplainto allowedcode_challenge_methods_supportedCompliance:
ocol.io/specification/2025-03-26/basic/authorization.md) requires PKCE support but
doesn't restrict which authentication methods servers can advertise
relevant RFCs
This fix enables the MCP Python SDK to work with any compliant MCP server regardless
of which optional OAuth authentication methods they advertise.