/mcp ux fix - #12
Conversation
- sign-in instructions (device code / fallback URL) now open in a pager
view instead of long toasts, in both classic and opentui; an mcp-oauth
confirm dialog asks before opening the browser
- device authorization (RFC 8628) is now preferred whenever the server
advertises it (verified live: GitHub exposes login/device/code), with
browser loopback as fallback after consent; noninteractive sessions
print the link + code on stderr
- github catalog entry accepts an optional GITHUB_OAUTH_CLIENT_ID
(auth.clientId) so device sign-in works without dynamic registration;
the no-client error now mentions the device option and gh auth login
- /mcp add and paste-add notify immediately ('adding…', 'connecting…')
instead of going silent for seconds
mcp auth: pager sign-in UX, device-first flow, add progress notices
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
There is a confirmed double-consent prompt issue in the loopback OAuth flow and a confirmed formatting issue in the fallback sign-in notice output.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves the MCP OAuth sign-in user experience by preferring device-code flow, adding explicit user consent prompts in the UI, and providing clearer in-app messaging during MCP server setup and authentication.
Changes:
- Prefer OAuth device-code flow even when a browser is available, and add an explicit consent prompt hook for OAuth flows.
- Improve TUI UX for MCP sign-in by showing device-code and authorization URL instructions in an overlay pager, plus new confirm modal titles for MCP OAuth.
- Enhance MCP server setup UX (notices) and extend known-server installation planning to support wiring an optional OAuth client ID into
auth.clientId.
File summaries
| File | Description |
|---|---|
| test/mcp/live-oauth-discovery.test.ts | Adds an opt-in live test to validate OAuth discovery metadata for catalog servers. |
| test/mcp/auth-device.test.ts | Updates expectations to enforce device-flow preference even when openBrowser exists. |
| src/ui-core/controllers/overlay-controller.ts | Extends confirm kinds to include MCP OAuth consent. |
| src/ui-core/commands/mcp-commands.ts | Adds informational session notices during MCP server add flows. |
| src/ui-core/bootstrap/composition-root.ts | Routes MCP OAuth UX through overlay pager/confirm for clearer sign-in guidance. |
| src/tui-v2/components/modal/confirm-modal.tsx | Adds title mapping for the new MCP OAuth confirm kind. |
| src/mcp/known-servers.ts | Adds optional GitHub OAuth client ID secret and supports mapping secrets into auth.clientId. |
| src/mcp/auth/provider.ts | Changes OAuth flow selection and introduces loopback/browser consent prompt messaging. |
| src/classic/panels/confirm-panel.ts | Adds title mapping for the new MCP OAuth confirm kind in the classic UI. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| throw new McpTransportError("network", "MCP OAuth authorization was declined."); | ||
| } | ||
| await this.requireConsent(metadata, scope); | ||
| const pkce = createPkcePair(); |
| "plain", | ||
| ); | ||
| if (!shown) { | ||
| sessionRef?.notice("info", lines.join(" · ")); |
Description
Related Issue
Closes #
Type of Change
How Has This Been Tested?
npm run typecheckpassesnpm testpassesTest Details
Screenshots / Recordings
Checklist