Fix OAuth metadata validation for compliant servers #778
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/sse
Breaking 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_basic
to allowedtoken_endpoint_auth_methods_supported
plain
to allowedcode_challenge_methods_supported
Compliance:
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.