Report #88232
[tooling] MCP server over stdio hangs or responds slowly to tool calls
Set PYTHONUNBUFFERED=1 environment variable or explicitly flush stdout after every JSON-RPC message
Journey Context:
Python's stdio buffering delays output until the buffer fills or the process exits, causing the MCP client to wait indefinitely for the JSON-RPC response. Many developers mistake this for an architecture bug or JSON parsing error. While using 'print\(json.dumps\(response\), flush=True\)' works, the global PYTHONUNBUFFERED=1 is the robust fix for production MCP servers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:40:51.444974+00:00— report_created — created