Skip to content

Commit b4a1c9c

Browse files
committed
docs: add VM-to-host remote debugging workaround
1 parent 0498611 commit b4a1c9c

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Add the following config to your MCP client:
4848
}
4949
```
5050

51-
> [!NOTE]
51+
> [!NOTE]
5252
> Using `chrome-devtools-mcp@latest` ensures that your MCP client will always use the latest version of the Chrome DevTools MCP server.
5353
5454
### MCP Client configuration
@@ -134,7 +134,7 @@ Configure the following fields and press `CTRL+S` to save the configuration:
134134
<summary>Copilot / VS Code</summary>
135135
Follow the MCP install <a href="https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server">guide</a>,
136136
with the standard config from above. You can also install the Chrome DevTools MCP server using the VS Code CLI:
137-
137+
138138
```bash
139139
code --add-mcp '{"name":"chrome-devtools","command":"npx","args":["chrome-devtools-mcp@latest"]}'
140140
```
@@ -207,9 +207,9 @@ Alternatively, follow the <a href="https://docs.qoder.com/user-guide/chat/model-
207207

208208
<details>
209209
<summary>Visual Studio</summary>
210-
210+
211211
**Click the button to install:**
212-
212+
213213
[<img src="https://img.shields.io/badge/Visual_Studio-Install-C16FDE?logo=visualstudio&logoColor=white" alt="Install in Visual Studio">](https://vs-open.link/mcp-install?%7B%22name%22%3A%22chrome-devtools%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22chrome-devtools-mcp%40latest%22%5D%7D)
214214
</details>
215215

@@ -230,7 +230,7 @@ Check the performance of https://developers.chrome.com
230230

231231
Your MCP client should open the browser and record a performance trace.
232232

233-
> [!NOTE]
233+
> [!NOTE]
234234
> The MCP server will start the browser automatically once the MCP client uses a tool that requires a running browser instance. Connecting to the Chrome DevTools MCP server on its own will not automatically start the browser.
235235
236236
## Tools
@@ -386,7 +386,7 @@ Add the `--browser-url` option to your MCP client configuration. The value of th
386386

387387
**Step 2: Start the Chrome browser**
388388

389-
> [!WARNING]
389+
> [!WARNING]
390390
> Enabling the remote debugging port opens up a debugging port on the running browser instance. Any application on your machine can connect to this port and control the browser. Make sure that you are not browsing any sensitive websites while the debugging port is open.
391391
392392
Start the Chrome browser with the remote debugging port enabled. Make sure to close any running Chrome instances before starting a new one with the debugging port enabled. The port number you choose must be the same as the one you specified in the `--browser-url` option in your MCP client configuration.
@@ -423,6 +423,8 @@ Your MCP client should connect to the running Chrome instance and receive a perf
423423

424424
For more details on remote debugging, see the [Chrome DevTools documentation](https://developer.chrome.com/docs/devtools/remote-debugging/).
425425

426+
If you hit VM-to-host port forwarding issues, see the “Remote debugging between virtual machine (VM) and host fails” section in [`docs/troubleshooting.md`](./docs/troubleshooting.md#remote-debugging-between-virtual-machine-vm-and-host-fails).
427+
426428
## Known limitations
427429

428430
### Operating system sandboxes

docs/troubleshooting.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,14 @@ npm cache clean --force
2727
This indicates that the browser could not be started. Make sure that no Chrome
2828
instances are running or close them. Make sure you have the latest stable Chrome
2929
installed and that [your system is able to run Chrome](https://support.google.com/chrome/a/answer/7100626?hl=en).
30+
31+
### Remote debugging between virtual machine (VM) and host fails
32+
33+
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:
34+
35+
```sh
36+
ssh -N -L 127.0.0.1:9222:127.0.0.1:9222 <user>@<host-ip>
37+
```
38+
39+
Point the MCP connection inside the VM to `http://127.0.0.1:9222` and DevTools
40+
will reach the host browser without triggering the Host validation.

0 commit comments

Comments
 (0)