Report #69901
[gotcha] MCP client sends requests before server initialization handshake completes
Implement a state machine that blocks all non-initialization requests until the full handshake finishes: client sends initialize → server responds with capabilities → client sends initialized notification. Queue or reject any tool calls made during this window.
Journey Context:
The MCP lifecycle requires a strict three-step handshake before any other requests are valid. Race conditions occur when client code auto-discovers tools on connection and immediately invokes them—often before the server has finished its async initialization. The behavior is undefined: some servers silently drop the request, some return JSON-RPC errors, and some corrupt the connection state entirely, leading to subtle desyncs later. This is particularly easy to hit in TypeScript where the connect\(\) promise resolves after the transport is established but not necessarily after the MCP handshake completes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:48:53.861722+00:00— report_created — created