Skip to content

feat: add needs_reauth state and replace per-user connection badge with sessions link - #5714

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
07-29-feat_surface_needs_reauth_state_in_the_mcp_client_ui
Aug 8, 2026
Merged

Pratham-Mishra04 merged 1 commit into
devfrom
07-29-feat_surface_needs_reauth_state_in_the_mcp_client_ui

Conversation

@Pratham-Mishra04

Copy link
Copy Markdown
Collaborator

Summary

Per-user auth clients (per_user_oauth and per_user_headers) don't hold a persistent upstream connection, so displaying a connection-state badge for them is misleading. This PR replaces that badge with a "View sessions" link pointing to the MCP Sessions table filtered by the client. It also adds proper handling for the needs_reauth state, which previously had no color mapping and no explanatory copy.

Changes

  • Per-user auth clients now show a "View sessions" link instead of a connection-state badge in both the clients table and the client detail sheet, since their stateless design means connection state is not meaningful for them.
  • The "Reconnect" action in the client actions menu is now disabled when a client is in the needs_reauth state, since reconnecting is not a valid recovery path for expired credentials.
  • A needs_reauth color mapping (bg-red-100 text-red-800) has been added to MCP_STATUS_COLORS so the badge renders correctly for server-level clients in that state.
  • A descriptive sheet subtitle is shown when a client is in the needs_reauth state, explaining that credentials have expired and that recreating the client is the current workaround.
  • MCPConnectionState type has been extended to include needs_reauth.
  • Documentation has been updated to explain why per-user clients show sessions instead of a connection state.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

  1. Create an MCP client with per_user_oauth or per_user_headers auth type.
  2. Verify the clients table shows a "View sessions" link instead of a connection-state badge for that client.
  3. Click the link and confirm it navigates to the MCP Sessions page filtered by that client's ID.
  4. Open the client detail sheet and confirm the same "View sessions" link appears in the title area.
  5. Create or simulate a server-level client in the needs_reauth state and confirm the badge renders in red and the sheet description explains the reauth requirement.
  6. Confirm the "Reconnect" action is disabled for clients in the needs_reauth state.
cd ui
pnpm i || npm i
pnpm build || npm run build

Screenshots/Recordings

Before: Per-user auth clients displayed a connection-state badge (e.g., connected) that did not reflect their actual stateless behavior.

After: Per-user auth clients display a "View sessions" link. Server-level clients in needs_reauth show a red badge with an explanatory description.

Breaking changes

  • No

Related issues

Security considerations

None. This is a display-layer change; no auth logic or credential handling was modified.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Pratham-Mishra04 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

This was referenced Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added session links for per-user-authenticated MCP clients.
    • Added clear messaging when credentials require reauthorization, including guidance to recreate the client.
  • Bug Fixes

    • Disabled reconnect actions for clients requiring reauthorization.
    • Added visual support for the “Needs reauthorization” status.
  • Documentation

    • Clarified how connection states and MCP sessions apply to server-level and per-user clients.

Walkthrough

Per-user MCP clients now link to MCP sessions instead of shared connection states. The MCP status model adds needs_reauth for expired credentials, with matching styling, reconnect restrictions, client-sheet messaging, and documentation updates.

Changes

MCP session status handling

Layer / File(s) Summary
Reauthentication status presentation
ui/lib/types/mcp.ts, ui/lib/constants/config.ts, ui/app/workspace/mcp-registry/views/mcpClientSheet.tsx
Adds the needs_reauth status, applies error styling, and explains expired credentials and the current recreation workaround.
Clients table status actions
ui/app/workspace/mcp-registry/views/mcpClientsTable.tsx
Disables reconnect for needs_reauth clients. Per-user-authenticated clients link to filtered sessions instead of displaying connection-state badges.
Authentication documentation
docs/mcp/auth/overview.mdx
Defines connection-state semantics for persistent server-level clients and session navigation for stateless per-user clients.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • maximhq/bifrost#5028 — Adds the related MCP needs_reauth state and expired credential handling.

Possibly related PRs

Suggested reviewers: akshaydeo, danpiths, bearts

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely summarizes both primary changes: adding the needs_reauth state and replacing per-user connection badges with a sessions link.
Description check ✅ Passed The description covers the purpose, changes, affected areas, testing steps, breaking changes, security, and documentation updates, with only optional links or recordings absent.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-29-feat_surface_needs_reauth_state_in_the_mcp_client_ui

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
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
Pratham-Mishra04 force-pushed the 07-29-feat_reactively_retry_mcp_tool_calls_on_auth_failure branch from 6277f49 to e491115 Compare August 8, 2026 08:43
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 07-29-feat_surface_needs_reauth_state_in_the_mcp_client_ui branch from 7959576 to 321a25c Compare August 8, 2026 08:43

Pratham-Mishra04 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Aug 8, 8:47 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 8, 9:18 AM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 8, 9:19 AM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 07-29-feat_reactively_retry_mcp_tool_calls_on_auth_failure to graphite-base/5714 August 8, 2026 09:14
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/5714 to dev August 8, 2026 09:17
@Pratham-Mishra04
Pratham-Mishra04 dismissed coderabbitai[bot]’s stale review August 8, 2026 09:17

The base branch was changed.

@Pratham-Mishra04
Pratham-Mishra04 requested a review from a team as a code owner August 8, 2026 09:17
Per-user auth types now show the same connection-state badge as every
other client instead of a session-list link, keeping the edit sheet's
header consistent across auth types.
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 07-29-feat_surface_needs_reauth_state_in_the_mcp_client_ui branch from 321a25c to 44a4c79 Compare August 8, 2026 09:17
@Pratham-Mishra04
Pratham-Mishra04 merged commit 66e28dd into dev Aug 8, 2026
14 of 15 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 07-29-feat_surface_needs_reauth_state_in_the_mcp_client_ui branch August 8, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants