Skip to content

Codex desktop app cannot reliably connect to local Streamable HTTP MCP servers on macOS #13920

Open

Description

@niejiaqiang

Summary

Codex desktop app cannot connect to a local Streamable HTTP MCP server on macOS in my environment.

  • stdio MCP 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:

  1. a real Godot MCP server
  2. a minimal standalone MCP server using the official @modelcontextprotocol/sdk Streamable 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 ping tool
  • one fixed test://status resource
  • no Godot integration

This minimal server also worked correctly with direct local requests.

Reproduction

  1. Start a local Streamable HTTP MCP server on macOS, for example:
    • http://localhost:8766/mcp
  2. Add it to Codex as a Streamable HTTP MCP server
  3. Restart Codex
  4. 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 failed
  • Unexpected content type: None
  • later, in some cases, error decoding response body

Important finding

The same server works outside Codex.

I verified locally that:

  • initialize succeeds
  • resources/list succeeds
  • resources/read succeeds
  • 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 initialize returned 200
  • direct local POST resources/list returned valid JSON
  • direct local POST resources/read returned 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

  1. added
    bug
    app
    mcp
    on Mar 8, 2026
  2. a11e1e commented on Mar 20, 2026

    @a11e1e

    This may be a macOS system proxy / Clash issue.
    In my case, Codex was sending http://127.0.0.1:3000/mcp through the local system proxy (127.0.0.1:7897) instead of connecting directly to the local MCP server.

  3. CrytisMT commented on Mar 26, 2026

    @CrytisMT

    This may be a macOS system proxy / Clash issue. In my case, Codex was sending http://127.0.0.1:3000/mcp through the local system proxy (127.0.0.1:7897) instead of connecting directly to the local MCP server.

    do you fix it ?

  4. eliotcougar commented on Jun 27, 2026

    @eliotcougar

    Strangely, changing from http://127.0.0.1:3000/mcp to http://localhost:3000/mcp made the Godot AI MCP tools discoverable in Codex…

  5. Tsahao commented on Oct 16, 2026

    @Tsahao

    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

    • macOS 27.0.1, build 26A434; Apple Silicon
    • Codex CLI standalone: reproduced with both 0.162.1 and 0.163.0
    • T3 Code Nightly: 0.1.1-nightly.20261016.3190
    • Shadowrocket: 2.2.92, build 3445
    • System HTTP/HTTPS proxy: 127.0.0.1:1082
    • T3's local Streamable HTTP MCP endpoint: http://127.0.0.1:3773/mcp

    Reproduction and provider comparison

    1. Enable Shadowrocket's proxy.
    2. Use the Codex provider in T3 and start or resume a conversation.
    3. T3 orchestration/delegation tools are unavailable; Codex logs an MCP initialization failure.
    4. Disable Shadowrocket's proxy: Codex's T3 orchestration works again.
    5. With Shadowrocket enabled, the OpenCode provider in the same T3 environment can still use orchestration/delegation.

    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/mcp
    • Explicitly 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/mcp
    • The effective macOS proxy bypass list (scutil --proxy) includes localhost but omits 127.0.0.1.

    • An isolated Codex app-server diagnostic using http://localhost:3773/mcp also 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:

    MCP server startup failed server_name="t3-code"
    handshaking with MCP server failed
    http/request failed: error sending request for url (http://127.0.0.1:3773/mcp)
    

    Subsequent log:

    omitting MCP server without an exact ready client server_name=t3-code
    

    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.

  6. tomcaokol-glitch commented on Nov 26, 2026

    @tomcaokol-glitch

    Additional macOS reproduction with Codex CLI 0.172.0 and T3 Code Beta 0.1.12. The effective macOS proxy exceptions already included both localhost and 127.0.0.1.

    • With the default T3 desktop launch, fresh sessions consistently failed MCP initialize with HTTP 502 for t3-code, t3-code-direct, and a separate local Streamable HTTP server (ai-memory).
    • The same ai-memory initialize 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.
    • With the same Codex binary running as a standalone app-server and the same macOS system proxy settings, mcpServerStatus/list returned zero ai-memory tools with the proxy environment variables cleared. Adding only NO_PROXY and no_proxy, both set to localhost,127.0.0.1,::1, restored all 23 tools.
    • Fully quitting T3 and relaunching it with both variables set also restored successful T3 capability and ai-memory status 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_PROXY is unset?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

appbugmcpplugins

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions