openai / openai/codex

macOS: `codex mcp login` can print OAuth URL without surfacing a browser window

Open
#38,938 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auth bug CLI mcp
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

Summary

On macOS, codex mcp login <server> can print the OAuth authorization URL and wait for the loopback callback, but no browser window/tab becomes visible. The command does not print the documented fallback (Browser launch failed; please copy the URL above manually.), so the client appears to believe browser launch succeeded.

This creates a high-friction MCP OAuth flow: users think the command is stuck until they manually copy the one-time URL into a browser.

Environment
  • macOS 26.5.1 (arm64)
  • codex-cli 0.148.0-alpha.9 from the Codex desktop bundle
Reproduction
  1. Configure an OAuth-capable remote MCP server.
  2. Run codex mcp login <server> --scopes <scopes>.
  3. Observe that the terminal prints Authorize <server> by opening this URL in your browser: and waits.
  4. No browser window/tab is brought forward.
  5. Manually opening the printed URL completes OAuth and reaches the local callback successfully.
Expected

The authorization page should be visibly opened in the user's default browser, or the CLI should reliably report that opening it failed and make the manual next step explicit.

Notes

Current source calls webbrowser::open(auth_url) after printing the URL, but this observed path appears to return success without making a browser tab visible. No OAuth URL, code, state, or account data is included here.

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 by locating the macOS MCP login path that calls webbrowser::open(auth_url) after printing the authorization URL. Reproduce codex mcp login <server> --scopes <scopes> on macOS and compare the browser-launch result with the visible fallback message. Done means the authorization page is visibly opened, or a failed launch reliably reports the manual URL step.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.