Skip to content

improvement(mcp): make the OAuth experience visible and verbally consistent#5829

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/mcp-settings-ux-polish
Jul 22, 2026
Merged

improvement(mcp): make the OAuth experience visible and verbally consistent#5829
waleedlatif1 merged 3 commits into
stagingfrom
fix/mcp-settings-ux-polish

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

From a full UX-consistency audit of the MCP settings surfaces (design-system + copy + state-walkthrough vs sibling settings pages):

  • One name for one action — 'Authorize' / 'Reopen authorization' everywhere; previously the same action read 'Connect with OAuth', 'Reopen authorization window', 'Authorize', or 'Reopen authorization' depending on surface.
  • Connecting state is visible — while a popup is open the row subtitle shows muted 'Waiting for authorization...' instead of continuing to show the red 'OAuth authorization required'.
  • Visible Authorize chip on the list row (was buried in the ⋯ menu) — so the popup-blocked toast's 'retry' has an obvious target.
  • Removed the redundant aggregate discovery banner — every failing row already reports its specific error; the banner double-reported and out-generalized it.
  • Refresh chip stops rendering an error sentence as a button label — short 'Failed'; the Status field explains.
  • Sentence-case + copy sweep: Unnamed server, Not connected, Server name, Add MCP server / Edit MCP server, 'Add server' submit, Test connection, Edit form, Delete MCP server, 'Search servers...' placeholder.
  • Token compliance: row subtitle → text-caption, inline error → text-small (per sim-settings-pages); Loading empty state instead of a blank body flash.

Type of Change

  • Improvement (UX consistency)

Testing

12/12 component tests green (label + refresh-state tests updated to the new copy), tsc + biome clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…istent

From a full UX-consistency audit of the MCP settings surfaces:
- One name for one action: 'Authorize' / 'Reopen authorization' everywhere
  (list chip, row, detail) — was three different labels across surfaces.
- The connecting state is now visible: the row subtitle shows a muted
  'Waiting for authorization...' instead of continuing to shout the red
  'OAuth authorization required' mid-flow.
- The Authorize affordance is a visible chip on the list row (was buried in
  the overflow menu), so a blocked popup's 'retry' has an obvious target.
- Removed the redundant aggregate discovery banner — every failing row
  already reports its specific error; two red messages for one failure.
- The header Refresh chip no longer renders an error sentence as its label
  (short 'Failed'; the Status field carries the explanation).
- Sentence-case sweep (Unnamed server, Not connected, Server name, Add MCP
  server / Edit MCP server, Add server, Test connection, Edit form, Delete
  MCP server), 'Search servers...' placeholder, row-subtitle/error text on
  the canonical tokens, and a Loading empty state instead of a blank flash.
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 22, 2026 12:24am

Request Review

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are limited to MCP workspace settings UI copy and client-side OAuth popup state; tests were updated and there is no server auth or data-model change.

Overview
OAuth and list UX — The MCP server list and detail views now use Authorize / Reopen authorization consistently, show a muted Waiting for authorization... subtitle while a popup is open (instead of a red “OAuth authorization required”), and expose an Authorize chip on each row instead of hiding it in the ⋯ menu. Per-row discovery failures surface even when stale tool counts exist; the redundant aggregate discovery banner is removed.

Refresh and copy — The detail Refresh action label is shortened to Failed on error (status text stays on the Status field); disconnected OAuth no longer gets a special long message on that button. A sentence-case and typography pass covers modals, placeholders, empty/loading states, and labels such as Unnamed server and Search servers....

OAuth hookuseMcpOauthPopup polls for a closed popup to clear the connecting label early while keeping the flow registered so a late BroadcastChannel completion still invalidates queries without double-decrementing the connecting count.

Reviewed by Cursor Bugbot for commit 57c6ee4. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes the MCP OAuth experience more visible and consistent. The main changes are:

  • Standardized authorization, server, form, and status wording.
  • Added authorization actions and waiting status directly to server rows.
  • Kept discovery failures visible when cached tools exist.
  • Added popup-close tracking while preserving late OAuth completion.
  • Improved loading, refresh, and error presentation.

Confidence Score: 5/5

This looks safe to merge.

  • The cached-tools fix now surfaces the latest discovery error.
  • Popup closure clears the waiting state without dropping late completion events.
  • Flow cleanup guards against duplicate count updates.
  • No blocking issues were found in the updated code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/settings/components/mcp/mcp.tsx Exposes OAuth actions and waiting state, standardizes copy, and keeps current discovery failures visible alongside cached tools.
apps/sim/hooks/mcp/use-mcp-oauth-popup.ts Clears the waiting label after popup closure while retaining pending flow correlation for late completion.
apps/sim/app/workspace/[workspaceId]/settings/components/mcp/refresh-action-state.ts Simplifies refresh failure labels and removes unused OAuth-specific inputs.

Reviews (2): Last reviewed commit: "fix(mcp): show stale-discovery failures,..." | Re-trigger Greptile

…l clear, drop redundant branch

- A failing latest discovery now shows its error even when cached tools exist
  (the stale tool count silently hid it).
- Best-effort popup.closed poll clears only the 'Waiting for authorization...'
  label share; the flow entry stays registered so a completion that still
  arrives over the BroadcastChannel is honored (settleFlow skips the
  double-decrement). Under COOP misreport the worst case is an early label
  reset, never a dropped completion.
- Remove the OAuth refresh-state branch made redundant by the 'Failed' change,
  plus its now-unused authType/error inputs.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 57c6ee4. Configure here.

@waleedlatif1
waleedlatif1 merged commit 1f9f65d into staging Jul 22, 2026
20 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/mcp-settings-ux-polish branch July 22, 2026 00:49
waleedlatif1 added a commit that referenced this pull request Jul 22, 2026
…nsient failure (#5839)

* fix(mcp): keep last-known-good tools instead of flashing red on a transient failure

A connected server with cached tools was turning red 'Failed to discover' on a
single transient discovery probe blip, even though the stored status stayed
connected with tools — because useMcpToolsQuery dropped React Query's retained
data on error, and the row's showDiscoveryError fired over a populated server.

Now the aggregate keeps last-known-good tools across a failed refetch, and the
row only hard-reds when there are genuinely no tools to show. A persistent
failure still surfaces via the stored connectionStatus (gated by
MAX_CONSECUTIVE_FAILURES), matching how Claude Code / LibreChat / OpenCode /
VS Code handle a transient tools/list failure on a live connection.

Validated against those clients' source + the MCP spec before changing; this
supersedes the #5829 over-correction that showed the error even when tools
existed.

* fix(mcp): drop stale tools once a server is persistently failed, keep on transient

Sharpens the last-known-good behavior with the transient-vs-persistent distinction
the reference clients make: keep cached tools through a transient discovery failure
(stored status still healthy) so a populated server doesn't blank, but drop them
once the stored connectionStatus crosses its failure threshold to error/disconnected
— so the shared aggregate the workflow editor consumes stops offering a dead
server's stale tool schemas.
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.

1 participant