Skip to content

feat(mcp): Honor OIDC prompt to let clients pick a Sentry account - #1971

Merged
BYK merged 2 commits into
mainfrom
feat/mcp-oauth-switch-account
Nov 9, 2026
Merged

BYK merged 2 commits into
mainfrom
feat/mcp-oauth-switch-account

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Connecting a second Sentry login to the same MCP client doesn't work while the sign-in browser has a Sentry session. Sentry skips its consent step for an app the user already approved, and that step is the only place that shows who is signed in and offers Switch account. This implements approach B from #1925.

When a client sends OIDC prompt=select_account, consent, or login to /oauth/authorize, the sentry.io redirect now carries force_prompt=1. Sentry already reads that flag (useOAuthAuthorizeFlow.ts) and then shows its consent step instead of auto-approving. Copilot CLI, for example, sends select_account when it forces a re-auth. The flag lives in the signed approval form state. It isn't added to the auth request that reaches the callback.

Root and path-scoped authorization server metadata now advertise prompt_values_supported: ["consent", "select_account"]. login is accepted but not advertised, because Sentry shows the signed-in account rather than forcing re-authentication. prompt=none is still ignored, as it was before.

The approval screen doesn't change, and requests without prompt go through the same flow as today. An earlier revision added a "Use a different Sentry account" checkbox. Review said multi-account is an outlier case that shouldn't change the screen everyone sees, so the checkbox is gone.

The login_hint recently added to Sentry OAuth doesn't help here. It exists only on the device flow, and the MCP server doesn't know which email the user wants anyway.

Refs #1925

via @BYK.

--

View Session in Sentry

When the sign-in browser already has a Sentry session, Sentry skips its
consent step for an app the user already approved, so a second account
can't be connected without signing out of sentry.io first.

Add a "Use a different Sentry account" option to the MCP approval
screen. When selected, the Sentry redirect carries force_prompt=1, so
Sentry shows the signed-in user and Switch account. The option is
preselected when the client sends OIDC prompt=select_account, consent,
or login, and authorization server metadata advertises
prompt_values_supported. The default reconnect flow is unchanged.

Refs #1925

Co-Authored-By: Claude <[email protected]>
@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 9, 2026 11:56am UTC

Request Review

@BYK

BYK commented Nov 5, 2026

Copy link
Copy Markdown
Member

This is LGTM but since it is a product decision, leaving it to you @dcramer

Per review, multi-account is an outlier case and shouldn't change the
approval screen everyone sees. Remove the "Use a different Sentry
account" option. The OIDC `prompt` from the client is now carried in
the signed approval form state and mapped straight to Sentry's
force_prompt, with no UI change.

Co-Authored-By: Claude <[email protected]>
@sentry-junior sentry-junior Bot changed the title feat(mcp): Let users pick a Sentry account when connecting feat(mcp): Honor OIDC prompt to let clients pick a Sentry account Nov 9, 2026
@BYK
BYK merged commit 0c836f5 into main Nov 9, 2026
26 of 27 checks passed
@BYK
BYK deleted the feat/mcp-oauth-switch-account branch November 9, 2026 12:46

This branch was successfully deployed

1 active deployment
Preview — f91ffc9d Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant