Skip to content

Specified ClientOAuthOptions.Scopes are ignored #1236

@halllo

Description

@halllo

Describe the bug
My client specifies Scopes via the ClientOAuthOptions. The xml comment states

"When specified, these scopes will be used instead of the scopes advertised by the protected resource.".

However it always uses the scopes from the PRM for the authorize URL. It only falls back to the specified scopes, when the PRM does not provide any scopes. I have no chance to tell it what scopes to actually use.

To Reproduce
Steps to reproduce the behavior:

  1. Use ModelContextProtocol@0.7.0-preview.1
  2. Create HttpClientTransportOptions with ClientOAuthOptions and set the Scopes to a subset of the PRM scopes.
  3. Connect to the MCP server. It generates an authorisation URL with all scopes defined in PRM.

Expected behavior
If I have specified Scopes in ClientOAuthOptions of HttpClientTransportOptions, the authorize URL should contain the specified scopes.
If I have not specified Scopes in ClientOAuthOptions of HttpClientTransportOptions, the authorize URL should contain the scopes from the PRM.

Additional context
I am quite sure this worked correctly in the past.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions