Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.156.1 (Windows x64, standalone installation). The immediately previous official Windows release, 0.155.0, works with the same MCP server and configuration.
What subscription do you have?
Not specified. The failure occurs during MCP OAuth metadata discovery, before any model request.
Which model were you using?
Not applicable; this is reproducible with codex mcp login.
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64 (Windows 11 Professional), native Windows CLI.
What terminal emulator and version are you using (if applicable)?
Windows Terminal, PowerShell.
Codex doctor report
codex doctor --json reports the standalone installation and MCP configuration as locally consistent, with no proxy environment variables configured. The full report is omitted because it contains local filesystem paths and account-state details.
What issue are you seeing?
On native Windows, codex mcp login <server> fails before opening the OAuth authorization page:
Error: Metadata error: OAuth metadata discovery failed for https://<mcp-host>/mcp
Caused by: HTTP request failed: error decoding response body
The MCP server is configured as Streamable HTTP. Its protected-resource metadata endpoint and the Entra OIDC discovery endpoint both return HTTP 200 with valid JSON when fetched using curl.exe. The same failure occurs when invoking codex mcp login directly, so it is not caused by the PowerShell installer wrapper. The saved MCP URL and requested scope are correct, and no proxy is configured.
What steps can reproduce the bug?
- On native Windows x64, install Codex CLI 0.156.1 and configure a Streamable HTTP MCP server at
https://<mcp-host>/mcpthat responds to unauthenticated requests with HTTP 401 and a validWWW-Authenticate: Bearer resource_metadata="https://<mcp-host>/.well-known/oauth-protected-resource/mcp"challenge. - Confirm that the advertised protected-resource metadata URL returns a valid JSON document pointing to a valid OAuth/OIDC authorization server metadata document.
- Run
codex mcp login <server>. - Observe the metadata discovery error above.
This was also reproduced with a local loopback mock server. Codex 0.156.1 on Windows sent the initial GET to /mcp, then failed with error decoding response body without requesting the advertised /.well-known/oauth-protected-resource/... document. The same failure occurred when the 401 body was empty and when the response included Connection: close.
Cross-checks:
- Codex CLI 0.156.1 on Ubuntu under WSL, with the same MCP URL, scopes, and client ID, completed OAuth login successfully.
- The official Codex CLI 0.155.0 Windows executable, with the same Windows MCP configuration and server, completed OAuth login and loaded all 5 MCP tools.
- Windows Codex 0.156.1 fails both from the PowerShell installer and from a direct
codex mcp logininvocation. - The previously reported generic metadata-discovery issue #5953 is closed and does not describe this Windows 0.156.1 versus 0.155.0/WSL regression.
What is the expected behavior?
Codex should read the 401 challenge, fetch the advertised protected-resource metadata and authorization-server metadata, and continue the OAuth login flow, as it does on WSL 0.156.1 and native Windows 0.155.0.
Additional information
The evidence points to a Windows-specific failure while reading the initial 401 response body during OAuth metadata discovery. The issue is reproducible without contacting the production MCP server, so it does not appear to depend on the server's metadata contents, Entra, or the installer.
Activity
HJN-Reiten commentedon Oct 28, 2026
Additional Windows reproduction, observed on 2026-10-28.
I submitted the full diagnostic report through ChatGPT feedback.
Feedback ID:
f3320971-b8e0-49c3-8972-c7ac655ee465Environment:
10.0.26300.0, x64codex-cli 0.165.0-alpha.1.2streamable_httphttps://www.capcut.com/api/external_mcp0.2.6Reproduction:
fails before any OAuth browser page opens:
Exit code:
1.The same failure had previously occurred with
codex-cli 0.164.0-alpha.11.1. After an official ChatGPT Windows app update, the bundled/local CLI changed to0.165.0-alpha.1.2, but the OAuth discovery error remained reproducible.Important control result: the complete OAuth discovery chain is independently readable with native Windows
curl.exeusing Schannel:401withWWW-Authenticateandresource_metadata.S256, authorization endpoint, token endpoint and registration endpoint are present.There are no HTTP/HTTPS proxy environment variables in the tested process and WinHTTP reports direct access.
Norton HTTPS inspection is active on this machine and re-signs TLS traffic. However, the complete CapCut OAuth metadata responses are successfully transferred and parsed by Windows
curl.exe, so HTTPS inspection is confirmed but has not been demonstrated to corrupt these responses.Local Codex logs contain:
but do not expose which individual metadata request fails internally, its HTTP status, or the deeper reqwest/hyper decoding cause.
The failure was also reproduced from a newly created, confirmed local Windows Codex session after the latest ChatGPT app update, so it is not limited to an older Work chat or cloud/Linux execution environment.
Could the maintainers please correlate this with feedback ID
f3320971-b8e0-49c3-8972-c7ac655ee465and advise whether this is the same Windows MCP/OAuth response-decoding path as reported in #47756?No credentials, OAuth tokens, or private media were involved.
2440-pon commentedon Nov 12, 2026
I reproduced this on Windows with Codex CLI 0.167.0-alpha.4.1 and Home Assistant MCP. Both OAuth discovery and bearer-token MCP initialization fail with error decoding response body. On the same machine, PowerShell successfully initializes the same MCP endpoint with the same token (HTTP 200) and calls a read-only tool.
Feedback thread ID: 01a1d1d9-aa02-73c3-8df3-ede1e17f23a2 (no logs uploaded).
SholaOgunde commentedon Nov 16, 2026
Potential Workaround
I had a similar issue using Figma MCP with Codex Desktop and ChatGPT helped me troubleshoot it.
Workaround for Norton 360 Premium
Open Norton 360.
If HTTPS scanning is set,
Adding one server is not enough. All related endpoints need to be added. I got ChatGPT to help me discover which endpoints were used as part of the process - using the following standard commands
Mateus2431 commentedon Nov 16, 2026
Additional reproduction on Windows with VS Code Codex extension 26.51111.21308 (codex-cli 0.169.0-alpha.11.1) and the official Trello MCP endpoint https://mcp.trello.com/v1. Running codex mcp login trello fails before browser authorization:
Metadata error: OAuth metadata discovery failed for https://mcp.trello.com/v1
Caused by: HTTP request failed: error decoding response body
The MCP endpoint returns the expected HTTP 401 with WWW-Authenticate pointing to its protected-resource metadata. Windows curl.exe reads that metadata as HTTP 200 valid JSON, and independently reads the advertised Atlassian authorization-server metadata as HTTP 200 valid JSON. Both were tested without disabling TLS verification. Reinstalling the same current pre-release extension did not change the error. No Trello cards were written. This looks similar to the Windows OAuth response-decoding path reported here; the exact cause on this machine has not been established. Please advise on a targeted diagnostic or supported workaround.
MysticalFive33 commentedon Nov 20, 2026
Additional reproduction: CapCut 0.3.1 on current Windows Codex Desktop
Observed on 2026-11-19 at approximately 19:00 (America/Mexico_City).
Environment:
26200.9974, x6426.1111.9664.026.1111.71704codex-cli 0.169.1CapCut@CapCut 0.3.1, installed, enabled, and not modified or reinstalledcapcut_creationhttps://www.capcut.com/api/external_mcpThe official plugin runbook requires its bundled
capcut-login.mjshelper. The helper exits before any OAuth authorization page or URL is generated:The connection checker reports
status=unknown,reason=connection_not_confirmed; protected tools remain unavailable.Checks completed:
HTTP_PROXY,HTTPS_PROXY, andCODEX_CA_CERTIFICATEare not defined./.well-known/oauth-protected-resource/api/external_mcpreturns HTTP 200, gzip-encoded valid JSON./.well-known/oauth-authorization-server/api/external_mcp/oauthreturns HTTP 200, gzip-encoded valid JSON; the issuer matches and the authorization, token, and registration endpoints are present.This failure occurs before client registration and before an authorization URL is produced, so it is earlier than the duplicate-
resource/unknown clientflow discussed in #58808.Expected behavior: Codex should complete metadata discovery, open the CapCut authorization page, and make the protected MCP tools available.
Feedback/session ID for correlation:
01a1f65e-b2fc-78f1-8f4f-9ff145a3f8ab.Could maintainers correlate this feedback session and expose the nested HTTP/decompression cause currently collapsed into
error decoding response body? No credentials, OAuth tokens, callback URLs, or private media are included.