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
Copy file name to clipboardExpand all lines: README.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -328,6 +328,69 @@ all instances of `chrome-devtools-mcp`. Set the `isolated` option to `true`
328
328
to use a temporary user data dir instead which will be cleared automatically after
329
329
the browser is closed.
330
330
331
+
### Connecting to a running Chrome instance
332
+
333
+
You can connect to a running Chrome instance by using the `--browser-url` option. This is useful if you want to use your existing Chrome profile or if you are running the MCP server in a sandboxed environment that does not allow starting a new Chrome instance.
334
+
335
+
Here is a step-by-step guide on how to connect to a running Chrome Stable instance:
336
+
337
+
**Step 1: Configure the MCP client**
338
+
339
+
Add the `--browser-url` option to your MCP client configuration. The value of this option should be the URL of the running Chrome instance. `http://localhost:9222` is a common default.
340
+
341
+
```json
342
+
{
343
+
"mcpServers": {
344
+
"chrome-devtools": {
345
+
"command": "npx",
346
+
"args": [
347
+
"chrome-devtools-mcp@latest",
348
+
"--browser-url=http://localhost:9222"
349
+
]
350
+
}
351
+
}
352
+
}
353
+
```
354
+
355
+
**Step 2: Start the Chrome browser**
356
+
357
+
> [!WARNING]
358
+
> 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.
359
+
360
+
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.
361
+
362
+
For security reasons, [Chrome requires you to use a non-default user data directory](https://developer.chrome.com/blog/remote-debugging-port) when enabling the remote debugging port. You can specify a custom directory using the `--user-data-dir` flag. This ensures that your regular browsing profile and data are not exposed to the debugging session.
0 commit comments