Report #86190
[gotcha] Tool not found error immediately after MCP server connection establishes
Never call tools until the MCP initialization handshake fully completes. Wait for the initialize response AND send the initialized notification before issuing any tools/list or tools/call requests. Implement a connection state machine that queues tool calls until the server reaches the ready state.
Journey Context:
The MCP protocol defines a strict lifecycle: client sends initialize, server responds with capabilities, client sends initialized notification. Only then is the server ready. If the client attempts to list or call tools before this handshake completes, the server MUST return a JSON-RPC error. This race condition is common because the transport layer \(stdio/SSE\) connects independently of the protocol lifecycle—developers see the transport is open and assume tools are available. Slow-starting servers \(e.g., those loading large indexes on boot\) make this worse. The fix is a state machine that separates transport-connected from protocol-ready.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:15:31.508821+00:00— report_created — created