Can't add mcp server via command

I’m trying to add terraform-mcp-server (terraform-mcp-server - npm). I can run the command successfully by following the provided instructions, but when I add the exact same command into Cursor MCP Server, I receive the error:

“Failed to create client.”

System Details:

  • OS: macOS 14.6.1
  • Cursor Version: 0.46.7

Steps to Reproduce:

  1. Follow the installation steps from the terraform-mcp-server documentation.
  2. Run the command manually in the terminal (works fine).
  3. Add the same command inside Cursor MCP Server (fails with “Failed to create client”).

Additional Information:

:white_check_mark: Checked the forum – no existing reports found.
:lady_beetle: Bug Description: Cursor MCP Server fails to create a client despite the command working outside of Cursor.
:arrows_counterclockwise: Reproduction Steps: Followed installation instructions and attempted the same command inside Cursor MCP Server.
:camera: Screenshots:



:computer: Impact: This prevents me from running MCP Server within Cursor.

Any insights or workarounds would be appreciated!

Try opening your terminal outside cursor and run npx -v, if you’re using something like asdf, it’s possible you haven’t set an active node version at the global level so any npx command for an MCP server will fail.

if this is the issue, you’ll just need to set your node version at the global level and it should work!

Let me know how it goes.

Thanks for your response! Here’s what I got from npx -v
image

I have other MCP servers that run using the npx command, and they work fine. So, I’m not sure whether the issue is with terraform-mcp-server itself or something specific to Cursor.

yeah, then it’s likely a different issue! Hope you’re able to get it working!

I’m having this exact issue

me too…

any news? I am still facing this issue

Same issue for me too.

I am facing this issue as well. I have checked the Anysphere cursor logs, but they don’t reveal anything useful except some error codes. Since this is so fresh, don’t know where to check.

2025-03-06 18:18:48.345 [info] e109: Starting new stdio process with command: node /Users/REDACTED/project-mcp-server/dist/index.js

2025-03-06 18:18:48.395 [info] e109: Client closed for command

2025-03-06 18:18:48.395 [error] e109: Error in MCP: Client closed

I have inspected with mcp/inspector and it retrieves the tools OK

OK, i found out how to make it working in my case, i have used node version 20.14, i have changed default (nvm default) and currently used node version to v21.5.0 and restarted IDE, and that did the trick.

Hope i helped at least for some of u :slight_smile:

I had the same issue and fixed it.

I had installed “mcp” instead of “mcp[cli]” as stated in the docs

if you had installed just “mcp”

uninstall it first:

pip uninstall "mcp"

Then install it the correct one.

pip install "mcp[cli]"

Hope that helps!

Same with exa-mcp-server