Repository navigation
Conversation
A command the server answers with 403 insufficient_scope used to surface as a generic "Insufficient scope" server error (exit 2) with no way forward. The bridge now recognises the SDK's InsufficientScopeError, keeps the session live (the token is valid, only a scope is missing) and fails with exit code 4, naming the required scope and the exact `mcpc login <server> --scope "<current scopes plus the missing one>"` to run, followed by `restart`. The logs hint goes on its own line for multi-line errors so it never sticks to that command. `login` without --scope now probes the server's 401 WWW-Authenticate challenge (the first choice in the spec's scope selection strategy) and unions its scope with the scopes the profile already holds, so a re-login never drops a permission; the challenge's resource_metadata URL is handed to the SDK too. With --scope, exactly those scopes are requested. The requested scope is recorded on the profile when the token response omits `scope`. Client-credentials and id-jag sessions already step up through the SDK; the new e2e suite covers that path as well as the static-header case, against a scope gate added to both test servers (SCOPE_GATE_TOOL / SCOPE_GATE_SCOPE). Refs https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#step-up-authorization-flow Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015wgSmuAJRjQz56MXXBpFTF
Keeps both the step-up authorization entries and the new `login --client-name` entry in the changelog, and both constructor fields in OAuthProvider. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015wgSmuAJRjQz56MXXBpFTF
…rver The scope probe `login` sends to read the server's 401 challenge ran before the callback server was listening, so a server that stalls the probe delayed the redirect port being bound (CI's `login --callback-port` test, which points login at a hanging server, timed out after 10s). The probe now runs once the callback server is up, and the requested scope is handed to the provider through a setter instead of a constructor option. Also keeps the step-up entries in a fresh [Unreleased] section above the 0.8.0 release that main cut, and both halves of the merged oauth-flow tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015wgSmuAJRjQz56MXXBpFTF
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A command the server answers with
403 insufficient_scopeused to surface as a generic "Insufficient scope" server error with no way forward. mcpc now follows the MCP step-up authorization flow as far as a client that never opens a browser on its own can: the error names the missing scope and the exactlogin --scope "<current scopes plus the missing one>"to run, and the session stays usable.insufficient_scopefails with exit code 4 and a copy-pastelogin --scope ...plusrestarthint; the session is not marked unauthorized.loginwithout--scopereads the server's 401WWW-Authenticatechallenge (first in the spec's scope selection order) and unions its scope with the profile's current scopes;--scopestays verbatim.For details, run: ... logshint moves to its own line for multi-line errors so it never sticks to the command.Refs the review in this session (no issue filed).
🤖 Generated with Claude Code
https://claude.ai/code/session_015wgSmuAJRjQz56MXXBpFTF