最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - "spawn npx ENOENT spawn npx ENOENT" Error in Cline VSCode MCP Server Connection - Stack Overflow

programmeradmin4浏览0评论

I tried to install OpenRouter MCP Server using Cline Extension in VSCode Insiders as MCP Client. I got my reference from Smithery (/@mcpserver/openrouterai).

This is my cline_mcp_settings.json located at "C:\Users\takan\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings":

{
  "mcpServers": {
    "openrouterai": {
      "command": "npx",
      "args": ["-y", "@smithery/cli@latest", "run", "@mcpserver/openrouterai"],
      "env": {
        "OPENROUTER_API_KEY": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "OPENROUTER_DEFAULT_MODEL": "google/gemini-2.0-pro-exp-02-05:free"
      }
    }
  }
}

I got "spawn npx ENOENT spawn npx ENOENT" after Cline automatically connected with the server after I saved the file.

screenshot of the Cline extension tab

I tried to install OpenRouter MCP Server using Cline Extension in VSCode Insiders as MCP Client. I got my reference from Smithery (https://smithery.ai/server/@mcpserver/openrouterai).

This is my cline_mcp_settings.json located at "C:\Users\takan\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings":

{
  "mcpServers": {
    "openrouterai": {
      "command": "npx",
      "args": ["-y", "@smithery/cli@latest", "run", "@mcpserver/openrouterai"],
      "env": {
        "OPENROUTER_API_KEY": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "OPENROUTER_DEFAULT_MODEL": "google/gemini-2.0-pro-exp-02-05:free"
      }
    }
  }
}

I got "spawn npx ENOENT spawn npx ENOENT" after Cline automatically connected with the server after I saved the file.

screenshot of the Cline extension tab

Share Improve this question asked Mar 25 at 17:13 vnmw7vnmw7 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

I found a discussion similar to my problem in a GitHub Issue "Connect MCP Servers error"spawn npx enoent" #1948". However, they are just posting their .json file without any explanation. So here is my own solution:

  1. Make sure you have Node.js installed (I'm using Node Version Manager).
  2. Install "OpenRouter MCP Server" globally. I added "-g" to install globally and run it in a powershell.

npm install -g @mcpservers/openrouterai

  1. Edit the cline_mcp_settings.json which I found at:

C:\Users\Username\AppData\Roaming\Code - Insiders\User\globalStorage\saoudrizwan.claude-dev\settings

  1. Change the "command" into where my node.exe is located.

"command": "C:\Program Files\nodejs\node.exe".

  1. Change the "args" into where my @mcpservers/openrouterai is located.

"args": [ "C:\Program Files\nodejs\node_modules\@mcpservers\openrouterai\dist\index.js" ],

This is the preview of my configuration:

cline_mcp_settings.json config

发布评论

评论列表(0)

  1. 暂无评论