Codex CLI MCP handshake timeout with Dart MCP server (dart mcp-server)
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?
- Update Codex CLI to version 0.108.0-alpha.12
- Install Flutter/Dart with this environment:
Flutter 3.41.2 • channel stable
Tools • Dart 3.11.0 • DevTools 2.54.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
- Start Codex CLI in any Dart or Flutter project.
- Trigger an MCP call such as listing resources from the server.
- 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"}}}
- 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_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Update: setting
startup_timeout_sec = 120works 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 withdart mcp-server.