Skip to main content
Glama

mcp-chrome-cdp

MCP server that gives AI agents full control over Chrome through the Chrome DevTools Protocol. Direct WebSocket connection to Chrome — no Puppeteer, no Playwright, no overhead.

54 tools across 12 categories: navigation, screenshots, JavaScript execution, DOM queries, input simulation, network monitoring, console capture, cookie/storage management, device emulation, performance metrics, accessibility, and browser control.

Quick Start

1. Start Chrome with remote debugging

# macOS
open -a "Google Chrome" --args --remote-debugging-port=9222

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

# Windows
start chrome --remote-debugging-port=9222

2. Install

git clone https://github.com/YosephFr/mcp-chrome-cdp.git
cd mcp-chrome-cdp
npm install

3. Add to Claude Code

Create or edit ~/.mcp.json:

{
  "mcpServers": {
    "chrome-cdp": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-chrome-cdp/index.js"]
    }
  }
}

Restart Claude Code. Verify with /mcp — you should see chrome-cdp connected.

4. Configuration

The server connects to 127.0.0.1:9222 by default. Override with environment variables:

{
  "mcpServers": {
    "chrome-cdp": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-chrome-cdp/index.js"],
      "env": {
        "CDP_HOST": "127.0.0.1",
        "CDP_PORT": "9222"
      }
    }
  }
}

Related MCP server: Chrome DevTools MCP

Tools

Tabs

Tool

Description

chrome_list_tabs

List all open tabs and targets

chrome_new_tab

Open a new tab with optional URL

chrome_close_tab

Close a tab by ID

chrome_activate_tab

Bring a tab to the foreground

Navigation

Tool

Description

chrome_navigate

Navigate to a URL (waits for page load)

chrome_reload

Reload the page, optionally bypassing cache

chrome_go_back

Navigate back in history

chrome_go_forward

Navigate forward in history

chrome_get_url

Get the current URL

chrome_wait

Wait for a selector to appear or a fixed delay

Screenshots & PDF

Tool

Description

chrome_screenshot

Capture PNG/JPEG/WebP screenshot (viewport, full page, or clipped region)

chrome_pdf

Generate PDF of the current page

JavaScript & DOM

Tool

Description

chrome_evaluate

Execute arbitrary JavaScript in the page context

chrome_query_selector

Find elements by CSS selector, return HTML or attributes

chrome_get_text

Get visible text content of the page or an element

chrome_get_html

Get outerHTML or innerHTML of the page or an element

chrome_get_page_info

Get URL, title, meta tags, forms, links, and page dimensions

chrome_find_elements

Find interactive elements (buttons, links, inputs) with coordinates

Input

Tool

Description

chrome_click

Click by CSS selector or coordinates (left/right/middle, double-click)

chrome_hover

Hover over an element

chrome_type

Type text into a focused element or selector

chrome_key_press

Press keys or combos (Enter, Tab, Ctrl+A, etc.)

chrome_scroll

Scroll the page or a specific element

chrome_set_input_value

Set input values programmatically (React/Vue/Angular compatible)

chrome_drag_drop

Drag from one point to another

chrome_touch

Dispatch touch events for mobile emulation

Network Monitoring

Tool

Description

chrome_network_enable

Start capturing network requests and responses

chrome_network_disable

Stop network monitoring

chrome_network_get_log

Get captured traffic, filter by URL, limit results

chrome_network_get_response_body

Get the response body for a specific request

chrome_set_extra_headers

Set custom HTTP headers on all requests

chrome_emulate_network

Simulate slow 3G, offline mode, custom latency

Console

Tool

Description

chrome_console_enable

Start capturing console messages

chrome_console_get_log

Get captured messages, filter by level

chrome_console_clear

Clear the console

Cookies & Storage

Tool

Description

chrome_get_cookies

Get cookies for current page or specific URLs

chrome_set_cookie

Set a cookie with full options

chrome_delete_cookies

Delete specific cookies or clear all

chrome_local_storage

Get, set, remove, clear, or list localStorage keys

chrome_clear_storage

Clear all site data for an origin (cookies, localStorage, cache, indexedDB)

Device Emulation

Tool

Description

chrome_emulate_device

Set viewport size, device scale factor, mobile mode

chrome_reset_device

Reset to real device metrics

chrome_set_user_agent

Override the User-Agent string

chrome_set_geolocation

Override GPS coordinates

chrome_set_timezone

Override timezone

chrome_emulate_media

Set media type (print/screen) and features (dark mode, etc.)

Performance & Accessibility

Tool

Description

chrome_performance_metrics

Get JS heap size, DOM nodes, layout counts, script duration

chrome_accessibility_tree

Get the full accessibility tree (roles, names, values)

Security & Advanced

Tool

Description

chrome_handle_dialog

Accept or dismiss alert/confirm/prompt dialogs

chrome_inject_script

Inject JS that runs before page scripts on every navigation

chrome_set_bypass_csp

Bypass Content Security Policy

chrome_ignore_certificate_errors

Ignore SSL/TLS certificate errors

Browser

Tool

Description

chrome_browser_info

Get browser version, protocol version, V8 version

chrome_set_window_bounds

Resize, move, minimize, maximize, or fullscreen the window

Architecture

Claude Code  <-->  MCP (stdio)  <-->  Chrome CDP (WebSocket)
                    index.js          ws://127.0.0.1:9222
  • Single persistent WebSocket connection per tab (auto-reconnects on tab switch)

  • Network and console events are captured in-memory and served on demand

  • No browser process management — connects to an already-running Chrome instance

  • Zero dependencies beyond the MCP SDK and ws

Requirements

  • Node.js >= 18

  • Chrome, Chromium, or Edge running with --remote-debugging-port=9222

  • Claude Code (or any MCP-compatible client)

License

MIT

Available Tools

54 tools
chrome_accessibility_treeC

Get the accessibility tree of the page (structured semantic content)

Inputs: tabId.

chrome_activate_tabC

Bring a tab to the foreground

Inputs: tabId (required).

chrome_browser_infoC

Get browser version and info

Inputs: no named parameters.

chrome_clear_storageB

Clear site data (cookies, localStorage, sessionStorage, indexedDB, cache, etc.)

Inputs: origin (required), tabId, storageTypes.

chrome_clickB

Click an element by CSS selector or coordinates

Inputs: x, y, tabId, button, +2 more.

chrome_close_tabC

Close a browser tab

Inputs: tabId (required).

chrome_console_clearC

Clear the console

Inputs: tabId.

chrome_console_enableC

Start capturing console messages

Inputs: tabId.

chrome_console_get_logC

Get captured console messages

Inputs: clear, level, limit.

chrome_delete_cookiesC

Delete cookies by name or clear all

Inputs: url, name, path, tabId, +2 more.

chrome_drag_dropC

Drag from one point to another

Inputs: toX (required), toY (required), fromX (required), fromY (required), +1 more.

chrome_emulate_deviceC

Set device viewport, scale, and mobile mode

Inputs: width (required), height (required), tabId, mobile, +1 more.

chrome_emulate_mediaC

Set media type and features (e.g., dark mode, print)

Inputs: media, tabId, features.

chrome_emulate_networkB

Simulate network conditions (slow 3G, offline, etc.)

Inputs: tabId, latency, offline, uploadThroughput, +1 more.

chrome_evaluateC

Execute JavaScript in the page context

Inputs: expression (required), tabId, awaitPromise, returnByValue.

chrome_find_elementsC

Find interactive elements on the page (buttons, links, inputs, etc.)

Inputs: type, tabId, visible.

chrome_get_cookiesB

Get cookies for the current page or specific URLs

Inputs: urls, tabId.

chrome_get_htmlC

Get the HTML of the page or an element

Inputs: outer, tabId, selector.

chrome_get_page_infoC

Get comprehensive info about the current page: URL, title, meta tags, links, forms

Inputs: tabId.

chrome_get_textB

Get the visible text content of the page or an element

Inputs: tabId, selector.

chrome_get_urlC

Get the current URL of a tab

Inputs: tabId.

chrome_go_backC

Navigate back in history

Inputs: tabId.

chrome_go_forwardC

Navigate forward in history

Inputs: tabId.

chrome_handle_dialogB

Accept or dismiss a JavaScript dialog (alert, confirm, prompt)

Inputs: accept (required), tabId, promptText.

chrome_hoverC

Hover over an element

Inputs: x, y, tabId, selector.

chrome_ignore_certificate_errorsC

Ignore SSL/TLS certificate errors

Inputs: ignore (required), tabId.

chrome_inject_scriptB

Inject a script that runs before any page script on every navigation

Inputs: source (required), tabId.

chrome_key_pressB

Press a key or key combination (Enter, Tab, Escape, Ctrl+A, etc.)

Inputs: key (required), tabId, modifiers.

chrome_list_tabsB

List all open browser tabs/targets

