openai / openai/codex

MCP status panel shows "Auth unsupported" when an OAuth refresh fails and re-login is needed

Open
#40,218 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app app-server auth bug mcp
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

I have a remote MCP server configured over OAuth in ~/.codex/config.toml. After the access token expired and the refresh got rejected, the composer's MCP status panel started showing it as "Enabled / Auth unsupported".

That label sent me the wrong way for a while. The server supports OAuth fine and had been authenticated minutes earlier. All that actually happened is the stored refresh token stopped being valid and I needed to sign in again. But "Auth unsupported" reads like the server cannot do auth at all, so I went looking at the server instead of just re-running login.

codex mcp list reported the same server as Auth: OAuth at the same moment, so the CLI and the desktop app disagree about the state.

What seems to be happening

McpAuthStatus has five values. From codex app-server generate-json-schema --out DIR, see v2/ListMcpServerStatusResponse.json:

unknown | unsupported | notLoggedIn | bearerToken | oAuth

The desktop label function collapses two of them into one string:

case `unknown`:
case `unsupported`:
  return "Auth unsupported"   // composer.mcpStatus.authUnsupportedNoAuth

So unknown, which covers "not resolved yet" and the state after a failed refresh, looks identical to a stdio server that genuinely has no auth mechanism. The row is also rendered with disabled: true, so there is no way to re-authenticate from the panel.

The app-server already knows the right answer

It logs the actionable diagnosis, it just never reaches the UI:

WARN  MCP OAuth refresh token was rejected; reauthorization required
      error=OAuth refresh token was rejected: Server returned error response: invalid_grant
ERROR failed to refresh OAuth tokens for server <server>

codex mcp login <server> fixes it in a few seconds. There is no way to work that out from what is on screen.

Steps to reproduce
  1. Add a remote MCP server that requires OAuth to ~/.codex/config.toml, then run codex mcp login <server>.
  2. Let the access token expire, or invalidate the refresh token server side.
  3. Open the MCP status panel in the composer.

Expected: something like "Not authenticated, sign in".
Actual: "Enabled / Auth unsupported".

You can also see it without the UI by driving codex app-server over stdio: send initialize, then the initialized notification, then mcpServerStatus/list, and read result.data[].authStatus.

One caution if you script that: each mcpServerStatus/list call can trigger a token refresh. If you poll it in a tight loop against a server that rotates refresh tokens, the concurrent requests can look like token replay and get the grant revoked. Poll once and wait.

Suggested fix

Give unknown its own label, something like "Checking...", and surface the reauthorization-required case as an actionable "sign in again" state rather than folding it into unsupported.

Environment

Codex Desktop 26.818.41509, codex-cli 0.149.0-alpha.4.1, macOS 15 (Darwin 25.5.0).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the composer MCP status label function and v2/ListMcpServerStatusResponse.json, then inspect the mcpServerStatus/list flow and the app-server OAuth refresh warnings. Verify how unknown, unsupported, and reauthorization-required states reach the panel. Done means refresh failure is distinguishable from unsupported authentication and the panel presents a usable sign-in path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rust
Domain
authentication, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.