Skip to content

[Bug]: MCP upstream list reports sign-in required with a valid OAuth token #1522

Closed

Description

@neylwalecki

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

  1. Create a runtime backed by a temporary directory, without starting its supervisor or connecting to external services.
  2. Persist an enabled HTTP server with an explicit empty OAuth config and a synthetic OAuthTokenRecord, using oauth.GenerateServerKey(name, url) and an expiry 48 hours in the future.
  3. Add the managed client with AddServerConfig (no Connect), transition its state to Ready, and seed the matching StateView entry with one callable tool.
  4. Compare Runtime.GetAllServers() with the real MCP handleUpstreamServers dispatcher using operation=list.
  5. The runtime returns ready/usable=true; the MCP listing returns sign_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

  1. added a commit that references this issue on Oct 6, 2026
    44244b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions