You Saved my life!!!
So I can’t use the cmd /c method for some reason. I’m noticing that when approaching the command this way it attempts to run the command on my local windows machine rather than the remote ubuntu machine.
I suspect the main problem is that I need the command to run on the remote machine where my local supabase dev instance is. Does anyone have a solution that would allow my MCP command to run on the remote machine?
I’ve tried forwarding the relevant ports but haven’t successfully had my MCP command run on the remote machine.
So the “Make sure Node & npm/npx are installed correctly” is doing a lot of work here,
WSL is complex because as stated above, the actual cursor process runs on the native OS, so it’s probably to do with port bindings and processes etc (was in my case).
I got a flickering ‘windows’ terminal that instantly closed when I started the MCP server via cursor, this is the clue.
Best approach to fix is getting Cursor agent on the case and asking it to debug the WSL connection, there are a lot of hoops involved but luckily once you know the problem Cursor itself can normally help you debug.
cmd /k wsl.exe -e node /var/www/html/MCP-server/build/index.js --log-level=debug > C:\temp\mcp.log 2>&1 && echo Log file written to C:\temp\mcp.log
This might help folk debug, basically write the output to a log file in windows, and then open powershell to read it. This feedback loop should give cursor all the clues it needs.
"mcpserver": {
"command": "cmd",
"args": [
"/k",
"wsl.exe -e node /var/www/html/SERVER/build/index.js --log-level=debug > C:\\temp\\mcp.log 2>&1"
],
"env": {
"DEBUG": "*",
"NODE_DEBUG": "net,stream,module,http",
"MCP_LOG_LEVEL": "debug"
}
}
}
the cmd /c works
you just need to run the cursor app as an administrator
do not close the cmd window when it popped up
I’m having the same “client closed” error for all MCP servers I try to add to cursor on MacOS. Has anyone got any solutions for Mac?
Version: 0.46.8
VSCode Version: 1.96.2
Commit: be4f0962469499f009005e66867c8402202ff0b0
Date: 2025-02-28T19:31:35.681Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.1.0
You’re interpreting it completely wrong, it has absolutely nothing to do with cursors.
If you enter “cmd npx @agentdeskai/browser-tools-mcp”, the following happens: The cmd is opened and npx @agentdeskai/browser-tools-mcp is not passed as an argument to the cmd but interpreted as text. With cmd /c npx @agentdeskai/browser-tools-mcp works the other way round, what comes after /c or /k is passed as an argument to the cmd.
Try it out for yourself. Press windows key + r and type “cmd set”.
Then do it again with “cmd /k set”
You will understand the difference.
I keep getting the “client closed” error whenever i am trying to add an MCP server to cursor. I have tried adding cmd /c and cmd/k before “npx @agentdeskai/browser-tools-server” but this does not seem to fix the error!
Same error applies to “npx -y @modelcontextprotocol/server-postgres ”
This is really frustrating!
Check my answer here: Can't add mcp server via command - #12 by toubar
This seems like it could be solved if I could specify the path of the node to be used in the cursor editor.
I don’t know how to do that though.
No I get it, but Cursor needs a fix for this for a better user experience. I don’t have to deal with this problem when using that other IDE that it doesn’t let me mention here.