Inputs: no named parameters.

chrome_local_storageC

Get or set localStorage values

Inputs: action (required), key, tabId, value.

chrome_navigateC

Navigate to a URL in a tab

Inputs: url (required), tabId.

chrome_network_disableC

Stop monitoring network requests

Inputs: tabId.

chrome_network_enableC

Start monitoring network requests

Inputs: tabId.

chrome_network_get_logC

Get captured network requests/responses

Inputs: clear, limit, filter.

chrome_network_get_response_bodyC

Get the response body for a specific network request

Inputs: requestId (required), tabId.

chrome_new_tabC

Open a new tab with optional URL

Inputs: url.

chrome_pdfC

Generate PDF of the current page

Inputs: tabId, landscape, printBackground.

chrome_performance_metricsC

Get page performance metrics

Inputs: tabId.

chrome_query_selectorC

Find element(s) by CSS selector and return their HTML

Inputs: selector (required), all, tabId, attribute.

chrome_reloadC

Reload the current page

Inputs: tabId, ignoreCache.

chrome_reset_deviceC

Reset device emulation to real device metrics

Inputs: tabId.

chrome_screenshotC

Take a screenshot of the current page

Inputs: clip, tabId, format, quality, +1 more.

chrome_scrollC

Scroll the page or an element

Inputs: x, y, tabId, selector.

chrome_set_bypass_cspD

Bypass Content Security Policy

Inputs: enabled (required), tabId.

chrome_set_extra_headersC

Set extra HTTP headers for all requests

Inputs: headers (required), tabId.

chrome_set_geolocationC

Override geolocation

Inputs: latitude (required), longitude (required), tabId, accuracy.

chrome_set_input_valueB

Set an input field value programmatically (works with React/Vue/Angular)

Inputs: value (required), selector (required), tabId.

chrome_set_timezoneC

Override timezone

Inputs: timezoneId (required), tabId.

chrome_set_user_agentC

Override the User-Agent string

Inputs: userAgent (required), tabId, platform.

chrome_set_window_boundsC

Resize or move the browser window

Inputs: top, left, tabId, width, +2 more.

chrome_touchC

Dispatch touch events (for mobile emulation)

Inputs: x (required), y (required), type (required), tabId.

chrome_typeC

Type text into a focused element or selector

Inputs: text (required), tabId, selector, clearFirst.

chrome_waitC

Wait for a condition: selector appears, navigation, or fixed time

Inputs: delay, tabId, timeout, selector.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.5/5.0

    Scored across 54 tools

    Disambiguation3/5

    Most tools have clear distinct actions, but there is a significant overlap cluster for content extraction (chrome_get_text, chrome_get_html, chrome_query_selector, chrome_get_page_info, chrome_find_elements, chrome_accessibility_tree) where an agent could easily pick the wrong one. Input/interaction tools (click, touch, drag_drop) and storage tools (local_storage, clear_storage, cookies) also have partially overlapping boundaries, though descriptions mitigate this.

    Naming Consistency4/5

    All tools share a consistent chrome_ prefix and snake_case naming, which is highly predictable. Minor deviations exist where some names are noun-only (chrome_pdf, chrome_screenshot, chrome_wait) or use non-verb forms (chrome_new_tab, chrome_go_back), but overall the pattern is readable and stable.

    Tool Count2/5

    54 tools is well above the 25+ threshold and feels heavy for a browser automation surface, with several niche capabilities (timezone, geolocation, bypass_csp, ignore_certificate_errors) that could be consolidated. While a CDP server legitimately spans many domains, the sheer count increases selection burden.

    Completeness4/5

    Coverage is broad: navigation, tabs, input, screenshots/PDF, network and console monitoring, cookies/storage, emulation, performance, and accessibility. Minor gaps exist around request interception/mocking (only monitoring and header overrides), iframe/frame switching, and file upload/download, but agents can work around most of these.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI clients to control the user's already-open, logged-in browser pages in real time over a local WebSocket channel, without Playwright, Puppeteer, Selenium, or any browser driver. Exposes tools for navigation, semantic page snapshots, clicking, form filling, JavaScript evaluation, screenshots, network monitoring, cookie handling, and tab management via the CDP.
      20
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to drive the user's already-running Google Chrome through a WebSocket bridge, listing and switching tabs, navigating, clicking, typing, scrolling, extracting DOM, taking screenshots, and evaluating JavaScript. It works without restarting Chrome and preserves all existing logins, cookies, and 2FA sessions.
      25
      MIT