Content-Length: 271911 | pFad | https://github.com/modelcontextprotocol/python-sdk/issues/1630

95 OAuth2: Protected-resource URL passed as scope instead of parsed scope · Issue #1630 · modelcontextprotocol/python-sdk · GitHub
Skip to content

OAuth2: Protected-resource URL passed as scope instead of parsed scope #1630

@abliznyuk

Description

@abliznyuk

Initial Checks

Description

I noticed that the scope parameter is being set to the OAuth protected-resource URL instead of the parsed scope (or None when no scope is provided).

After inspecting the code, it seems the URL is passed directly as the scope here:

self.context.client_metadata.scope = get_client_metadata_scopes(
www_auth_resource_metadata_url,
self.context.protected_resource_metadata,
self.context.oauth_metadata,
)

This results in an incorrect scope value being propagated during OAuth2 authentication.

Example Code

Python & MCP Python SDK

1.21.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/modelcontextprotocol/python-sdk/issues/1630

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy