claude-code - 💡(How to fix) Fix [Bug] MCP OAuth client hardcodes prompt=consent, bypassing tenant-wide admin consent

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Claude Code's built-in MCP OAuth client (authorization code + PKCE) appends prompt=consent to every authorization request. This forces the IdP consent screen on every single authentication, even when tenant-wide admin consent has already been granted.

Captured authorize URL (Microsoft Entra / Agent 365 MCP server):

https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize ?response_type=code &client_id=038aa3f3-b5b7-4ad0-a221-60f8c48e6f63 &code_challenge_method=S256 &redirect_uri=http://localhost:8080/callback &scope=https://agent365.svc.cloud.microsoft/agents/tenants/<tenant>/servers/mcp_CalendarTools/.default openid profile offline_access &prompt=consent &resource=https://agent365.svc.cloud.microsoft/agents/tenants/<tenant>/servers/mcp_CalendarTools

The scope is .default, which with admin consent should authenticate silently — but prompt=consent overrides that by design, so admin consent can never suppress the prompt. Every reconnect requires manually clicking through consent again, across each MCP server (Calendar, Mail, Teams, SharePoint, etc.) individually.

Impact: Significant friction for enterprise/M365 SSO scenarios. Admin consent is the standard mechanism orgs use to pre-approve apps; hardcoding prompt=consent defeats it.

Requested fix: Don't send prompt=consent by default — omit it, or use prompt=select_account — and/or expose the prompt parameter as a configurable field in the MCP server OAuth config so it can be overridden.

Environment: Claude Code CLI, macOS, remote HTTP MCP servers using OAuth (Microsoft Agent 365 / WorkIQ).

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.158
  • Feedback ID: 762d4509-614d-4fef-846b-a4364c14b326

Errors

[]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] MCP OAuth client hardcodes prompt=consent, bypassing tenant-wide admin consent