Thanks for reporting a bug you have found in Cursor!
Please add the following info to help us diagnose your issue:
Check the forum to ensure the issue hasn’t been reported already Provide a clear description of the bug Explain how to reproduce the bug (if known) Attach screenshots or recordings (e.g., .jpg, .png, .mp4). Tell us your operating system and your Cursor version (e.g., Windows, 0.x.x). Tell us if the issue stops you from using Cursor.
im getting this all the time i install or add an mcp server and i get this all the time i restart cursor i restart my pc and nothing really happening ive tried to add the same mcps to the claude app and they work fine
It doesn’t work.
When I use cmd /c to start npx, it gives me the error “No number after minus sign in JSON at position.”
If I use npx , it still throws the error “client closed.”
Can you explain this further. It worked for me by adding cmd /c to invoke the command but why is this not listed in the docs. What is the special case here and how can I get it to work without cmd /c When I do this it also opens an instance of a shell outside of cursor that is blank. This is not ideal as I don’t want to instantiating shells for every mcp server run
Digging a little deeper I guess MCPs servers are being run on the native OS. I use WSL for most things so you need to be sure that you have node, npx etc running well and accessible via PATH on your Windows setup not just your Linux subsystem. Is this correct?
Did you even read my post?
NPX is a wrapper to start node under C:\Program Files\nodejs\npx.cmd
This is a batch script which needs an interpreter (cmd.exe) to start.
Start the *.js without the wrapper directly via node
example:
Why cmd /c npx @agentdeskai/browser-tools-mcp Works
The /c parameter instructs cmd.exe to execute the following command and then terminate. Here’s what happens:
A new cmd.exe instance is launched
The command npx @agentdeskai/browser-tools-mcp is executed within this instance
The cmd.exe instance remains open as long as the MCP server runs
The MCP server runs as a child process of this cmd.exe instance
Why Running Without /c Fails
When you just run cmd (without /c), the following occurs:
A new cmd.exe instance is launched
This instance expects user input and interprets npx @agentdeskai/browser-tools-mcp as text that should be entered into the new command line, not as a command to be executed
Since Cursor likely passes the command via process start and not input simulation, this text is not entered into the new command line
The new cmd instance remains empty and appears to close immediately (or waits in the background for input)
Manual vs. Programmatic Usage
When you manually open cmd and type a command, the command is interpreted correctly because you’re providing interactive input. However, when a program like Cursor starts cmd programmatically, it needs the /c flag to explicitly tell cmd to treat the arguments as commands to execute rather than just arguments to the cmd process itself.
This is a standard approach for applications that need to launch and monitor external command-line programs.
Ah, I see the misunderstanding now. The person was actually making a correct observation about MCP servers running on the native OS (Windows) rather than in WSL. They were asking if their understanding was correct, not making an incorrect statement.
I need to provide a confirmation and explanation that aligns with their correct understanding."Yes, your understanding is completely correct. MCP servers for Cursor do indeed run on the native Windows OS, not within WSL.
Since you primarily use WSL for development, this is an important distinction to be aware of. For the MCP servers to function properly with Cursor:
You need Node.js and npm/npx installed directly on Windows
These tools must be properly configured in your Windows PATH
Having them only in your WSL environment is insufficient
This is because Cursor, as a Windows application, launches the MCP servers in the Windows environment context, not inside WSL. Even though you do most of your development work in WSL, this particular component requires the Windows-native versions of these tools.
If you’re experiencing issues with MCP servers, checking your Windows Node.js installation and PATH configuration would be the first troubleshooting step."
I’m getting the same Client closed error when adding any MCP server to Cursor on Windows 11. I have node 22 installed and added to PATH so I don’t think that’s the issue. Using cmd /c doesn’t make sense to me since this seems to be working without that for the videos and examples I’ve been seeing.
I figured out the issue, at least in my case. My MCP server is stdin, written in TS, ESM and executed with node index.js (transpiled from the ts). It’s a complex server with several files (modules).
Cursor doesn’t handle an MCP server with multiple files. I had to bundle everything with eslint. Furthermore I had to use the eslint flag to exclude external packages from the bundle because Cursor could not handle them.
After I did that everything worked.
Cursor’s MCP implementation is seriously lacking. Everything was working well with Winds*rf and Claude Desktop.
EDIT: Hilarious I can’t use the word Winds*rf here, pathetic!
The use of cmd /c makes sense!
Use the search, I’ve already explained it in other posts.
What you have seen in other videos are other operating systems.
@secprobe Right it makes sense in why it works, though for me its unstable (An MCP server runs once or twice and then seems to fail) and cmd /c keeps the console window open. It just feels clunky. It would be nice if Cursor on windows handled it better internally without the need to call cmd.