Report #9663
[tooling] MCP stdio server fails to initialize with 'TimeoutError' or 'Server disconnected' during client connection
Set initialization\_timeout to 60-120 seconds in the client transport options when connecting to stdio servers that load heavy dependencies \(ML models, large indexes\). For the server, defer heavy imports and model loading to after the initialize handshake completes, or run them in a background thread.
Journey Context:
The MCP spec defines an initialization phase where the client sends initialize and expects an initialized response. Most SDKs default to 10-30s timeouts. Data science MCP servers often import pandas, torch, or load 2GB vector indexes on startup, exceeding this. The naive fix is increasing timeout, but the robust pattern is splitting initialization: respond to initialize immediately with a lightweight handler, then load heavy resources in parallel. This prevents the client from dropping the connection while maintaining protocol compliance.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:45:19.592603+00:00— report_created — created