MCP stdio server fails on Windows with libuv assertion crash

Resolved 💬 3 comments Opened Feb 26, 2026 by hidai25 Closed Mar 3, 2026

Bug Report

Platform: Windows 10 Pro (10.0.19045)
Claude Code version: 2.1.59

Description

When connecting to a stdio MCP server on Windows, Claude Code fails with a libuv assertion error:

Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76

The /mcp UI shows Failed to connect for the server every time.

The MCP server itself works correctly — when tested manually by piping JSON-RPC messages, the full handshake (initialize, notifications/initialized, tools/list) completes without errors:

echo '{"jsonrpc":"2.0","id":1,"method":"initialize",...}' | python.exe -c "from evalview.mcp_server import MCPServer; MCPServer().serve()"
# Returns valid JSON-RPC response ✓

Confirmed working on macOS with the exact same server and config.

What I tried

  • evalview.exe launcher as command
  • python.exe directly as command
  • .bat wrapper script as command
  • .mcp.json project-level config file
  • Various env var combinations (PYTHONUTF8=1, PYTHONIOENCODING=utf-8)

All fail the same way on Windows. All work on macOS.

Root cause hypothesis

The assertion fires in uv__async_send() in src\win\async.c:76, which checks !(handle->flags & UV_HANDLE_CLOSING). This suggests a race condition in Claude Code's Windows libuv subprocess/pipe management when establishing the stdio MCP connection.

Environment

  • Windows 10 Pro 10.0.19045
  • Claude Code 2.1.59
  • Python 3.14 (server process)
  • Server: simple synchronous stdin/stdout JSON-RPC loop

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