You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i HATE THISSSSSSSSSSSSSSSSSSSS
IS THERE ANY SOLUTIONS I HAVE THIS ISSUE AND TRYING TO FIX FOR HOURS
I DIDNT EVEN HAD EXPERIENCED MCP SERVERS YET
AHHHHHHHHHHHHHHHHHHHHHHHHHH
NND, Windows system is not the favorite son of developers and programmers.
I used my wife's mbp to install it casually, directly installed it with the command line npx, the configuration was automatically generated, and vscode saved the configuration. Then the mcp servers were automatically installed successfully. The whole process was smooth and smooth...
Just updated smithery/cli to use latest version of MCP SDK, hope this fixes the spawn npx ENONT error smithery-ai/cli#77
Thanks, developer.
In my pwsh7, I executed npx -y @smithery/cli@latest inspect @executeautomation/playwright-mcp-server --verbose
Finally, it is the same as in the Mac system, and there is no spawn npx ENONT error
I use both of wsl2 and macos. Meanwhile, I use fnm for managing nodejs version. I met this problem on both systems. And I think I figure out the reason and solution. No matter you use cline or Cursor. Connect MCP Servers error"spawn npx enoent" means mcp client can't correctly find npx command in your system. So if you're using fnm, don't use which npx to set npx path directly. This path is temporarily created by fnm so it'll outdate when restart device.
The right way is to find to your fnm directory by command which fnm. For example, mine is /Users/CHJ/.local/state/fnm_multishells/32996_1746258653075/bin/npx. Then access to /Users/CHJ/.local/share/fnm/node-version/<select a version you want to use>/installation/bin/, you should be able to see npx file. To my understanding, fnm create temporary folder based on these nodejs versions under /Users/CHJ/.local/share/fnm/.
Whatever, find the npx file that is constant and permanent. Then use this path alternate the npx in every mcp setting json.
For example, in wsl2 using context7 mcp server by Cursor:
Activity
alemarro commentedon Feb 25, 2025
this
TheComplianceAide commentedon Feb 25, 2025
I've had this occur in the past 3-4 days, on multiple Windows development systems.
bobbyiscool123 commentedon Feb 25, 2025
i HATE THISSSSSSSSSSSSSSSSSSSS
IS THERE ANY SOLUTIONS I HAVE THIS ISSUE AND TRYING TO FIX FOR HOURS
I DIDNT EVEN HAD EXPERIENCED MCP SERVERS YET
AHHHHHHHHHHHHHHHHHHHHHHHHHH
ByteCoO commentedon Feb 26, 2025
Environment configuration problem, this is the only way to configure。
{
"mcpServers": {
"fetch": {
"command": "uvx",
"args": [
"mcp-server-fetch"
],
"env": {
"PYTHONIOENCODING": "utf-8"
},
"disabled": false,
"autoApprove": []
},
"puppeteer": {
"command": "C:\Program Files\nodejs\node.exe",
"args": [
"D:\Program Files\nodejs\node_modules\npm\node_modules\@modelcontextprotocol\server-puppeteer\dist\index.js"
],
"disabled": false,
"autoApprove": []
},
"playwright": {
"command": "C:\Program Files\nodejs\node.exe",
"args": [
"D:\Program Files\nodejs\node_modules\npm\node_modules\@executeautomation\playwright-mcp-server\dist\index.js"
],
"disabled": false,
"autoApprove": [
"playwright_click"
]
}
}
}
Archer456 commentedon Feb 26, 2025
Thank you so much, referring to your configuration, I thought about my way, and finally got it right.
{ "mcpServers": { "@executeautomation-playwright-mcp-server": { "command": "D:\\nodejs\\node.exe", "args": [ "D:\\nodejs\\node-global\\node_modules\\@executeautomation\\playwright-mcp-server\\dist\\index.js", "-y", "@smithery/cli@latest", "run", "@executeautomation/playwright-mcp-server", "--config", "\"{}\"" ] } } }I will use Chinese below. Sorry, English is not my native language.
好吧,这东西折腾了我一天时间,没错。一天时间。我下边将为大家总结错误,但我并不肯定这些错误都是在不同电脑和操作系统下一定会复现的。
一、 我最开始是用 fnm 方式安装的nodejs。
我本机是用powershell7.5+oh-my-posh提示的。
参考 https://nodejs.org/zh-cn/download/ 和 https://github.com/Schniz/fnm
其实,我是成功在pwsh7.5 上安装和部署好了node 22.14的。并没有什么问题。
也在pwsh7.5 用 https://smithery.ai/server/@executeautomation/playwright-mcp-server 提到的安装命令 npx -y @smithery/cli@latest install @executeautomation/playwright-mcp-server --client cline 安装成功了。
安装完后的配置文件是这样的。
{ "mcpServers": { "@executeautomation-playwright-mcp-server": { "command": "npx", "args": [ "-y", "@smithery/cli@latest", "run", "@executeautomation/playwright-mcp-server", "--config", "\"{}\"" ] } } }打开vscode 的cline插件,打开mcp servers 也看到了装上了playwright-mcp-server但就是连接报错,我反复搜索和问了很多AI这个关键词spawn npx ENOENT spawn npx ENOENT 都告诉我说是npx或者说node安装的问题。
那么,我不得不怀疑是fnm + nodejs 的部署问题,可一切node -v 、npm -v 、npx -v 在pwsh7.5 在vscode里的pwsh7.5 都是正常的。
直到我看了你的回复里的配置,发现你应该不是用的fnm部署的nodejs。

