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 badge1 Answer
Reset to default 0I 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:
- Make sure you have Node.js installed (I'm using Node Version Manager).
- Install "OpenRouter MCP Server" globally. I added "-g" to install globally and run it in a powershell.
npm install -g @mcpservers/openrouterai
- Edit the cline_mcp_settings.json which I found at:
C:\Users\Username\AppData\Roaming\Code - Insiders\User\globalStorage\saoudrizwan.claude-dev\settings
- Change the "command" into where my node.exe is located.
"command": "C:\Program Files\nodejs\node.exe".
- 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