# Fix MCP error -32000: Connection closed on Claude Code, Cursor & Windsurf (stdio / npx)

> Claude Code, Cursor, and VS Code throw MCP error -32000: Connection closed on local stdio Model Context Protocol (MCP) servers for three reasons: GUI apps do not inherit nvm/fnm/asdf Node PATH, stray console.log() statements corrupt JSON-RPC 2.0 on stdout, or npx -y times out downloading npm tarballs. Migrate immediately from fragile local stdio to native Remote Streamable HTTP MCP (claude mcp add --transport http voxell-forge https://api.voxell.ai/mcp/try).

Canonical URL: https://voxell.ai/errors/mcp-server-error-32000-connection-closed-stdio-npx/


## Three Root Causes of `MCP error -32000: Connection closed` on `stdio`

1) **`stdout` pollution:** `stdio` MCP frames JSON-RPC messages over `stdout`; a single dependency `console.log("Connected")` or `dotenv` banner breaks framing and forces immediate disconnect; 2) **GUI `PATH` isolation:** macOS/Linux desktop IDEs spawn `/usr/bin` without `~/.nvm` or Windows `cmd /c npx.cmd`; 3) **Zombie processes & corporate npm proxies** blocking runtime `npx` downloads.

## Immediate Fix: Switch From Local `stdio` `npx` to Zero-Install Streamable HTTP MCP

```bash
# Eliminate Node, nvm, Docker, and stdio JSON-RPC framing crashes permanently:
claude mcp add --transport http voxell-forge https://api.voxell.ai/mcp/try

# Or in Cursor / Windsurf / VS Code mcp.json:
# {"mcpServers":{"voxell-forge":{"url":"https://api.voxell.ai/mcp/try"}}}

# If debugging your own custom stdio server, route ALL logs to stderr:
# console.error("[mcp-debug] initialized"); // NEVER console.log() on stdio!
```

## Enterprise Streamable HTTP MCP With `$0` Agent Seats on Voxell Forge

Voxell Forge hosts native Streamable HTTP `POST /mcp` and public `/s/{slug}/mcp` endpoints (`MCP-Protocol-Version: 2025-11-25`), requiring zero local runtimes on developer laptops with **$0** coding-agent seats across **Builder ($39/mo)**, **Team ($199/mo)**, and **Scale ($499/mo)**.

## Related Optimization Guides, Calculators & Benchmarks

- **[Remote Streamable HTTP MCP for Private Engineering Docs](/compare/mcp-server-for-private-engineering-docs/)**
- **[MCP Client Setup Recipes (Claude Code, Cursor, Codex)](/forge/recipes/)**
- **[Verified Documentation & Compliance MCP Atlas](/atlas/)**
- **[Audit Your Docs or GitHub Repo Free](/audit/)**

## Frequently Asked Questions

### Why does dotenv v17+ break stdio Model Context Protocol (MCP) servers?

Recent dotenv versions print an informational tip banner to stdout by default unless quiet: true is set, immediately corrupting the stdio JSON-RPC stream and triggering MCP error -32000.

### How do I fix npx MCP error -32000 on Windows in Claude Desktop or Cursor?

Prefer Remote Streamable HTTP (--transport http url) first; if forced to use stdio on Windows, invoke cmd /c npx -y <pkg> or pass the absolute path to node.exe.

---

## Zero-Install Model Context Protocol (MCP) & Keyless Agent Verification

```bash
claude mcp add --transport http voxell-forge https://api.voxell.ai/mcp/try
```

- Keyless Retrieval Bake-Off: `POST https://api.voxell.ai/api/v1/agent/bakeoff`
- Keyless Contradiction X-Ray: `POST https://api.voxell.ai/api/v1/agent/xray`
- Machine-Readable Pricing JSON: `https://voxell.ai/api/v1/agent/pricing.json`
- Full LLM Authority Map: `https://voxell.ai/llms-full.txt`
