Skip to content

fix(mcp): forward configured OAuth scopes during login - #3855

Open
kriptoburak wants to merge 1 commit into
tailcallhq:mainfrom
kriptoburak:codex/forward-mcp-oauth-scopes
Open

fix(mcp): forward configured OAuth scopes during login#3855
kriptoburak wants to merge 1 commit into
tailcallhq:mainfrom
kriptoburak:codex/forward-mcp-oauth-scopes

Conversation

@kriptoburak

Copy link
Copy Markdown

Summary

  • Forward configured OAuth scopes through the UI, API, and infrastructure layers.
  • Preserve server metadata discovery when no scopes are configured.
  • Document remote OAuth login with a working Xquik MCP example.
  • Cover configured and discovery-based scope selection with regression tests.

Problem

forge mcp login always passed an empty scope list to the OAuth client. This ignored oauth.scopes from .mcp.json. Scoped servers could then issue insufficient tokens or reject the flow.

The change keeps empty scopes for metadata discovery. It forwards explicit scopes when users configure them. The Xquik example uses its published mcp:tools scope for authenticated X (Twitter) search and automation.

Addresses #3339.

Verification

  • cargo test -p forge_domain mcp::tests -- --nocapture
  • cargo check -p forge_main
  • cargo test -p forge_main --no-run
  • cargo clippy -p forge_main --all-targets --all-features -- -D warnings
  • rustfmt --edition 2024 --check on all changed Rust files
  • README MCP configuration parsed successfully with jq

Co-Authored-By: ForgeCode noreply@forgecode.dev

Co-Authored-By: ForgeCode <noreply@forgecode.dev>
@CLAassistant

CLAassistant commented Aug 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the type: fix Iterations on existing features or infrastructure. label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants