Skip to content

Document ClientOAuthOptions.ScopeSelector usage - #1869

Open
z0rimo wants to merge 2 commits into
modelcontextprotocol:mainfrom
z0rimo:docs/oauth-scope-selector-1867
Open

z0rimo wants to merge 2 commits into
modelcontextprotocol:mainfrom
z0rimo:docs/oauth-scope-selector-1867

Conversation

@z0rimo

@z0rimo z0rimo commented Sep 11, 2026

Copy link
Copy Markdown

Documents how to use ClientOAuthOptions.ScopeSelector when configuring OAuth for an HTTP MCP client.

Motivation and Context

ClientOAuthOptions.ScopeSelector is a public API, but its behavior was only described in XML documentation and was not covered in the conceptual documentation.

This update makes the API easier to discover and explains the distinction between:

  • Scopes, which acts as a fallback when the server does not provide scope information; and
  • ScopeSelector, which can filter or customize the resolved scope set.

It also documents that the selector runs after offline_access is appended when advertised, that the selected scopes are used for Dynamic Client Registration, and that returning null or an empty sequence omits the scope parameter.

Closes #1867.

How Has This Been Tested?

  • git diff --check
  • Release build succeeded locally
  • Tests: 9,090 total, 8,991 passed, 99 skipped, 0 failed
  • DocFX completed with --warningsAsErrors true: 0 warnings, 0 errors

The repository currently reports NU1902 for the existing Microsoft.Build.Tasks.Git 8.0.0 dependency during restore. Local build and documentation validation suppressed only that existing NuGet audit warning.

Breaking Changes

None. This is a documentation-only change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

The change is intentionally scoped to the existing Streamable HTTP client documentation to avoid overlapping with the broader OAuth documentation work in #1801.

Note

This pull request was prepared with AI assistance.

@z0rimo

z0rimo commented Sep 26, 2026 •

Copy link
Copy Markdown
Author

Hi @halter73 — would you mind taking a look at this documentation PR when you have a chance?

Since you reviewed the ScopeSelector work in #1596, I thought you might be the right person to ask. This adds focused conceptual documentation for the existing ClientOAuthOptions.ScopeSelector behavior without changing the API.

The docs build and tests are clean. Happy to adjust the placement or level of detail if needed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document ClientOAuthOptions.ScopeSelector usage

1 participant