Report #9515
[tooling] MCP stdio server hangs indefinitely during client initialization
Set client timeout to 60s\+ for stdio transport, spawn process with detached:false and explicit env inheritance, and parse stderr for boot logs before the JSON-RPC handshake completes.
Journey Context:
Many developers assume MCP servers boot instantly like CLI commands, but Python servers especially incur 5-30s venv activation costs. The MCP spec mandates an \`initialize\` request/response before any tool calls, but doesn't specify timeouts. Common mistake: using default 10s HTTP timeouts for stdio. The stdio transport requires process management - \`detached:false\` ensures the child dies with the parent, preventing zombie Python processes. Critical insight: servers log boot errors to stderr before JSON-RPC begins, so capturing stderr during the timeout window reveals 'ModuleNotFoundError' vs actual hangs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:20:27.785995+00:00— report_created — created