[Windows][MCP OAuth] Fresh startup requires reauthentication despite valid file-stored credentials
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of Codex CLI is running?
0.153.4
What subscription do you have?
ChatGPT Plus
Which model were you using?
gpt-5.6-sol high
What platform is your computer?
Windows x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal
Codex doctor report
What issue are you seeing?
codex mcp login mfc_ca succeeds and OAuth credentials are correctly stored in %USERPROFILE%\.codex\.credentials.json.
I verified without exposing token values that the stored credential has:
- the correct MCP server URL
- issuer
- access token
- refresh token
- an expiration time in the future
- read-only Money Forward scopes
However, every fresh Codex CLI startup reports:
The mfc_ca MCP server requires OAuth reauthentication.
MCP startup incomplete (failed: mfc_ca)
The issue also reproduces with Codex 0.154.0-alpha.3 and with features.mcp_2026_07_28=true.
What steps can reproduce the bug?
- Configure a remote Streamable HTTP MCP server using OAuth.
- Set
mcp_oauth_credentials_store = "file". - Run
codex mcp logout mfc_ca. - Run
codex mcp login mfc_ca. - Complete OAuth successfully in the browser.
- Confirm that the OAuth credential is stored and still unexpired.
- Start a fresh Codex CLI session.
- Codex immediately asks for OAuth reauthentication again.
What is the expected behavior?
No response
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the flow with codex mcp logout mfc_ca, codex mcp login mfc_ca, and a fresh startup, then inspect the credentials in %USERPROFILE%\.codex\.credentials.json. Verify how the fresh session handles the unexpired file-stored OAuth credential on Windows; done means it starts the MCP server without requesting reauthentication.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- authentication, cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100