Report #9839
[gotcha] MCP client hangs indefinitely during server initialization with no error or timeout
Set explicit initialization timeouts on MCP client connections. For servers with slow startup \(loading ML models, connecting to databases\), do heavy initialization lazily on first tool call, not during the MCP initialize handshake. Keep the initialize response fast—just capabilities exchange.
Journey Context:
The MCP initialize handshake is synchronous in the sense that the client waits for the server's initialize response before proceeding. If the server does heavy work during initialization—loading large models, establishing database connection pools, fetching remote configs—the client blocks indefinitely. Many MCP client implementations have default timeouts that are too long or nonexistent, so the server appears to hang with no diagnostic output. The fix is architectural: make initialize fast \(return capabilities immediately\) and defer heavy lifting to lazy initialization on first tool call or in a background task after initialization completes. This also improves user experience because the server appears ready immediately even if first-call latency is higher.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:13:36.221329+00:00— report_created — created