MCP community node breaks on error "spawn EINVAL"

Describe the problem/error/question

When executing the community node of the protocol MCP, it returns an error. I have identified that the problem is the node version since the 18.17.0 version works but the 22.13.1 version doesn’t. I know that the issue is fixed putting this somewhere: { shell: true }. The thing is that I don’t know where I have to add it.

What is the error message (if any)?

MCP client connection error: spawn EINVAL
Failed to execute operation: Failed to connect to MCP server: spawn EINVAL
Failed to execute operation: Failed to connect to MCP server: spawn EINVAL

Please share your workflow

Share the output returned by the last node

{
  "errorMessage": "Failed to execute operation: Failed to connect to MCP server: spawn EINVAL",
  "errorDetails": {},
  "n8nDetails": {
    "nodeName": "MCP Client",
    "nodeType": "n8n-nodes-mcp.mcpClient",
    "nodeVersion": 1,
    "operation": "listTools",
    "time": "1/4/2025, 8:50:21",
    "n8nVersion": "1.84.3 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "NodeOperationError: Failed to execute operation: Failed to connect to MCP server: spawn EINVAL",
      "    at ExecuteContext.execute (C:\\Users\\hololens\\.n8n\\nodes\\node_modules\\n8n-nodes-mcp\\nodes\\McpClient\\McpClient.node.ts:565:4)",
      "    at WorkflowExecute.runNode (C:\\Users\\hololens\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\n8n-core\\src\\execution-engine\\workflow-execute.ts:1155:9)",
      "    at C:\\Users\\hololens\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\n8n-core\\src\\execution-engine\\workflow-execute.ts:1505:27",
      "    at C:\\Users\\hololens\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\n8n-core\\src\\execution-engine\\workflow-execute.ts:2064:11"
    ]
  }
}

Information on your n8n setup

  • n8n version: 1.84.3
  • Database (default: SQLite): Local
  • n8n EXECUTIONS_PROCESS setting (default: own, main): http://localhost:5678/
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows

Hi, can you share your actual config of the mcp since it cannot be seen like this.

Command and parameters please

In addition there are many people struggling of getting the MCP to work on windows. Better to run in inside of a docker

I have fixed it by adding the full path.

I found the answer in this link:
(Failed to execute Node, file or directory does not exist · Issue #34 · nerding-io/n8n-nodes-mcp · GitHub)

However, thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.