Skip to content

Mark rejected MCP credentials as needing re-authentication - #965

Merged
fazxes merged 2 commits into
mainfrom
fazxes/mcp-reauth-status
Sep 20, 2026
Merged

fazxes merged 2 commits into
mainfrom
fazxes/mcp-reauth-status

Conversation

@fazxes

@fazxes fazxes commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • A server whose stored OAuth credentials are rejected at refresh now reports status=needs_auth / auth=required with the /mcp auth <name> --open hint, instead of showing failed while still claiming auth=authenticated.
  • The same marking applies when credentials expire with no refresh token.
  • The startup notice, /mcp list, the menu, the trace report, capability search, and the model's server catalog all pick up the re-authentication state through the shared classifier.
  • Rejected credentials stay installed until a successful re-auth replaces them; nothing is deleted from the credential store.

Stacked on #963.

@fazxes fazxes added the type: bug Fixes incorrect behavior label Sep 19, 2026
@fazxes
fazxes marked this pull request as ready for review September 19, 2026 19:04
@fazxes
fazxes force-pushed the fazxes/mcp-startup-notice branch from 4b21d22 to a09f9a6 Compare September 20, 2026 02:53
A server whose stored OAuth credentials fail refresh was left claiming
auth=authenticated while the connection failed, so every surface reported
it as a generic failure with no path forward. When the token endpoint
rejects the refresh (or credentials expire with no refresh token), flip
the challenge and credential flags so the shared classifier reports
needs_auth everywhere: the list view and menu offer /mcp auth, capability
search emits its authentication guidance, the startup notice names the
server, and the model catalog stops calling it ready. The rejected
credentials stay installed until a successful re-auth replaces them.

Extend the expired-refresh e2e to assert the re-authentication
classification in fx mcp list output.
McpRefreshRejected now fires only when the token endpoint answers 400 with
invalid_grant; 429 and 5xx map to a transient McpRefreshUnavailable that
fails the attempt without flipping the server to needs_auth. The mark
itself is generation-guarded so a concurrent successful refresh is never
overwritten by a stale rejection, and installing usable credentials clears
the challenge flag so a recovered server stops asking for re-auth.
@fazxes
fazxes force-pushed the fazxes/mcp-reauth-status branch from 02cb406 to d6a1cc0 Compare September 20, 2026 03:27
@fazxes
fazxes changed the base branch from fazxes/mcp-startup-notice to main September 20, 2026 03:27
@fazxes
fazxes merged commit 14484ea into main Sep 20, 2026
71 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Fixes incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant