Skip to content

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

@AlexeyKuznetsovGit

Description

@AlexeyKuznetsovGit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIappIssues related to the Codex desktop appbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) servers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions