MCP OAuth succeeds but Espressif Documentation server returns HTTP 403 during initialize
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?
codex-cli 0.150.0-alpha.12.2 (Codex Desktop 26.825.3734.0)
What subscription do you have?
API key
Which model were you using?
gpt-5.6-sol
What platform is your computer?
Microsoft Windows 10.0.26200 x64 (Windows 11 ProfessionalWorkstation)
What terminal emulator and version are you using (if applicable)?
Codex Desktop with PowerShell 7.6.5. This reproduces in a fresh CLI process on native Windows, not WSL.
Codex doctor report
Relevant results from codex doctor:
- MCP configuration is locally consistent.
- The server is configured as streamable HTTP.
- Network environment is readable; no proxy environment variables are set.
- Provider HTTP reachability succeeds.
- Codex Desktop app-server handshake succeeds.
The full report contains unrelated local paths and private-network endpoint information, so it is not included here.
What issue are you seeing?
OAuth for the Espressif Documentation remote MCP server completes successfully in the browser, and codex mcp login reports success. However, a fresh Codex process fails when sending the MCP initialize request:
MCP client for `espressif-documentation` failed to start:
HTTP 403: {"error":{"code":"403","message":"Forbidden","id":"hnd1::q4pmn-1787899236531-b4965e4cbded"}}
Configuration:
[mcp_servers.espressif-documentation]
url = "https://mcp.espressif.com/docs"
codex mcp get reports the server as enabled with streamable_http transport and no custom headers.
Two other Espressif MCP endpoints work in equivalent smoke tests:
- ESP Component Registry: https://components.espressif.com/mcp
- Espressif Engineering: https://ts-mcp.espressif.com/mcp
Only the OAuth-protected documentation endpoint fails.
What steps can reproduce the bug?
- Configure the server shown above.
- Run codex mcp logout espressif-documentation to clear any stale OAuth state.
- Run codex mcp login espressif-documentation.
- Complete GitHub authentication in the browser. The browser and CLI both report successful authentication.
- Start a fresh codex exec process that loads the MCP server.
- Observe that the initialize request receives HTTP 403 before any documentation tools are exposed.
- Repeat logout/login and start another fresh process; the result is unchanged.
What is the expected behavior?
After a successful OAuth login, Codex should initialize the MCP server and expose its documentation tools.
If the server is returning 403 because the token lacks a required scope, Codex should inspect the WWW-Authenticate response and perform OAuth step-up authentication, or at minimum report the required scope.
Additional information
Espressif's official discussion for this server is:
That discussion contains a WSL callback-routing report, but this reproduction is different: the OAuth callback succeeds on native Windows and the failure occurs afterward during MCP initialization.
Related Codex issues, but neither is an exact duplicate:
- #20518 tracks missing OAuth step-up handling for 403 insufficient_scope. This may be related if the Espressif response contains that WWW-Authenticate error, but the visible JSON body here only says Forbidden.
- #20513 tracks error reporting for non-2xx MCP responses. The current version already surfaces the actual HTTP 403, so the remaining failure is authentication/authorization rather than deserialization.
- #33151 concerns an OpenAI connector callback returning 403 after browser OAuth, not a remote MCP server rejecting initialize.
An authenticated GitHub search found no existing issue or comment containing both the exact endpoint and Forbidden/HTTP 403.
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 by reproducing the fresh Codex CLI process against https://mcp.espressif.com/docs after codex mcp logout and login, then inspect the MCP initialize response and any WWW-Authenticate header. Compare the behavior with the related OAuth step-up issue; done means the authenticated server initializes successfully or the required scope is reported and the appropriate authentication flow is triggered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, rust
- Domain
- api, authentication, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100