Skip to main content
Watch: I Built an AI App Without Leaving Databricks

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

  • Maintainer gpeal (#6020): the reported failures were either unsupported SSE servers or incorrect configuration.
  • Maintainer gpeal: "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 (gpeal 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 (maintainer gpeal 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 (gpeal 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.