MCP OAuth login does not persist across Codex restarts; remote MCP startup incomplete
Open 💬 10 comments Opened Mar 19, 2026 by petabook
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
0.115.0
What subscription do you have?
Business
Which model were you using?
gpt-5.4
What platform is your computer?
Darwin 25.2.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
ghostty
What issue are you seeing?
Title: MCP OAuth login does not persist across Codex restarts; remote MCP startup incomplete
Summary
After successfully authenticating an OAuth-based MCP server with codex mcp login asana, starting a new Codex session reports:
The asana MCP server is not logged in. Run codex mcp login asana.
At the same time, other configured MCP servers fail during startup/handshake.
Environment
- Codex CLI version:
0.115.0 - Install path:
/opt/homebrew/bin/codex - OS: macOS
- HOME:
/Users/snd - CODEX_HOME: unset
- Config path:
~/.codex/config.toml - Auth cache path:
~/.codex/auth.json
Config
model = "gpt-5.4"
[mcp_servers.asana]
url = "https://mcp.asana.com/v2/mcp"
[mcp_servers.sentry]
url = "https://mcp.sentry.dev/mcp"
[mcp_servers.newrelic]
url = "https://mcp.newrelic.com/mcp/"
### What steps can reproduce the bug?
Configure remote MCP servers in `~/.codex/config.toml`
Run `codex mcp login asana`
Complete OAuth successfully
Start Codex with `codex`
### What is the expected behavior?
Codex should reuse the stored OAuth session and start with the Asana MCP server authenticated.
### Additional information
⚠ MCP client for `newrelic` failed to start: MCP startup failed: handshaking with MCP server failed: Send message error Transport ... error decoding response body, when send initialize request
⚠ MCP startup incomplete (failed: asana, newrelic)
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I have the same issue as well codex MCP tokens do not persist after restarts
Additional findings from local debugging on the same machine (
0.115.0, macOS arm64):asanais configured correctly and new Codex sessions are initializing all configured MCP servers successfully. In my local logs, fresh sessions after the OAuth flow showsession_init.enabled_mcp_server_count=4, so this no longer looks like an Asana startup/handshake failure during session init.The failure happens later, when Codex actually tries to use the Asana MCP. A fresh
codex execrun reproduced the low-level transport/auth error from the Asana server:That same run then reported no Asana tools available.
A few related signals:
codex mcp login asanacan complete successfully.codex mcp list --jsonstill reportsasanawith"auth_status": "unsupported".codex mcp get asana --jsonshows only the raw MCP URL and no bearer token env var / tool restriction config.failed to start/ initialize errors for Asana in the main Codex log, even though the model still cannot use any Asana tools.This makes the bug look more specific than “OAuth login does not persist”: Codex appears to be reaching
https://mcp.asana.com/v2/mcp, but when it authenticates requests it is sending a token that Asana rejects as not being Asana-issued OAuth. In other words, the MCP server is configured and counted during init, but Asana tools never become callable because the runtime auth handoff is wrong.If useful, I can add exact local commands / outputs as a tighter repro.
I’ve experienced the same thing with the MCP I use for WordPress.
In my case, the MCP had clearly lost authentication, but there didn’t seem to be any way to reauthenticate the existing connection in place. There was no obvious reconnect or sign-in-again option, so it stayed configured but was no longer usable.
The only way I was able to get it working again was to remove the MCP completely and set it up again from scratch. That forced the auth flow to run properly and restored access.
So the problem, at least from what I saw, wasn’t that reauthentication failed. It was that once the existing connection had fallen out of a valid auth state, there didn’t seem to be any proper reauthentication path at all.
Still reproduces on
codex-cli 0.125.0with the same Asana config (https://mcp.asana.com/v2/mcp).Current findings:
codex mcp list --jsonshowsasanaenabled, butauth_status: "unsupported".codex execprobe fails when the Asana MCP transport authenticates:The probe then returns
NO_ASANA_TOOLS.Diagnosis: Codex reaches Asana MCP, but does not present an Asana-issued OAuth token, so Asana rejects the request and no Asana tools are exposed.
Note: works in
Claude-code.Asana’s official MCP Server URL https://mcp.asana.com/v2/mcp has a login persistence issue with Codex — login works, but Codex shows you as logged out after restart.
Switching the MCP URL to https://mcp.asana.com/mcp fixes it.
Also related: https://github.com/openai/codex/issues/17265
It may help to split the visible auth state into more than “logged in / unsupported / invalid token.” Remote MCP auth failures can come from different layers that require different fixes.
A more actionable state taxonomy might be:
The current user experience collapses several of these into “invalid token,” which makes it hard to tell whether the token was never written, written to the wrong store, not reloaded after restart, or rejected by the MCP server.
For privacy, the diagnostic does not need token contents. It only needs store type/path bucket, connector name, timestamp, and the last successful transition. That would make remote MCP auth bugs much easier to compare across Asana, Notion, Linear, and custom servers.
Same issue here. The same MCP server auth persists across Claude Code sessions but do not persist across Codex sessions, suggesting it is a Codex issue instead of the server issue.
experiencing the same issue in v0.144.5 as described when wanting to use the Youtrack MCP Server via oAuth. You can try it yourself with a free youtrack cloud instance