Skip to content

fix(mcp): propagate scopes through dynamic client registration - #3881

Draft
aheritier wants to merge 1 commit into
mainfrom
fix/3879-dcr-scope-propagation
Draft

fix(mcp): propagate scopes through dynamic client registration#3881
aheritier wants to merge 1 commit into
mainfrom
fix/3879-dcr-scope-propagation

Conversation

@aheritier

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3879

Successful dynamic client registration (DCR) dropped configured or discovered scopes, causing scope mismatches for Atlassian integrations.

Implementation

  • Applies selector precedence: configured > challenge > PRM > omitted.
  • Propagates the selected scopes exactly through DCR, authorization, and RequestedScopes.
  • Adds a quote-aware parser for multi-challenge WWW-Authenticate headers.
  • Normalizes configuration and validates it during preflight.
  • Keeps explicit and prompt-based paths unchanged; they are not widened.

Testing

Focused and full test suites, lint, build, and race coverage were run.

Follow-up and merge gates

  • Catalog owner decision is required.
  • Add/update documentation for re-consent behavior and include a release note.
  • Standalone debug-login scope support is separate planned work and is not included here.

Carry explicitly configured or provider-advertised scopes through
DCR-based remote MCP OAuth so registration, authorization, and stored
token bookkeeping stay consistent. Adds quote-aware, multi-challenge-
continuing WWW-Authenticate parsing, normalizes configured scopes the
same way on both the DCR-selection and preflight-coverage sides to
avoid a reauth loop, and exercises every resolveClientCredentials
branch (explicit client, prompt fallback, successful DCR) with
end-to-end scope equality across the registration body, authorize URL,
and RequestedScopes.
@aheritier aheritier added area/mcp MCP protocol, MCP tool servers, integration kind/fix PR fixes a bug (maps to fix:). Use on PRs only. status/do-not-merge labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/mcp MCP protocol, MCP tool servers, integration kind/fix PR fixes a bug (maps to fix:). Use on PRs only. status/do-not-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: propagate OAuth scopes in successful DCR MCP flows

1 participant