You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ClientOAuthOptions.ScopeSelector is a public API for customizing the OAuth scopes selected after the server-provided scope information has been resolved. It was added in #1596, but I couldn't find any conceptual documentation showing when or how to use it.
The XML documentation describes the API behavior, but users browsing the SDK documentation may not discover that ScopeSelector can be used to:
filter scopes advertised by the server;
append client-specific scopes when needed;
return null or an empty sequence to omit the scope parameter entirely.
A small conceptual example would make this behavior easier to discover, for example:
varoauthOptions=newClientOAuthOptions{ScopeSelector= scopes =>scopes?.Where(scope =>scopeis"mcp:tools" or "mcp:resources")};
This would be especially useful alongside the existing OAuth guidance, where users may otherwise assume that Scopes is the only way to influence the requested scope set.
I also checked the currently open OAuth documentation work in #1801, which does not appear to cover ScopeSelector.
I'd be happy to submit a focused documentation PR for this and keep the change narrowly scoped to client-side scope selection, placing it wherever best fits the documentation structure.
ClientOAuthOptions.ScopeSelectoris a public API for customizing the OAuth scopes selected after the server-provided scope information has been resolved. It was added in #1596, but I couldn't find any conceptual documentation showing when or how to use it.The XML documentation describes the API behavior, but users browsing the SDK documentation may not discover that
ScopeSelectorcan be used to:nullor an empty sequence to omit thescopeparameter entirely.A small conceptual example would make this behavior easier to discover, for example:
This would be especially useful alongside the existing OAuth guidance, where users may otherwise assume that
Scopesis the only way to influence the requested scope set.I also checked the currently open OAuth documentation work in #1801, which does not appear to cover
ScopeSelector.I'd be happy to submit a focused documentation PR for this and keep the change narrowly scoped to client-side scope selection, placing it wherever best fits the documentation structure.
Note
This issue was prepared with AI assistance.