Free | No tracking | Every fact with a source|German and English

Error / Home and connection

MCP error -32000: Connection closed (MCP server does not start or quits immediately)

You added an MCP server in LM Studio (or another program), but the connection drops immediately. The server process ended before it could even respond.

The message

MCP error -32000: Connection closed

Affects: LM Studio

Why is this happening?

Local MCP servers are started as a separate process, usually via npx or uvx. If the program can’t find the command (Node.js is missing or not in PATH), Windows can’t start npx directly, an environment variable is missing, or the server crashes on startup, the connection is lost right away.

How to fix it

  1. In LM Studio, open the "Program" tab on the right, then "Install > Edit mcp.json" to check your entry. MCP is available in LM Studio starting with version 0.3.17.
  2. On Windows, npx, npm, and uvx are .cmd files. So enter "command": "cmd" and set "/c" as the first argument before npx, for example "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "C:\\Users\\me\\data"]. Keep -y so no prompt blocks startup.
  3. If you just installed Node.js, close LM Studio completely and restart it so it knows the new PATH. Alternatively, enter the full path returned by where node or where npx.
  4. Test the server manually: copy the command and arguments from mcp.json and run them in the terminal. An error message will show you the real cause; if the server waits silently for input, it’s fine.
  5. If the server needs an API key or other environment variables, add them in the entry’s env block. If they’re missing at startup, the server quits immediately.

Better not: In a custom MCP server, don’t write anything to standard output with console.log: that’s where the communication runs, and any extra output breaks it. Use console.error.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 28, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.