-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on
Description
Initial Checks
- I confirm that I'm using the latest version of MCP Python SDK
- I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue
Description
python-sdk/src/mcp/client/auth.py
Line 437 in 673423d
| token_response = OAuthToken.model_validate_json(content) |
OAuthClientProvider._handle_token_response expects JSON, but doesn't specify this in the headers. If the server responds in a different format, an exception will be raised.
For example, https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github
access_token endpoint by default returns form-data and requires the Accept: application/json header to return json.
Example Code
Python & MCP Python SDK
python 3.11.9
mcp=1.16.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on