Skip to content

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

Closed

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

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    mcpIssues related to the use of model context protocol (MCP) servers
    on Mar 6, 2026
  2. AlexeyKuznetsovGit commented on Mar 7, 2026

    @AlexeyKuznetsovGit
    Author

    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.

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

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions