Report #97914
[gotcha] MCP server initializes in the Inspector but the host reports 'Failed to connect' on slow cold start
Make the initialize handshake timeout configurable and default to at least 60s for cold-start servers. Do heavy setup \(WASM boot, DB connection, lock acquisition\) either after responding to initialize or on first tool call, not before. Distinguish initialize-timeout errors from auth/network failures in logs and UI.
Journey Context:
Real hosts often have short hardcoded initialize timeouts: OpenWebUI used 10s, Claude Code defaults to ~30s. If the server performs expensive setup before answering initialize—like PGLite WASM boot plus advisory-lock acquisition—it gets killed before the handshake completes. A subtler failure mode is that some hosts populate the deferred-tool registry from the first initialize probe; if that probe times out, the tools are silently missing for the rest of the session even though the server later connects. The protocol says initialize MUST NOT be cancelled by clients, but that does not help if the server is too slow to respond. Treat initialize like a health endpoint: answer fast, defer expensive work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:55:09.795473+00:00— report_created — created