所以,我完全确认卸载掉nodejs 和 fnm ,重新用node-v22.14.0-x64.msi 安装包的方式,重新部署了nodejs。
为了方便管理nodejs,我做了如下的事情:
我的安装路径 D:\nodejs
D:\nodejs下 新建三个文件夹 node-cache 、 node-global 、 \node-global\node_modules
环境变量:
` Archer@Jade 15:24:26
~ ❯ node -v
v22.14.0
Archer@Jade took 518ms 15:24:30
~ ❯ npm -v
10.9.2
Archer@Jade took 450ms 15:24:35
~ ❯ npm config set prefix "D:\nodejs\node-global"
Archer@Jade took 369ms 15:27:54
~ ❯ npm config set cache "D:\nodejs\node-cache"
Archer@Jade took 359ms 15:28:02
~ ❯ npm config get prefix
D:\nodejs\node-global
Archer@Jade took 355ms 15:28:09
~ ❯ npm config get cache
D:\nodejs\node-cache
~ ❯ npm install -g [email protected]
Archer@Jade took 333ms 15:41:19
~ ❯ npx -y @smithery/cli@latest install @executeautomation/playwright-mcp-server --client cline
✔ Successfully resolved @executeautomation/playwright-mcp-server
@executeautomation/playwright-mcp-server successfully installed for cline`
可惜 这个 npx -y @smithery/cli@latest install @executeautomation/playwright-mcp-server --client cline 安装命令安装后,vscode里的cline mcp servers 还是一样的错误 spawn npx ENOENT spawn npx ENOENT 并且一些命令也都是有问题的。比如
npx @smithery/cli installed --client cline 和 npx @smithery/cli uninstall playwright-mcp-server --client cline 明明安装成功了,installed 却不列出来。。。 我只能怀疑npx 这种方式有问题。
最终看了 https://github.com/executeautomation/mcp-playwright 用这个命令安装
npm install -g @executeautomation/playwright-mcp-server
因为我设置了node-cache 和node-global 所以,我最终在自己的安装相关路径下找到了类似你的配置里的,最终改了配置playwright mcp server就连接成功了。
我太难了。。。。开源作者们,咱们不都是苹果系统开发环境吧? 能对windows系统友好些么?
初步怀疑smithery.ai 提供的npx -y 命令是有问题的,建议不要通过这种方式安装,而是npm install -g 的方式。
或者说npx -y的这种方式生成的mcp server默认配置在win系统环境下是无法直接运行成功的,可能对苹果系统很友好,一路默认
安装开箱即用了? 哎。。。
fnm 安装的nodejs 我个人感觉并没有什么问题,只是默认不改任何配置的话,它的安装路径默认的太复杂,不方便以后找安装的node_modules,所以我改为了 .msi的安装方式,指定node-global来管理node_modules安装路径。
Archer456 commentedon Feb 26, 2025
好吧,我不得不说,目前windows11系统,vscode +cline插件,通过https://smithery.ai/ 的
类似 npx -y @smithery/cli@latest install @smithery-ai/fetch --client cline 的命令在pwsh7.5 下的安装方式,是无法做到安装后即用的。
我安装完 playwright-mcp-server 又尝试了下 https://github.com/smithery-ai/mcp-fetch
还是用 https://smithery.ai/ 的 npx -y @smithery/cli@latest install @smithery-ai/fetch --client cline 安装完后,还是spawn npx ENOENT spawn npx ENOENT ,没办法,我只能照老虎画猫,找到配置文件的规律。
对比着playwright-mcp-server的配置和 github上https://github.com/kazuph/mcp-fetch提供的零星的关键词信息。
哦。。。差点遗漏了,实际上还得改安装命令,还是照样改成 npm install -g @kazuph/mcp-fetch 这种安装的才有用,npx -v 纯属在那摆设的。。
"@executeautomation-playwright-mcp-server": {
"command": "D:\nodejs\node.exe",
"args": [
"D:\nodejs\node-global\node_modules\@executeautomation\playwright-mcp-server\dist\index.js",
"-y",
"@smithery/cli@latest",
"run",
"@executeautomation/playwright-mcp-server",
"--config",
""{}""
]
来改 mcp-fetch的配置:
"@kazuph-mcp-fetch": {
"command": "D:\nodejs\node.exe",
"args": [
"D:\nodejs\node-global\node_modules\@kazuph\mcp-fetch\dist\index.js",
"-y",
"@smithery/cli@latest",
"run",
"@kazuph/mcp-fetch",
"--config",
""{}""
]
最终也成功连接到这个mcp-fetch server了。。。。
我去非苹果系统的安装mcp servers 太难了。。。。。 希望能适配windows系统下的vscode + cline插件更友好的安装方式,做到一键部署即可使用,否则非技术专业的用起来太难了。
theCyberTech commentedon Feb 26, 2025
same issue here Cline on Windsurf, MacOS
Archer456 commentedon Feb 27, 2025
其实怀疑,不是配置文件的问题,而是windows下的vscode,不设置node绝对路径的话,vscode没法正确找到本机安装的node 或npx 。
.msi 安装的nodejs,按我以上的步骤,以及mcp servers配置文件里写node绝对路径,是可以正常连接mcp servers的。
我现在,还是想正常弄好windows11 vscode cline插件,可以让mcp servers配置文件里的npx 直接能正常找到本机的node。

所以,我又重新winget 装回了fnm,但是尝试了一圈,发现这个fnm是不是在vscode没提供什么配置项,还是我没找到如何正确在vscode理配置好fnm?
我也用了fnm use 等命令来指定node版本。
可见,pwsh7和vscode里cline的pwsh ,which npx 的路径都是fnm 每次虚拟出来的。。。
那vscode 里不特别指定的 话,vscode应该找不到本机已经安装好的npx的。
如果,可以正确配置好vscode下的fnm 或者说fnm管理的node版本路径问题,就可以让vscode根据mcp servers的配置去正确唤起npx了。
但我现在,没找到怎么在vscode下配置fnm nodejs.
有谁熟悉,vscode下如何配置正确fnm node的?
Archer456 commentedon Feb 27, 2025
Hello, everyone. I have sorted out the steps for VSCode+Cline plug-in to correctly connect to mcp servers in the win environment. I hope it can help AI product enthusiasts all over the world to take the first step in using AI and mcp servers.
"This is just a small step, but it is a big step for ordinary humans to use AI"
Sorry, I was naughty.
Sorry again, this is a Chinese content, you may need to use a translator to read it.
https://medium.com/@sayharer/vscode-cline%E6%8F%92%E4%BB%B6%E9%83%A8%E7%BD%B2mcp-server-win%E7%B3%BB%E7%BB%9F-b079c3d254dc
If you find it helpful, please move your hands, like, follow, and collect it.
cdxiaodong commentedon Feb 28, 2025
感谢大佬哦
cdxiaodong commentedon Feb 28, 2025
windows最简单的方法
Archer456 commentedon Mar 3, 2025
NND, windows系统果然不是开发编程人员的亲儿子.
我用老婆的mbp 随便一顿安装,直接命令行npx 安装,配置自动生成,vscode保存下该配置.就自动安装mcp servers成功了.全程毫无波澜,丝滑...
NND, Windows system is not the favorite son of developers and programmers.
I used my wife's mbp to install it casually, directly installed it with the command line npx, the configuration was automatically generated, and vscode saved the configuration. Then the mcp servers were automatically installed successfully. The whole process was smooth and smooth...
m4ttgit commentedon Mar 5, 2025
Try to install using this repo https://github.com/Automata-Labs-team/MCP-Server-Playwright. Running on Windows 10. Hope it helps.
Queries : https://www.perplexity.ai/search/how-to-fix-spawn-npx-enoent-sp-nM0JY8fBT0WAgX6afSqyew
nanobiolog commentedon Mar 8, 2025
Add this C:\Users<YourUsername>\AppData\Roaming\npm to your SYS Variables PATH
23 remaining items
Eskiii commentedon Mar 28, 2025
wc感谢大佬!!!终于连上了,windows真的折腾好久了
arjunkmrm commentedon Mar 28, 2025
Just updated smithery/cli to use latest version of MCP SDK, hope this fixes the
spawn npx ENONTerrorarcadeai-labs/smithery-cli#77
Archer456 commentedon Mar 28, 2025
Thanks, developer.
In my pwsh7, I executed npx -y @smithery/cli@latest inspect @executeautomation/playwright-mcp-server --verbose
Finally, it is the same as in the Mac system, and there is no spawn npx ENONT error
diiiiiiiiiiiiK commentedon Apr 7, 2025
我安装filesystem过程中以上的方法仍然不能用,把配置改成这样,大家可以试试
"github.com/modelcontextprotocol/servers/tree/main/src/filesystem": {
"autoApprove": [],
"disabled": true,
"timeout": 60,
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"d:/AI/MCP"
],
"transportType": "stdio"
}
behrangsa commentedon Apr 12, 2025
Why is this closed? Linux is still broken.
arjunkmrm commentedon Apr 12, 2025
@behrangsa try using the following command pattern for linux?
{ "mcpServers": { "playwright-mcp-server": { "command": "wsl", "args": [ "npx", "-y", ... ] } } }klzns commentedon Apr 18, 2025
The solution is to pass the full path to
nodein thecommandfield.I had this config:
{ "mcpServers": { "weather": { "command": "node", "args": [ "/Users/breno/projects/mcp-server/build/index.js" ] } } }Open a terminal and run the command:
My terminal responded with:
/Users/breno/.volta/bin/nodeUse this path in the
commandfield, for example:{ "mcpServers": { "weather": { "command": "/Users/breno/.volta/bin/node", "args": [ "/Users/breno/projects/mcp-server/build/index.js" ] } } }fangfsz commentedon Apr 27, 2025
我这里分享下我是如何解决了,我的IDE是Trae国际版,也是用fnm来管理nodejs版本的。在使用Trae国际版安装mcp server时,同样遇到了“ spawn npx ENOENT ”的问题,经过一番折腾,我解决了这个问题,希望对你有所帮助。
Powershell7 和Terminal 都正常识别 fnm, Trae集成的Terminal也可以识别fnm. 问题大概率是MCP Server这边对Terminal里面环境变量或者是配置文件的继承或者识别问题。
既然fnm可以管理多个版本的node.js,npm和npx都在相应的版本里面,我的想法就是可能会有一个路径指向当前的nodejs目录,通过
fnm env可以找到$env:FNM_DIR进入这个目录,发现有个别名文件夹,就是这里了。3. 尝试将这个路径 C:\Users[user]\AppData\Roaming\fnm\aliases\default 添加到系统环境变量PATH项下面,然后重启Trae IDE,等一会发现加npx运行的mcp server加载成功了。
h7ml commentedon Apr 30, 2025
mac 用户,使用了nrm 和 fnm 当前我的解决方案是
Penghaiku commentedon May 5, 2025
草,浪费了我这么多时间和ai逼逼,原来是这个问题。
文件系统 MCP 服务器已成功设置。以下是失败配置与成功配置的完整示例及详细解释:
1. 失败的配置示例(直接使用
npx){ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "C:/Users/Betterman/Desktop" ], "disabled": false, "autoApprove": [] } } }npx。问题在于 VS Code 启动 MCP 服务器时所在的子进程环境的 PATH 环境变量可能不完整,导致操作系统无法找到npx可执行文件,从而引发底层spawn npx ENOENT错误,最终表现为“未连接”错误。这与您在 PowerShell 终端中能成功运行npx的情况不同,反映了环境差异。2. 最终成功的配置(通过
cmd /c运行npx){ "mcpServers": { "filesystem": { "command": "cmd", "args": [ "/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "C:/Users/Betterman/Desktop" ], "disabled": false, "autoApprove": [] } } }cmd.exe),它通常位于系统 PATH 中。/c参数指示cmd.exe执行后续的npx ...命令。由于cmd.exe通常继承了更完整的系统 PATH,它能够成功找到并执行npx。这种通过cmd /c间接执行的方式绕过了 VS Code 子进程环境的 PATH 限制,使得npx得以运行,服务器成功启动并连接。服务器现已正确配置并可以使用。
canyara commentedon May 7, 2025
使用nvm管理node版本,记得
nvm alias default stable。不然shell打开默认版本是8.x,没有npx..zhibisora commentedon May 7, 2025
anthropic的sdk更新之后应该已经不需要这种折中方案了,也许cline没有更新到新版sdk?
944750720 commentedon May 9, 2025
I use both of wsl2 and macos. Meanwhile, I use fnm for managing nodejs version. I met this problem on both systems. And I think I figure out the reason and solution. No matter you use cline or Cursor.
Connect MCP Servers error"spawn npx enoent"means mcp client can't correctly find npx command in your system. So if you're using fnm, don't usewhich npxto set npx path directly. This path is temporarily created by fnm so it'll outdate when restart device.The right way is to find to your fnm directory by command
which fnm. For example, mine is/Users/CHJ/.local/state/fnm_multishells/32996_1746258653075/bin/npx. Then access to/Users/CHJ/.local/share/fnm/node-version/<select a version you want to use>/installation/bin/, you should be able to see npx file. To my understanding, fnm create temporary folder based on these nodejs versions under/Users/CHJ/.local/share/fnm/.Whatever, find the npx file that is constant and permanent. Then use this path alternate the
npxin every mcp setting json.For example, in wsl2 using context7 mcp server by Cursor:
in macos using context7 mcp server by Cursor:
Hope it can help you.
DavidAGInnovation commentedon Oct 2, 2025
I've found a definitive solution for me.
Click on the Install Server VS Code button from this website: https://www.npmjs.com/package/@playwright/mcp
That should fix it!
phoulx commentedon Dec 2, 2025
On Windows: