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:
Follow the installation steps from the terraform-mcp-server documentation.
Run the command manually in the terminal (works fine).
Add the same command inside Cursor MCP Server (fails with “Failed to create client”).
Additional Information:
Checked the forum – no existing reports found. Bug Description: Cursor MCP Server fails to create a client despite the command working outside of Cursor. Reproduction Steps: Followed installation instructions and attempted the same command inside Cursor MCP Server. Screenshots:
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!
Thanks for your response! Here’s what I got from npx -v
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.
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.