chromedevtools--chrome-devtools-mcp
9f9dab0787
I think this part should be included in the document, I investigated it for a long time at first, and it's not just me: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/328 https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/131 https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/139
41 行
1.6 KiB
Markdown
41 行
1.6 KiB
Markdown
# Troubleshooting
|
|
|
|
## General tips
|
|
|
|
- Run `npx chrome-devtools-mcp@latest --help` to test if the MCP server runs on your machine.
|
|
- Make sure that your MCP client uses the same npm and node version as your terminal.
|
|
- When configuring your MCP client, try using the `--yes` argument to `npx` to
|
|
auto-accept installation prompt.
|
|
- Find a specific error in the output of the `chrome-devtools-mcp` server.
|
|
Usually, if you client is an IDE, logs would be in the Output pane.
|
|
|
|
## Specific problems
|
|
|
|
### `Error [ERR_MODULE_NOT_FOUND]: Cannot find module ...`
|
|
|
|
This usually indicates either a non-supported Node version is in use or that the
|
|
`npm`/`npx` cache is corrupted. Try clearing the cache, uninstalling
|
|
`chrome-devtools-mcp` and installing it again. Clear the cache by running:
|
|
|
|
```sh
|
|
rm -rf ~/.npm/_npx # NOTE: this might remove other installed npx executables.
|
|
npm cache clean --force
|
|
```
|
|
|
|
### `Target closed` error
|
|
|
|
This indicates that the browser could not be started. Make sure that no Chrome
|
|
instances are running or close them. Make sure you have the latest stable Chrome
|
|
installed and that [your system is able to run Chrome](https://support.google.com/chrome/a/answer/7100626?hl=en).
|
|
|
|
### Remote debugging between virtual machine (VM) and host fails
|
|
|
|
When connecting DevTools inside a VM to Chrome running on the host, any domain is rejected by Chrome because of host header validation. Tunneling the port over SSH bypasses this restriction. In the VM, run:
|
|
|
|
```sh
|
|
ssh -N -L 127.0.0.1:9222:127.0.0.1:9222 <user>@<host-ip>
|
|
```
|
|
|
|
Point the MCP connection inside the VM to `http://127.0.0.1:9222` and DevTools
|
|
will reach the host browser without triggering the Host validation.
|