Repository navigation
Description
Summary
Codex desktop app cannot connect to a local Streamable HTTP MCP server on macOS in my environment.
stdioMCP servers work- the same local HTTP MCP servers work with direct local requests
- but Codex reports a handshake / decode failure and appears unable to use the local HTTP server reliably
I tested both:
- a real Godot MCP server
- a minimal standalone MCP server using the official
@modelcontextprotocol/sdkStreamable HTTP transport
Both servers worked when tested locally outside Codex, but Codex still failed to use them.
Environment
- Codex desktop app on macOS
- local MCP server URL:
http://localhost:8765/mcp - also tested with a minimal server at
http://localhost:8766/mcp
What I tested
A. Real local server
I built a local Godot MCP server using official MCP Streamable HTTP transport and exposed it on:
http://localhost:8765/mcp
The server:
- accepted
initialize - returned a valid
mcp-session-id - handled
notifications/initialized - returned valid JSON for
resources/list - returned valid JSON for
resources/read
B. Minimal standalone server
To rule out my app-specific code, I created a minimal MCP HTTP server using the official SDK only:
- one
pingtool - one fixed
test://statusresource - no Godot integration
This minimal server also worked correctly with direct local requests.
Reproduction
- Start a local Streamable HTTP MCP server on macOS, for example:
http://localhost:8766/mcp
- Add it to Codex as a
Streamable HTTPMCP server - Restart Codex
- Try to list resources or use the server
Expected behavior
Codex should connect and successfully list resources / call tools from the local HTTP MCP server.
Actual behavior
Codex fails to use the server and reports errors such as:
handshaking with MCP server failedUnexpected content type: None- later, in some cases,
error decoding response body
Important finding
The same server works outside Codex.
I verified locally that:
initializesucceedsresources/listsucceedsresources/readsucceeds- responses are valid
application/json - session IDs are returned correctly
I also observed that when Codex attempts to connect, behavior does not match the successful direct local requests, and in some cases the local server does not receive the expected request sequence at all.
This suggests the issue is likely in Codex's local Streamable HTTP MCP client path, not in the tested local servers.
Minimal validation details
For the minimal test server:
- direct local POST
initializereturned200 - direct local POST
resources/listreturned valid JSON - direct local POST
resources/readreturned valid JSON
For the real server:
- same result with valid initialization and resource responses
Question
Is there any known limitation or bug in Codex desktop app for local Streamable HTTP MCP servers on macOS, especially with localhost / loopback connections?
Activity
github-actions commentedon Mar 8, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
a11e1e commentedon Mar 20, 2026
This may be a macOS system proxy / Clash issue.
In my case, Codex was sending
http://127.0.0.1:3000/mcpthrough the local system proxy (127.0.0.1:7897) instead of connecting directly to the local MCP server.CrytisMT commentedon Mar 26, 2026
do you fix it ?
eliotcougar commentedon Jun 27, 2026
Strangely, changing from
http://127.0.0.1:3000/mcptohttp://localhost:3000/mcpmade the Godot AI MCP tools discoverable in Codex…Tsahao commentedon Oct 16, 2026
Adding a macOS reproduction involving Shadowrocket and Codex CLI's app-server used by T3 Code. This appears related to the system-proxy/loopback behavior discussed above, although the exact underlying cause has not been confirmed.
Environment
0.1.1-nightly.20261016.31902.2.92, build3445127.0.0.1:1082http://127.0.0.1:3773/mcpReproduction and provider comparison
Normal Codex conversation continues working while the local T3 MCP tools are unavailable. Switching T3 to the retained Codex 0.162.1 binary and restarting did not resolve the failure, so this is not specific to 0.163.0.
Diagnostics
T3 Nightly itself owns the listening MCP endpoint.
A direct, unauthenticated request reaches it and returns
401 Unauthorized, as expected without credentials:curl --noproxy '*' -i http://127.0.0.1:3773/mcpExplicitly routing that request through Shadowrocket's HTTP proxy fails with
curl: (52) Empty reply from server:curl --noproxy '' --proxy http://127.0.0.1:1082 -i http://127.0.0.1:3773/mcpThe effective macOS proxy bypass list (
scutil --proxy) includeslocalhostbut omits127.0.0.1.An isolated Codex app-server diagnostic using
http://localhost:3773/mcpalso failed at the HTTP transport stage, so changing the hostname was not a verified workaround here. That diagnostic used a deliberately invalid token and was only testing transport reachability.Abridged error excerpts:
Subsequent log:
The proxy on/off and Codex/OpenCode comparisons suggest a difference in HTTP-client or system-proxy handling. We have not captured Codex's actual network route, so this does not establish whether the defect is in Codex, T3's integration, or Shadowrocket, nor whether the missing bypass entry alone explains it.
Could maintainers investigate loopback routing and proxy-bypass handling for MCP HTTP requests? Logging the selected direct/proxy route and the underlying transport error would make this much easier to diagnose.
Prepared and posted by my Codex assistant with my authorization.
tomcaokol-glitch commentedon Nov 26, 2026
Additional macOS reproduction with Codex CLI 0.172.0 and T3 Code Beta 0.1.12. The effective macOS proxy exceptions already included both
localhostand127.0.0.1.initializewith HTTP 502 fort3-code,t3-code-direct, and a separate local Streamable HTTP server (ai-memory).ai-memoryinitialize request returned HTTP 200 when sent directly and HTTP 502 when explicitly routed through the configured local HTTP proxy. An unauthenticated probe of the T3 MCP endpoint reached it directly (HTTP 401) and returned 502 through the proxy.app-serverand the same macOS system proxy settings,mcpServerStatus/listreturned zeroai-memorytools with the proxy environment variables cleared. Adding onlyNO_PROXYandno_proxy, both set tolocalhost,127.0.0.1,::1, restored all 23 tools.ai-memorystatus calls.The standalone comparison isolates the effect of the environment bypass without T3 in the launch path. Could you check whether the MCP HTTP client honors macOS system proxy exceptions for loopback URLs when
NO_PROXYis unset?