-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
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
Metadata
Metadata
Assignees
Labels
No labels