Skip to main content

MCP server for controlling Chrome over the DevTools Protocol (CDP).

Project description

chrome-remote-debugging-mcp

MCP server that controls a running Chrome over the Chrome DevTools Protocol (CDP). It connects to Chrome's remote-debugging endpoint and exposes browser control as MCP tools.

Requirements

  • Python ≥ 3.10

  • A Chrome/Chromium started with remote debugging:

    google-chrome --remote-debugging-port=9222
    

Register with an MCP client

Example mcpServers entry:

{
  "mcpServers": {
    "chrome-remote-debugging": {
      "command": "uvx",
      "args": ["chrome-remote-debugging-mcp"],
      "env": { "CDP_URL": "http://localhost:9222" }
    }
  }
}

Tools

Tool Args Returns
ping {connected, cdp_url, browser, protocol}
list_tabs {"tabs": [{id, title, url, type}, ...]}
navigate url, tab_id? {tab_id, url, frameId}
evaluate expression, tab_id? {tab_id, value, type}
cdp_command method, params?, tab_id? {tab_id, method, result}

cdp_command is a raw CDP escape hatch: pass any CDP method + params and get the raw response, for cases the typed tools above don't cover. It targets a page socket, so page-domain methods work (Page.*, DOM.*, Runtime.*, Network.*, …); browser-level domains (Browser.*, Target.*) do not.

On any Chrome connection problem a tool returns {"error": "..."} instead of crashing.

Configuration

Env var Default Meaning
CDP_URL http://localhost:9222 Chrome remote-debugging origin

SSH tunnel (optional)

To control a Chrome that only listens on a remote host's loopback, set:

Env var Default Meaning
CDP_URL http://localhost:9222 Chrome endpoint. With a tunnel active, the remote-side address to forward to.
SSH_PROXY_TO unset SSH target, e.g. user@remote. Presence enables the tunnel.
SSH_PROXY_PORT unset Fixed local port. Auto-assigned when unset.

The server runs ssh -N -L 127.0.0.1:<local>:<host>:<port> <target> and points CDP at the forwarded port. Requires key-based SSH auth (BatchMode=yes) and the ssh client on PATH. The tunnel uses StrictHostKeyChecking=accept-new (trust-on-first-use: unknown host keys are accepted automatically on first connect).

Develop

uv sync        # venv + runtime + dev group
pytest -q

Locally, from a checkout (no publish needed):

uvx --from . chrome-remote-debugging-mcp
# or
python -m chrome_remote_debugging_mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chrome_remote_debugging_mcp-0.1.0.tar.gz (99.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chrome_remote_debugging_mcp-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file chrome_remote_debugging_mcp-0.1.0.tar.gz.

File metadata

File hashes

Hashes for chrome_remote_debugging_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 77419c22175f383c948f77ca10274ea0e201d904fb5afa6f4a1e9348a785da60
MD5 b637300d7a4f0c74990a8bb4667ba200
BLAKE2b-256 8918057dbe6800586ac0f388287013ca4f4fd5389951d2fe0c63e635818c3447

See more details on using hashes here.

Provenance

The following attestation bundles were made for chrome_remote_debugging_mcp-0.1.0.tar.gz:

Publisher: publish.yml on danilin-em/chrome-remote-debugging-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chrome_remote_debugging_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chrome_remote_debugging_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d648299775496d3d5fcd7fbe1b20348cc6552e8dd6f52e2600699cd3462c408
MD5 c969677a9775178606e8fe4b46b115df
BLAKE2b-256 b62a9466e893ab5f5ecd8d1047384c3dc1eb3747ec80da587ae528f4be716e91

See more details on using hashes here.

Provenance

The following attestation bundles were made for chrome_remote_debugging_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on danilin-em/chrome-remote-debugging-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page