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
{{ message }}
Repository navigation
Cannot connect to the Chrome-devtools mcp server using the claude code #182
on Mac, I did: $ sudo npx chrome-devtools-mcp@latest
then CTRL + C
then started claude and I now I see no errors
I think, the error was because when mcp starts npx chrome-devtools-mcp@latest without sudo it throw the error EACCES: permission denied, mkdir '/Users/username/.npm/_cacache/content-v2/sha512/51/20'
Reacted by hgjiec, Saberwang, Peter Park, Liu ShaoQian, Timo and Kenessary
on Mac, I did: $ sudo npx chrome-devtools-mcp@latest
then CTRL + C
then started claude and I now I see no errors
I think, the error was because when mcp starts `npx chrome-devtools-mcp@latest` without sudo it throw the error `EACCES: permission denied, mkdir '/Users/username/.npm/_cacache/content-v2/sha512/51/20'`
You generally shouldn’t use sudo with npx or npm commands. Running with sudo executes everything as root, which introduces several problems:
Security risk: Any package pulled from npm will have full system privileges, which is dangerous if dependencies are compromised.
Permission issues: It can create root-owned files inside your ~/.npm or node_modules folders, leading to “permission denied” errors when you run npm as a normal user later.
Bad practice: It forces you into a cycle where you always need sudo for npm, instead of fixing the underlying permission problem.
A better approach is to fix the ownership of your npm cache and global directories (chown -R $(whoami) ~/.npm), or use a Node version manager like nvm so everything runs under your normal user account.
I have the same problem. I use claude code in MacOS, node version is v24.9.0
I think I solved the problem using the following steps:
Check the npm version and run npm doctor:
npm -v
npm doctor
npm doctor should show all green. If not, you need to fix the reported issues.
In my case, it complained about an outdated version, so I upgraded npm.
My current version is npm v11.6.1, and my node version is v24.9.0.
Run:
npx chrome-devtools-mcp@latest --help
to see if it works.
If not, run:
claude mcp remove chrome-devtools
to remove chrome-devtools first.
Clear the npm cache:
npm cache clean --force # clear cache
npm cache verify # verify if it worked
After that, reinstall chrome-devtools.
I didn’t use Claude Code for installation, instead I used Gemini for a global install:
gemini mcp add -s user chrome-devtools npx chrome-devtools-mcp@latest
Once installation is done, run it again to check if there are errors.
At this point, it should work normally:
npx chrome-devtools-mcp@latest --help
Then install it again in Claude Code:
claude mcp add chrome-devtools npx chrome-devtools-mcp@latest
✅ At this stage, whether you use Claude Code or Gemini, your chrome-devtools MCP should show as connected.
Reacted by Junaid Ahmed, Thanawat Raibroycharoen, Abhishek Rudra, matlegli, Xavier Riu, zhyjiong, Kamal Khatwani, mrferreiradev, Detik and Andrew Magid
I will just add the above solved the issue ( #182 (comment) ) but I did have to restart VSCode / Claude Code to see it work. Before the restart, even after running all the steps it was reporting failure still.
TLDR: My root cause was due to a permissions issue, and I just had to make the locally installed Chrome MCP binary executable.
I resolved my MCP connection error (i..e. Failed to reconnect to chrome-devtools.) on my MacOS, despite having the bare minimum supported version of Node (at this time of writing) installed (v20.19.3), with thanks in part to the above comment.
My steps from error to resolution are the following:
Ran the following to see if the MCP server can run at all in isolation.
npx chrome-devtools-mcp@latest --help
Received a permissions error, which indicates that the MCP binary does not have executable permissions 🔴 📜 :
Nothing worked for me, @TheXienator comment pointed me in the right direction.
Used nvm to list down the install version and removed the unsupported version. It worked fine after that. Didn't need to reinstall Claude, but solved the issue where Claude was internally invoking mcp using an outdated node version.
Claude Code itself fixed the issue and explained it like so:
When Claude Code calls spawn('npx', [...]) without shell: true, Node tries to execute npx as a direct binary - but it's a .cmd file that requires cmd.exe to interpret it.
The fix works because node.exe is an actual executable binary, not a batch wrapper. So spawn('node', ['path/to/script.js', ...]) works without needing a shell.
TL;DR: Any MCP server that relies on .cmd wrappers (npx, npm scripts, globally installed npm packages) will fail on Windows unless you invoke node directly with the JS entrypoint path.
For me, the root cause was that Node was installed via nvm, so node/npm weren’t available in the global PATH that the app/automation tooling relies on. I fixed it by installing Node through Homebrew (system-wide) and upgrading from v20 to v24. After that, everything worked as expected.
Para mi, habia instalado con una version de nodejs 22.10 y necesitaba 22.11 actualice mi node 22.22 desinstale opencode, volvi a instalar y funcionó el mcp de chrome.
🪟 Windows + nvm-windows (nvm4w): Definitive Fix for "Failed to connect"
Spent a while debugging this silent failure and wanted to document the full picture since there's zero error output — just ✗ Failed to connect in claude mcp list. The server even logs Chrome DevTools MCP Server connected to its log file, making it look like everything's fine.
This affects anyone on Windows using nvm-windows with npx-based MCP configs — not just chrome-devtools-mcp. I had both chrome-devtools and shadcn MCPs failing silently for the same root cause, while every .exe-based MCP (context7, sequential-thinking, etc.) worked fine.
Posting here because this issue has great Windows-specific discussion already (especially @steviemcg's .cmd shim finding ☝️), and it's where people land when searching "chrome-devtools-mcp failed to connect."
Claude Code spawns MCP servers via child_process.spawn(), which does not load your shell profile or nvm-windows environment. Three things compound into a silent failure:
#
What happens
Why it breaks
1
npx on Windows is a .cmd shim
spawn('npx', [...]) without a shell can't execute .cmd files — they need cmd.exe to interpret them
2
Even with cmd /c npx, nvm-windows' PATH shimming is missing
The subprocess doesn't inherit nvm's environment, so npx may resolve to the wrong Node or fail silently
3
The server starts but never responds
It hangs during initialization — no error, no crash, no timeout message. Just eternal silence on stdout
The key insight: if claude mcp list shows all your .exe-based MCPs working but all npx-based ones failing, this is almost certainly the cause.
✅ Fix: Bypass npx entirely — use absolute paths
Step 1: Install globally
npm install -g chrome-devtools-mcp@latest
Step 2: Find your paths
where node # e.g. C:\nvm4w\nodejs\node.exe
npm root -g # e.g. C:\Users\<YOU>\AppData\Roaming\npm\node_modules
Step 3: Update your MCP config (~/.mcp.json or ~/.claude/.mcp.json)
❌ Broken — no output at all (the exact symptom of the bug).
📌 TL;DR
On Windows with nvm-windows, never use npx in MCP configs. Use absolute paths to node.exe + the package's bin script. This applies to all npx-based MCP servers, not just chrome-devtools-mcp.
Hi I'm still facing the issue on MacOS goose CLI, despite using what I think are appropriate npm and node versions. Any ideas?
The error message from your screenshot states that it detects node v.18.15.0 and encouraging you to upgrade the version to at least Node 20.19.0 (current minimum supported version), and this contradicts your statement that you think you have the appropriate node version.
Have you verified your node version? Which version of node do you claim to have that contradicts the error message?
You should be able to find this out by running node -v in your terminal.
For reference, the project README file also states the currently supported version.
Hi I'm still facing the issue on MacOS goose CLI, despite using what I think are appropriate npm and node versions. Any ideas?
The error message from your screenshot states that it detects node v.18.15.0 and encouraging you to upgrade the version to at least Node 20.19.0 (current minimum supported version), and this contradicts your statement that you think you have the appropriate node version.
Have you verified your node version? Which version of node do you claim to have that contradicts the error message?
You should be able to find this out by running node -v in your terminal.
For reference, the project README file also states the currently supported version.
@AllardQuek - Ah ok, i missed the above node -v commands from your screenshot.
I've never used goose. So after some googling, you could try to find out which node binary the goose context is referencing node to.
Apparently you may be able to run the following commands to find out:
goose run "which node"
goose run "node -v"
And see if the node binary path matches your OS context node path, to which i suspect not; which node, and if paths are different then you may need to somehow figure out how to either update the node version from within the goose contex? Or reference to the OS node binary path?
@AllardQuek - Ah ok, i missed the above node -v commands from your screenshot.
I've never used goose. So after some googling, you could try to find out which node binary the goose context is referencing node to.
Apparently you may be able to run the following commands to find out:
goose run "which node"
goose run "node -v"
And see if the node binary path matches your OS context node path, to which i suspect not; which node, and if paths are different then you may need to somehow figure out how to either update the node version from within the goose contex? Or reference to the OS node binary path?
Thanks for the tips! I managed to resolve the issue after
Running these commands
goose run --text "node -v"
goose run --text "which node"
which node
Which led me to realise that I have node installed in multiple locations. Goose was using the one at /usr/local/bin/node (installed by brew) whereas my default CLI uses the one at ~.nvm/versions/node/ (installed by nvm).
I uninstalled and remove the node files at /usr/local/bin/node and goose now defaults to the nvm node path which is of a valid version for me.
This damn MCP crashes 2-3 times a month without fail, and it's starting to annoy me. Why don't I just not jump through hoops and mess around when I'm not connected to it? What kind of MCP are you making, Google?.I use it via opencode btw
I test it and it works, but as soon as I start working, suddenly in the middle of my workflow it says "not connected" or times out. I swear, I'm losing my patience.
Activity
ronantakizawa commentedon Sep 27, 2025
@codeugar Check to make sure you are running Node version >=v22.12.0 as required in the project. That fixed it for me.
allenzhuyi commentedon Sep 28, 2025
I have the same problem. I use claude code in windows,node version is v22.17.1
imxiaohan commentedon Sep 28, 2025
I have the same problem. I use claude code in MacOS, node version is v24.9.0
cenyuus commentedon Sep 28, 2025
this solve my problem 👍
kurdin commentedon Sep 28, 2025
on Mac, I did:
$ sudo npx chrome-devtools-mcp@latestthen CTRL + C
then started
claudeand I now I see no errorsI think, the error was because when mcp starts
npx chrome-devtools-mcp@latestwithout sudo it throw the errorEACCES: permission denied, mkdir '/Users/username/.npm/_cacache/content-v2/sha512/51/20'imxiaohan commentedon Sep 29, 2025
You generally shouldn’t use sudo with npx or npm commands. Running with sudo executes everything as root, which introduces several problems:
Security risk: Any package pulled from npm will have full system privileges, which is dangerous if dependencies are compromised.
Permission issues: It can create root-owned files inside your ~/.npm or node_modules folders, leading to “permission denied” errors when you run npm as a normal user later.
Bad practice: It forces you into a cycle where you always need sudo for npm, instead of fixing the underlying permission problem.
A better approach is to fix the ownership of your npm cache and global directories (chown -R $(whoami) ~/.npm), or use a Node version manager like nvm so everything runs under your normal user account.
imxiaohan commentedon Sep 29, 2025
I think I solved the problem using the following steps:
Check the npm version and run npm doctor:
npm doctor should show all green. If not, you need to fix the reported issues.
In my case, it complained about an outdated version, so I upgraded npm.
My current version is npm v11.6.1, and my node version is v24.9.0.
Run:
to see if it works.
If not, run:
to remove chrome-devtools first.
Clear the npm cache:
After that, reinstall chrome-devtools.
I didn’t use Claude Code for installation, instead I used Gemini for a global install:
Once installation is done, run it again to check if there are errors.
At this point, it should work normally:
Then install it again in Claude Code:
✅ At this stage, whether you use Claude Code or Gemini, your chrome-devtools MCP should show as connected.
sebastianbenz commentedon Sep 29, 2025
Closing as the issues seem to be resolved.
ikushlianski commentedon Oct 1, 2025
I was using 22.5.1 and it was failing. Updating to 22.20 (basically latest) fixed the issue.
nkovacic commentedon Oct 4, 2025
Using latest node 22 version solved this issue for me as well.
MarkEdmondson1234 commentedon Oct 14, 2025
I will just add the above solved the issue ( #182 (comment) ) but I did have to restart VSCode / Claude Code to see it work. Before the restart, even after running all the steps it was reporting failure still.
Sayvai commentedon Oct 15, 2025
TLDR: My root cause was due to a permissions issue, and I just had to make the locally installed Chrome MCP binary executable.
I resolved my MCP connection error (i..e.
Failed to reconnect to chrome-devtools.) on my MacOS, despite having the bare minimum supported version of Node (at this time of writing) installed (v20.19.3), with thanks in part to the above comment.My steps from error to resolution are the following:
Ran the following to see if the MCP server can run at all in isolation.
Received a permissions error, which indicates that the MCP binary does not have executable permissions 🔴 📜 :
Copied and pasted the personal unique path to the binary from the error output above, and ran the following to make the binary executable:
Ran the following to see whether I get the proper help options output (which did output successfully ✅):
Go back to Claude Code terminal chat session, and run the following to verify connection to the MCP server:
/mcpcommandchrome-devtoolsfrom the optionsReconnectYou should now see the successful message 👉
Reconnected to chrome-devtools.👈 output within your Claude Code chat session 🎉PS: At no point did i have to restart Claude Code or VS Code, nor run a single sudo command.
4 remaining items
iamlakshya commentedon Nov 11, 2025
Nothing worked for me, @TheXienator comment pointed me in the right direction.
Used nvm to list down the install version and removed the unsupported version. It worked fine after that. Didn't need to reinstall Claude, but solved the issue where Claude was internally invoking mcp using an outdated node version.
steviemcg commentedon Dec 19, 2025
For people in my situation where we are stuck using Windows without WSL2, I had to solve it this way:
Claude Code itself fixed the issue and explained it like so:
When Claude Code calls spawn('npx', [...]) without shell: true, Node tries to execute npx as a direct binary - but it's a .cmd file that requires cmd.exe to interpret it.
The fix works because node.exe is an actual executable binary, not a batch wrapper. So spawn('node', ['path/to/script.js', ...]) works without needing a shell.
TL;DR: Any MCP server that relies on .cmd wrappers (npx, npm scripts, globally installed npm packages) will fail on Windows unless you invoke node directly with the JS entrypoint path.
josharagon commentedon Jan 13, 2026
cheers
baurine commentedon Jan 23, 2026
Switch node from 20 to 24 resolved my issue.
Rabbitzzc commentedon Feb 25, 2026
like trae...
siddiqss commentedon Mar 2, 2026
For me, the root cause was that Node was installed via nvm, so
node/npmweren’t available in the global PATH that the app/automation tooling relies on. I fixed it by installing Node through Homebrew (system-wide) and upgrading from v20 to v24. After that, everything worked as expected.zirtrex commentedon Mar 21, 2026
Para mi, habia instalado con una version de nodejs 22.10 y necesitaba 22.11 actualice mi node 22.22 desinstale opencode, volvi a instalar y funcionó el mcp de chrome.
Ishannaik commentedon Mar 26, 2026
🪟 Windows + nvm-windows (nvm4w): Definitive Fix for "Failed to connect"
Spent a while debugging this silent failure and wanted to document the full picture since there's zero error output — just
✗ Failed to connectinclaude mcp list. The server even logsChrome DevTools MCP Server connectedto its log file, making it look like everything's fine.This affects anyone on Windows using nvm-windows with
npx-based MCP configs — not just chrome-devtools-mcp. I had bothchrome-devtoolsandshadcnMCPs failing silently for the same root cause, while every.exe-based MCP (context7, sequential-thinking, etc.) worked fine.Posting here because this issue has great Windows-specific discussion already (especially @steviemcg's
.cmdshim finding ☝️), and it's where people land when searching "chrome-devtools-mcp failed to connect."🔍 Environment
🧩 Root Cause
Claude Code spawns MCP servers via
child_process.spawn(), which does not load your shell profile or nvm-windows environment. Three things compound into a silent failure:npxon Windows is a.cmdshimspawn('npx', [...])without a shell can't execute.cmdfiles — they needcmd.exeto interpret themcmd /c npx, nvm-windows' PATH shimming is missingnpxmay resolve to the wrong Node or fail silentlyThe key insight: if
claude mcp listshows all your.exe-based MCPs working but allnpx-based ones failing, this is almost certainly the cause.✅ Fix: Bypass
npxentirely — use absolute pathsStep 1: Install globally
Step 2: Find your paths
Step 3: Update your MCP config (
~/.mcp.jsonor~/.claude/.mcp.json){ "mcpServers": { "chrome-devtools": { "command": "C:\nvm4w\nodejs\node.exe", "args": [ "C:\Users\<YOU>\AppData\Roaming\npm\node_modules\chrome-devtools-mcp\build\src\bin\chrome-devtools-mcp.js", "--isolated", "--no-usage-statistics" ] } } }🧪 Verify before restarting Claude Code
You can test the MCP handshake manually:
✅ Working — you'll see:
{"result":{"protocolVersion":"2024-11-05","capabilities":{"logging":{},"tools":{"listChanged":true}},"serverInfo":{"name":"chrome_devtools","version":"0.20.3"}},"jsonrpc":"2.0","id":1}❌ Broken — no output at all (the exact symptom of the bug).
📌 TL;DR
Related issues: modelcontextprotocol/servers#64, modelcontextprotocol/servers#3460, modelcontextprotocol/servers#40
AllardQuek commentedon Apr 1, 2026
Hi I'm still facing the issue on MacOS goose CLI, despite using what I think are appropriate npm and node versions. Any ideas?
Sayvai commentedon Apr 1, 2026
The error message from your screenshot states that it detects node
v.18.15.0and encouraging you to upgrade the version to at least Node20.19.0(current minimum supported version), and this contradicts your statement that you think you have the appropriate node version.Have you verified your node version? Which version of node do you claim to have that contradicts the error message?
You should be able to find this out by running
node -vin your terminal.For reference, the project README file also states the currently supported version.
AllardQuek commentedon Apr 1, 2026
As per my screenshot, my node version is
24.4.1Sayvai commentedon Apr 1, 2026
@AllardQuek - Ah ok, i missed the above
node -vcommands from your screenshot.I've never used goose. So after some googling, you could try to find out which node binary the goose context is referencing node to.
Apparently you may be able to run the following commands to find out:
And see if the node binary path matches your OS context node path, to which i suspect not;
which node, and if paths are different then you may need to somehow figure out how to either update the node version from within the goose contex? Or reference to the OS node binary path?AllardQuek commentedon Apr 2, 2026
Thanks for the tips! I managed to resolve the issue after
Which led me to realise that I have node installed in multiple locations. Goose was using the one at
/usr/local/bin/node(installed by brew) whereas my default CLI uses the one at~.nvm/versions/node/(installed by nvm)./usr/local/bin/nodeand goose now defaults to the nvm node path which is of a valid version for me.Thanks for your help!
void0x14 commentedon Apr 25, 2026
This damn MCP crashes 2-3 times a month without fail, and it's starting to annoy me. Why don't I just not jump through hoops and mess around when I'm not connected to it? What kind of MCP are you making, Google?.I use it via opencode btw
I test it and it works, but as soon as I start working, suddenly in the middle of my workflow it says "not connected" or times out. I swear, I'm losing my patience.
kashif-kwanso commentedon Jul 10, 2026
Following up on this, if you have done this, also restart the editor so it reflects the newly used node inside it