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
- 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.
- On Windows,
npx,npm, anduvxare.cmdfiles. So enter"command": "cmd"and set"/c"as the first argument beforenpx, for example"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "C:\\Users\\me\\data"]. Keep-yso no prompt blocks startup. - 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 nodeorwhere npx. - 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.
- If the server needs an API key or other environment variables, add them in the entry’s
envblock. 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:
- LM Studio: Your First Local Chat
Install LM Studio on Windows, load a suitable language model, and chat offline, even with your own documents.
Terms for this
Similar errors
- LM Studio: This message contains no content. The AI has nothing to say. (Reply remains empty)
- LM Studio: Trying to keep the first … tokens when context the overflows (Input is longer than the configured context length)
- Model forgets the beginning or ignores long texts (context length too small)
- AMD graphics card not being used (ROCm or Vulkan)
- Confusing answers, endless loops, or tags like <|im_end|> (wrong chat template)
Sources
- https://startdebugging.net/2026/06/fix-mcp-error-32000-connection-closed-in-claude-code/
- https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/869
- https://lmstudio.ai/docs/app/mcp
Checked on Oct 28, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.