DOCS/TROUBLESHOOTING/ERROR -32000
MCP error connection closed (-32000)
-32000 connection closed means the MCP session started, then terminated before the client received a valid response.
In most cases the server process crashed, timed out, or wrote invalid output.
Highest-frequency causes
- server writes logs to stdout instead of stderr
- runtime path mismatch (
node,python, or binary not found) - process exits before returning
tools/list - proxy or firewall closes idle connections
- auth middleware terminates request early
Fix checklist
- Move all debug logs to stderr
- Use absolute runtime paths for local processes
- Confirm process stays alive after initialize
- Increase idle timeout on proxy/load balancer
- Validate headers and auth token format
Stdio-specific fixes
If running local stdio servers:
- no banners or logs on stdout
- keep stdout as pure protocol stream
- run with explicit command path
bashnode /absolute/path/to/server.js
Remote endpoint fixes
If running HTTP/SSE servers:
- confirm reverse proxy supports streaming where required
- set timeout above expected tool latency
- monitor 499/502/504 responses in gateway logs
Verify recovery
- Probe endpoint in Playground
- Check that response grade is stable across repeated runs
- Re-test from VS Code or Cursor with same endpoint
AgenticMarket