Session-local Chrome launcher for Chrome DevTools MCP workflows.
Project description
chrome-devtools-mcp-canpoint
Session-local Chrome launcher for Chrome DevTools MCP workflows.
- Repository: https://github.com/mjwyr/chrome-devtools-mcp-canpoint.git
- Author: 若清风
This wrapper starts one dedicated Chrome process per MCP server process. Each
session gets its own random remote debugging port and a generated user data
directory under the current working directory, so multiple agent sessions do not
fight over port 9222 or a shared Chrome profile. On Windows it also resolves
common command shims such as npx.cmd, so downstream MCP commands can be passed
as normal argument lists.
Usage
Run it directly with uvx:
uvx chrome-devtools-mcp-canpoint -- <downstream-mcp-command>
Example:
uvx chrome-devtools-mcp-canpoint -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
If Chrome is not installed in the default Windows location, pass it explicitly:
uvx chrome-devtools-mcp-canpoint --chrome-path "D:\Apps\Chrome\chrome.exe" -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
Codex MCP Config
After publishing to PyPI, configure Codex like this:
[mcp_servers.chrome-devtools]
command = "uvx"
args = [
"chrome-devtools-mcp-canpoint",
"--",
"npx",
"-y",
"chrome-devtools-mcp@latest",
"--browser-url={browser_url}",
"--no-usage-statistics"
]
startup_timeout_sec = 60
Claude Code MCP Config
Claude Code stores global MCP server entries in ~/.claude.json under
mcpServers. A matching entry looks like this:
{
"mcpServers": {
"chrome-devtools": {
"type": "stdio",
"command": "uvx",
"args": [
"chrome-devtools-mcp-canpoint",
"--",
"npx",
"-y",
"chrome-devtools-mcp@latest",
"--browser-url={browser_url}"
],
"env": {}
}
}
}
Add it from PowerShell to avoid Git Bash/MSYS path conversion changing /c-style
arguments:
claude mcp add chrome-devtools -- uvx chrome-devtools-mcp-canpoint -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
For older wrapper versions that do not resolve Windows command shims, use the temporary workaround below. It should not be needed after this package version is installed:
claude mcp add chrome-devtools -- uvx chrome-devtools-mcp-canpoint -- cmd /c npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
Session Profile Directory
By default, generated Chrome profiles are created under:
<current-working-directory>/.chrome-mcp-sessions/<uuid>
Override the parent directory with --session-root:
uvx chrome-devtools-mcp-canpoint --session-root .\.chrome-mcp-sessions -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
Use --user-data-dir only when you want an exact profile directory instead of a
generated per-session subdirectory.
Chrome Profile Modes
The default profile mode is isolated. It creates a fresh project-local Chrome
profile for each MCP session and deletes it when the downstream MCP exits. This
keeps concurrent agent sessions from sharing ports, cookies, locks, or profile
state.
Use inherit when you explicitly want the MCP-controlled Chrome to use an
existing local Chrome user data directory directly:
uvx chrome-devtools-mcp-canpoint --profile-mode inherit -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
By default, the source user data directory is detected from the local platform:
- Windows:
%LOCALAPPDATA%\Google\Chrome\User Data - macOS:
~/Library/Application Support/Google/Chrome - Linux:
~/.config/google-chrome
Override detection or select a non-default profile with:
uvx chrome-devtools-mcp-canpoint --profile-mode inherit --source-user-data-dir "C:\Users\me\AppData\Local\Google\Chrome\User Data" --source-profile "Profile 1" -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
Use copy when you want a generated session profile prefilled from an existing
Chrome profile:
uvx chrome-devtools-mcp-canpoint --profile-mode copy --source-profile "Default" -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
Safe copy mode includes regular profile files such as bookmarks and preferences, but excludes caches, lock files, cookies, sessions, web data, and saved-login databases. To copy those sensitive databases too, opt in explicitly:
uvx chrome-devtools-mcp-canpoint --profile-mode copy --include-sensitive-profile-data -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
Security notes:
inheritexposes the real Chrome profile, including cookies, sessions, saved passwords, and browsing state, to the downstream MCP process.inheritcan conflict with an already running Chrome instance that uses the same user data directory.copy --include-sensitive-profile-datacopies sensitive databases into the temporary session profile, but Chrome encryption may still prevent copied passwords or cookies from being usable in the new session.- Copied temporary profiles are deleted after exit unless
--keep-profileis set.
Environment Passed to the Downstream MCP
The downstream command receives these variables:
CHROME_DEVTOOLS_URL:http://127.0.0.1:<random-port>BROWSER_URL: same value asCHROME_DEVTOOLS_URLCHROME_REMOTE_DEBUGGING_PORT: selected portCHROME_USER_DATA_DIR: session profile path
Configure the real Chrome MCP package to use one of these values as its browser endpoint. This wrapper also expands placeholders in downstream command arguments:
{browser_url}or{devtools_url}:http://127.0.0.1:<random-port>{port}: selected port{user_data_dir}: generated profile path
Cleanup
When the downstream MCP exits, this wrapper terminates only the Chrome process it started. Temporary profiles are deleted by default.
Use --keep-profile when debugging:
uvx chrome-devtools-mcp-canpoint --keep-profile -- npx -y chrome-devtools-mcp@latest --browser-url={browser_url}
Options
uvx chrome-devtools-mcp-canpoint --help
Useful options:
--chrome-path: path to Chrome; defaults toCHROME_PATHor common install paths--profile-mode:isolated,inherit, orcopy; defaults toisolated--source-user-data-dir: Chrome user data root forinheritorcopy--source-profile: Chrome profile directory name, defaultDefault--include-sensitive-profile-data: include cookies, sessions, and saved-login databases incopymode--session-root: parent directory for generated project-local profiles--user-data-dir: explicit profile directory instead of a generated one--keep-profile: leave the temporary profile on disk--headless: start Chrome with--headless=new--chrome-arg: pass extra arguments to Chrome, repeatable--devtools-timeout: seconds to wait for/json/version
Development
Use the project virtual environment for local development:
.\.venv\Scripts\python.exe -m pip install -e .
.\.venv\Scripts\python.exe -m unittest discover -v
.\.venv\Scripts\chrome-devtools-mcp-canpoint.exe --help
Build distributions:
.\.venv\Scripts\python.exe -m build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chrome_devtools_mcp_canpoint-0.1.1.tar.gz.
File metadata
- Download URL: chrome_devtools_mcp_canpoint-0.1.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6296018c6c53c8fc36a4ecd4514d15d2d2ff4b0d218d100dbfd802a5f1511b3d
|
|
| MD5 |
f886aa865171a605f824dc22b9ac58d6
|
|
| BLAKE2b-256 |
06abdfa4d220b7e8a7ba89ec98f52a271bfdd814784706830515d741c0d96547
|
File details
Details for the file chrome_devtools_mcp_canpoint-0.1.1-py3-none-any.whl.
File metadata
- Download URL: chrome_devtools_mcp_canpoint-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83b373db2fb63749890d0aa91c48cdbedef7820ec276163afefab12f8795a726
|
|
| MD5 |
80dd5822561f8def2dc956b5d2f6a23f
|
|
| BLAKE2b-256 |
c66ec35dcff9271180e75f84fd6cf3fcd8d33afd3e8fa31ce29e8852f34ed537
|