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
VSCode is unable to connect to the remote MCP server with OAuth 2.1 built using the MCP Python SDK.
When VSCode initiates the registry, the grant_types
in the client metadata are ['authorization_code', 'refresh_token', 'urn:ietf:params:oauth:grant-type:device_code']
, but the Python SDK only supports authorization_code
and refresh_token
, resulting in a 400 Bad Request
response from the MCP server.
In reality, grant_types is simply a collection of declarations for OAuth 2.1 registration methods, and the actual registration flow to be used is determined by the client, not by a strict match between client and server supported flows.
In the TypeScript version of the MCP SDK, grant_types is a list of strings, and it is not strictly required to fully match the client's declarations.
Example Code
Python & MCP Python SDK
1.9.4