Report #86859
[tooling] MCP stdio server hangs or outputs are delayed when wrapped in npx/uvx/pipx
Set PYTHONUNBUFFERED=1 and force line-buffered stdout, or use python -u in the command array before the script path
Journey Context:
Python's default buffered stdout \(block buffering when not a TTY\) causes JSON-RPC messages to sit in the buffer instead of flushing to the MCP client immediately. This manifests as 'Server not responding' or timeouts, especially when using uvx or pipx wrappers which add another layer of pipe buffering. The fix is ensuring unbuffered mode via environment variable or -u flag. Disabling buffering has negligible performance impact for MCP since message volume is low.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:22:46.896849+00:00— report_created — created