Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/mcp/auth/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Per-user auth applies to the **HTTP** and **SSE** connection types. STDIO connec

Per-user auth requires every request to carry an identity. See [Identity modes](#identity-modes) below.

Connection-state semantics (`connected`, `disconnected`, `error`, `needs_reauth`, etc., shown on the MCP client list) describe a persistent upstream connection, so they only apply to server-level clients. Per-user clients are stateless by design: each tool call resolves and uses the caller's credential on its own, with nothing held open between calls, so the dashboard links a per-user client to its [MCP Sessions](../sessions) rows instead of showing a connection state for it.

---

## Pick your auth type
Expand Down
4 changes: 3 additions & 1 deletion ui/app/workspace/mcp-registry/views/mcpClientSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ export default function MCPClientSheet({
? mcpClient.config.auth_type === "per_user_oauth"
? "This client was declared in config.json. A one-time admin test login is needed to verify the OAuth setup and discover tools — each user will authenticate individually afterward."
: "This client was declared in config.json and needs a one-time OAuth authorization before it can be used."
: "MCP server configuration and available tools"}
: mcpClient.state === "needs_reauth"
? "This connection's credentials have expired and need to be re-authorized. Re-authorization from the dashboard isn't available yet: recreating this client is the current workaround."
: "MCP server configuration and available tools"}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
</SheetDescription>
</div>
<SheetNavigationButtons
Expand Down
20 changes: 17 additions & 3 deletions ui/app/workspace/mcp-registry/views/mcpClientsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function MCPClientActionsMenu({
{hasUpdateAccess && (
<DropdownMenuItem
className="cursor-pointer"
disabled={isPerUserAuth || client.config.disabled || isReconnecting || client.state === "pending_verification"}
disabled={isPerUserAuth || client.config.disabled || isReconnecting || client.state === "pending_verification" || client.state === "needs_reauth"}
onSelect={(e) => {
e.preventDefault();
onReconnect(client);
Expand Down Expand Up @@ -644,8 +644,22 @@ export default function MCPClientsTable({
"-"
)}
</TableCell>
<TableCell>
<Badge className={MCP_STATUS_COLORS[c.state]}>{c.state}</Badge>
<TableCell onClick={(e) => e.stopPropagation()}>
{isPerUserAuth ? (
// Per-user clients never hold a shared upstream connection, so a
// connection-state badge here would be misleading: point to the
// per-user sessions this client actually has instead.
<Link
to="/workspace/mcp-sessions"
search={{ mcp_client_id: [c.config.client_id] }}
className="text-primary text-xs font-medium hover:underline"
data-testid={`mcp-client-view-sessions-${c.config.client_id}`}
>
View sessions
</Link>
) : (
<Badge className={MCP_STATUS_COLORS[c.state]}>{c.state}</Badge>
)}
</TableCell>
<TableCell onClick={(e) => e.stopPropagation()}>
<Switch
Expand Down
4 changes: 4 additions & 0 deletions ui/lib/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export const MCP_STATUS_COLORS: Record<string, string> = {
pending_tools: "bg-yellow-100 text-yellow-800",
pending_verification: "bg-yellow-100 text-yellow-800",
disabled: "bg-orange-100 text-orange-800",
// Same red as `error`: the client's credential has died and it can't be
// used until a human reauthorizes it, mirroring the "destructive" treatment
// this status already gets on the MCP sessions table.
needs_reauth: "bg-red-100 text-red-800",
};

// Mapping of what IS supported by each base provider
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/types/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SecretVar } from "./schemas";

export type MCPConnectionType = "http" | "stdio" | "sse";

export type MCPConnectionState = "connected" | "disconnected" | "error" | "pending_tools" | "pending_verification" | "disabled";
export type MCPConnectionState = "connected" | "disconnected" | "error" | "pending_tools" | "pending_verification" | "disabled" | "needs_reauth";

export type MCPAuthType = "none" | "headers" | "oauth" | "per_user_oauth" | "per_user_headers";

Expand Down
Loading