MCP Oauth failes via CLI but works with the Desktop app
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.144.5
What subscription do you have?
Pro
Which model were you using?
gpt-5.6
What platform is your computer?
Darwin 25.3.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
No response
What issue are you seeing?
Trying to authenticate an OAuth 2.0 MCP server works perfectly fine when attempting via the Desktop app but fails in the CLI.
In both the OAuth redirect screen opens, but after approving the CLI shows:
Error: failed to handle OAuth callback
Caused by:
Authorization server response missing required issuer: expected https://clerk.getswan.com
What steps can reproduce the bug?
I can't provide a mock user to our production user to produce exactly, but the order of actions was:
- codex mcp add swan-test-auth --url https://mcp.getswan.com/mcp/org/
- codex mcp login swan-test-auth
- approved the oauth in the browswer
- the browser window shows:
Authentication complete. You may close this window. - the terminal then shows the
Authorization server response missing required issuer...message
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
Start with the codex mcp add and codex mcp login CLI flow, focusing on OAuth callback handling after approval. Compare the CLI behavior with the Desktop app's successful authentication and investigate why the callback reports a missing issuer for https://mcp.getswan.com/mcp/org/<id>. Done means the CLI completes authentication without the issuer error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- authentication, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100