Skip to main content
Watch: Grok Bot Built My AI Video Arena While I Tested 8 Models

OpenAI Codex CLI error

Codex CLI: MCP client for X failed to start: handshaking with MCP server failed...

Error message
MCP client for `X` failed to start: handshaking with MCP server failed: connection closed: initialize response

Status: OpenLast verified 3 documented fixes3 sources

What it means

Codex started or connected to the MCP server, but the connection closed before the server answered the MCP initialize request.

Causes

  • A contributor on #6020: the reported failures were either unsupported SSE servers or incorrect configuration.
  • A contributor: "Codex only supports streamable http servers. SSE is deprecated and we may or may not backport support."

How to fix it

  1. Fix 1.

    Point Codex at the server's streamable HTTP endpoint instead of an SSE endpoint (a contributor noted Linear's updated server is at https://mcp.linear.app/mcp).

    TOML
    [mcp_servers.linear]
    url = "https://mcp.linear.app/mcp"
  2. Fix 2.

    Run the server's command in a terminal outside Codex; it should start, appear to run without doing anything, show no errors and not exit on its own (a contributor on #6020).

  3. Fix 3.

    For servers that use OAuth, sign in separately (official MCP docs).

    Terminal
    codex mcp login <server-name>

More Codex CLI errors

All 14 Codex CLI errors

FAQ

What does "MCP client for X failed to start: handshaking with MCP server failed..." mean in Codex CLI?

Codex started or connected to the MCP server, but the connection closed before the server answered the MCP initialize request.

How do I fix "MCP client for X failed to start: handshaking with MCP server failed..."?

There are 3 documented fixes. Start with the first: Point Codex at the server's streamable HTTP endpoint instead of an SSE endpoint (a contributor noted Linear's updated server is at https://mcp.linear.app/mcp).

Is this Codex CLI error fixed?

Status: Open. Still open upstream. Any documented fixes are workarounds so far. Affected versions: Reported on codex-cli 0.53.0 (#6020)

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.