Codex CLI MCP handshake timeout with Dart MCP server (dart mcp-server)

Resolved 💬 2 comments Opened Mar 6, 2026 by AlexeyKuznetsovGit Closed Mar 13, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.305.950 (863)

What subscription do you have?

Business

What platform is your computer?

Darwin 25.3.0 arm64 arm

What issue are you seeing?

Codex CLI fails to complete MCP startup for the Dart MCP server. The server receives the initial initialize request, but the handshake does not complete and resources/list fails with a timeout.

Relevant server log:

<<< (dart and flutter tooling) {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"codex-mcp-client","title":"Codex","version":"0.108.0-alpha.12"}}}

Codex error:

Called dart_mcp.list_mcp_resources({"server":"dart_mcp"})
  └ Error: resources/list failed: failed to get client: MCP startup failed: timed out handshaking with MCP server after 20s

So Codex does launch the server and send initialize, but the MCP startup never completes and tools/resources are not exposed.

What steps can reproduce the bug?

  1. Update Codex CLI to version 0.108.0-alpha.12
  2. Install Flutter/Dart with this environment:
Flutter 3.41.2 • channel stable
Tools • Dart 3.11.0 • DevTools 2.54.1
  1. Add this MCP server to ~/.codex/config.toml:
[mcp_servers.dart_mcp]
command = "dart"
args = ["mcp-server", "--force-roots-fallback"]
startup_timeout_sec = 20
tool_timeout_sec = 120
  1. Start Codex CLI in any Dart or Flutter project.
  2. Trigger an MCP call such as listing resources from the server.
  3. Observe that Codex sends the following initialize request to the server:

<<< (dart and flutter tooling) {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"codex-mcp-client","title":"Codex","version":"0.108.0-alpha.12"}}}

  1. Observe that the handshake does not complete and Codex returns:

Called dart_mcp.list_mcp_resources({"server":"dart_mcp"})
└ Error: resources/list failed: failed to get client: MCP startup failed: timed out handshaking with MCP server after 20s

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #11919
  • #12285

Powered by Codex Action

AlexeyKuznetsovGit · 5 months ago

Update: setting startup_timeout_sec = 120 works around the issue, but the server only becomes available after ~100 seconds. This is still abnormal for a local stdio MCP server and does not seem like a real fix. It looks like Codex CLI is taking an unusually long time to complete MCP startup/handshake with dart mcp-server.