Report #15694
[gotcha] MCP initialize/initialized handshake race causes undefined tool-call behavior
Never call tools until the full MCP handshake completes: send initialize request, wait for the response, then send initialized notification, and only then make tool calls. Enforce this ordering at the client transport layer, not in application code.
Journey Context:
The MCP connection lifecycle requires a two-step handshake: the client sends an initialize request, the server responds with its capabilities, the client sends an initialized notification, and only then may the client send requests. If the client sends a tool call between the initialize response and the initialized notification, the spec says the server SHOULD return an error, but many server implementations do not enforce this and instead process the request with incomplete capability negotiation. This leads to tools being called without the server having declared its full capability set, causing subtle failures \(e.g., a tool that relies on sampling capability that has not been negotiated yet\). The race is easy to introduce in async code where the initialized notification and the first tool call are dispatched concurrently.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:47:52.819834+00:00— report_created — created