Repository navigation
Description
What happened?
upstream_servers with operation=list can report a false OAuth sign-in requirement for an upstream that already has a valid stored token. The CLI/runtime health projection reports that same upstream as healthy.
The synthetic reproduction gives these outputs for an enabled server in Ready with one callable tool and a token expiring in 48 hours:
| Surface | Summary | Status | Usable |
|---|---|---|---|
Runtime.GetAllServers (CLI/management projection) |
Connected (1 tool) |
ready |
true |
MCP upstream_servers/list |
Authentication required |
sign_in_required |
false |
This was observed with v0.70.0 personal on macOS arm64 and reproduced independently on upstream main at f2e58df33724dca64c064ffd229bb8455442ad41. The installed app build was modified, so the source-level reproduction is the reproducible evidence rather than a claim of byte-identical release behavior.
Expected behavior
The MCP listing should use the same canonical OAuth/health state as the runtime. A valid token should not require a new sign-in. Missing/expired tokens, OAuth failures, explicit logout and effective authentication rejection must continue to produce an unusable/sign-in-required state. Disabled and quarantined servers must remain unavailable.
Reproduction
- Create a runtime backed by a temporary directory, without starting its supervisor or connecting to external services.
- Persist an enabled HTTP server with an explicit empty OAuth config and a synthetic
OAuthTokenRecord, usingoauth.GenerateServerKey(name, url)and an expiry 48 hours in the future. - Add the managed client with
AddServerConfig(noConnect), transition its state toReady, and seed the matching StateView entry with one callable tool. - Compare
Runtime.GetAllServers()with the real MCPhandleUpstreamServersdispatcher usingoperation=list. - The runtime returns
ready/usable=true; the MCP listing returnssign_in_required/usable=false.
The accompanying regression uses .invalid URLs, synthetic tokens and temporary storage only. It does not require a real OAuth provider or any operator credentials.
Cause
handleListUpstreams passes OAuthRequired to the health calculator but omits OAuthStatus and token-expiry/refresh metadata. The calculator treats empty OAuth status as a sign-in requirement. Runtime.GetAllServers supplies the canonical state.
This is separate from #1172, which covers stale OAuth records after switching to static header authentication, and from tool-search/annotation filtering. Those behaviors do not need to change to fix this projection.
Checks
- Searched existing issues and PRs; no duplicate of this MCP/runtime projection divergence found.
- Confirmed a failing synthetic regression on the unmodified upstream production code.
- No real tokens, private endpoints, accounts or logs are included.
Activity
fix(server): use canonical OAuth health in MCP upstream list (#1525)
fix(server): use canonical OAuth health in REST server list and diagn…