feat: add ui for token_exchange (On-Behalf-Of) auth type MCP clients - #5725
Merged
Pratham-Mishra04 merged 1 commit intoAug 8, 2026
Merged
Conversation
This was referenced Jul 30, 2026
Merged
|
|
This was referenced Jul 30, 2026
refactor: migrate OAuth flow state/PKCE fields from
oauth_configs to new mcp_oauth_flows table
#5709
Merged
Merged
Merged
Merged
Collaborator
Author
This was referenced Aug 6, 2026
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@framework/oauth2/tokenexchange.go`:
- Around line 22-32: Update the documentation for subjectTokenTypeAccessToken
and BifrostContextKeyMCPInboundBearer to describe the RFC 8693 subject_token
flow, referring to the value as the caller’s inbound bearer and requiring it to
be an OAuth access token rather than an ID token. Remove the provider-specific
claims that id_token is unsupported or categorically rejected, while preserving
the responsibility for the context value to contain the correct access token.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1a2f053b-2aa3-4e52-8060-687435cfe851
📒 Files selected for processing (9)
framework/oauth2/tokenexchange.goui/app/workspace/mcp-registry/library/views/mcpLibraryInstallSheet.tsxui/app/workspace/mcp-registry/views/mcpClientForm.tsxui/app/workspace/mcp-registry/views/mcpClientSheet.tsxui/app/workspace/mcp-registry/views/mcpClientsFilterSidebar.tsxui/app/workspace/mcp-registry/views/mcpClientsTable.tsxui/lib/store/apis/mcpApi.tsui/lib/types/mcp.tsui/lib/types/schemas.ts
🚧 Files skipped from review as they are similar to previous changes (8)
- ui/app/workspace/mcp-registry/views/mcpClientsFilterSidebar.tsx
- ui/app/workspace/mcp-registry/library/views/mcpLibraryInstallSheet.tsx
- ui/lib/types/schemas.ts
- ui/lib/store/apis/mcpApi.ts
- ui/lib/types/mcp.ts
- ui/app/workspace/mcp-registry/views/mcpClientForm.tsx
- ui/app/workspace/mcp-registry/views/mcpClientsTable.tsx
- ui/app/workspace/mcp-registry/views/mcpClientSheet.tsx
Pratham-Mishra04
force-pushed
the
07-30-feat_add_token_exchange_mcp_auth_type_for_on-behalf-of_upstream_credentials
branch
from
August 6, 2026 21:53
a50a683 to
69add27
Compare
Pratham-Mishra04
force-pushed
the
07-31-feat_ui_support_for_token_exchange_mcp_auth_type
branch
from
August 6, 2026 21:53
576081e to
01d9624
Compare
Contributor
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Pratham-Mishra04
force-pushed
the
07-30-feat_add_token_exchange_mcp_auth_type_for_on-behalf-of_upstream_credentials
branch
from
August 8, 2026 08:43
69add27 to
367a387
Compare
Pratham-Mishra04
force-pushed
the
07-31-feat_ui_support_for_token_exchange_mcp_auth_type
branch
from
August 8, 2026 08:43
01d9624 to
0c63dfc
Compare
Collaborator
Author
Merge activity
|
Pratham-Mishra04
changed the base branch from
07-30-feat_add_token_exchange_mcp_auth_type_for_on-behalf-of_upstream_credentials
to
graphite-base/5725
August 8, 2026 09:59
Pratham-Mishra04
dismissed
coderabbitai[bot]’s stale review
August 8, 2026 10:02
The base branch was changed.
… confirm dialog, badge pending_verification/needs_reauth instead of the sessions link handleStartBootstrap never gained a token_exchange branch when the Authorize/Verify action moved to the row actions menu, so a pending token_exchange client hit initiate-verification (OAuth-only) and failed with a 400. Route it through the same confirm dialog used to re-verify an already-connected token_exchange client instead. The table's State column also only ever surfaced needs_reauth for per-user auth types, leaving pending_verification invisible there even though it's the state the same action targets; the sessions link doesn't help either of these two admin-facing states (nothing to view yet, or the link isn't the fix), so both now show just the badge.
Pratham-Mishra04
force-pushed
the
07-31-feat_ui_support_for_token_exchange_mcp_auth_type
branch
from
August 8, 2026 10:02
0c63dfc to
8c4a45c
Compare
Pratham-Mishra04
deleted the
07-31-feat_ui_support_for_token_exchange_mcp_auth_type
branch
August 8, 2026 10:04
This was referenced Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds
token_exchangeas a first-class MCP auth type, enabling OAuth 2.0 Token Exchange (On-Behalf-Of) for MCP clients. When configured, each caller's identity-provider token is automatically exchanged at runtime for a short-lived token scoped to the target server's audience — no per-user login flow, no shared credential, and no persistent session rows. The feature is gated behindIS_ENTERPRISEand requires an active SCIM/IdP integration to be visible in the UI.Changes
token_exchangeto theMCPAuthTypeunion and introducedMCPTokenExchangeConfig(audience, exchange client ID/secret, optional scopes) to the MCP type definitions and request/response interfaces.token_exchangeauth kind option, including fields for audience, exchange client ID, exchange client secret (optional), and scopes. The option only renders when the deployment has an IdP configured.token_exchangesince it is inherently per-caller with no shared variant.verifyMCPClientExchangeAPI mutation that POSTs to/mcp/client/:id/verify-exchangewith no body; the backend exchanges the signed-in admin's own identity token to bootstrap and discover tools.token_exchangeinto the client sheet: bootstrap uses "Verify as me" instead of an OAuth browser flow, a "Re-verify as me" repair button appears onneeds_reauth, and the connection-state badge is suppressed (no persistent session to display).token_exchangeas a per-user auth type throughout the table and sheet so reconnect actions and session links are correctly suppressed.token_exchangeas a filter option in the clients filter sidebar and as a display label in the clients table.token_exchangelabel and help text to the MCP library install sheet.Type of change
Affected areas
How to test
pending_verificationand "Re-verify as me" forneeds_reauth.token_exchangeclients.token_exchangeappears as a filter option in the sidebar and renders "Token Exchange" / "Per-User" in the table columns.cd ui pnpm i pnpm buildBreaking changes
Security considerations
SecretVarvalues and are redacted on GET responses, consistent with existing OAuth credential handling.token_exchangeclients, enforced server-side.Checklist
docs/contributing/README.mdand followed the guidelines