Configuration Location
~/.claude.json (not ~/.claude/settings.json):
| |
Process Architecture (process tree)
| |
Key facts
- Who starts mcp-chrome-bridge? — Chrome does. Chrome reads the Native Messaging Host configuration (
/etc/opt/chrome/native-messaging-hosts/com.chromemcp.nativehost.json) and automatically launches mcp-chrome-bridge as a child process at startup. - Shared or one per Claude session? — Shared. There is only one daemon. It has been running since July 19, and all Claude sessions connect to the same
127.0.0.1:12306. - Are Chrome and mcp-chrome-bridge independent processes? — They have a parent-child relationship. Chrome is the parent; mcp-chrome-bridge is the child.
Three-tier Interaction Architecture
| |
Native Messaging Protocol
This is the standard mechanism for communication between a Chrome extension and a local program. It is a pipe, not a network port.
Registration
The Native Messaging Host configuration file tells Chrome how to start the local program:
/etc/opt/chrome/native-messaging-hosts/com.chromemcp.nativehost.json
| |
type: "stdio"— communicates over stdin/stdoutpath— the program Chrome should launchallowed_origins— only the specified extension may connect
Message format
| |
- Write a 4-byte little-endian integer indicating the length of the JSON that follows.
- Write the JSON string.
- The receiver reads 4 bytes to get the length, then reads exactly that many bytes of JSON.
Chrome Extension API
The Chrome extension establishes a connection with chrome.runtime.connectNative('com.chromemcp.nativehost'), which returns a Port object. It communicates through port.postMessage() and port.onMessage.
Full Request Flow (using get_windows_and_tabs as an example)
| |
Simplified data flow
| |
Network Ports
| Port | Process | Purpose |
|---|---|---|
| 12306 | MainThread (mcp-chrome-bridge) | HTTP MCP endpoint for Claude |
| (none) | Chrome extension | Communicates over stdin/stdout, no network |
Installation (other machines)
Prerequisites
- Node.js 20+
- npm / pnpm
- Chrome browser
Steps
1. Install mcp-chrome-bridge globally
| |
The postinstall script runs automatically and registers the user-level Native Messaging Host.
2. Register the Native Messaging Host
| |
After registration, a configuration file is created at ~/.config/google-chrome/NativeMessagingHosts/com.chromemcp.nativehost.json.
3. Install the Chrome extension
Install the chrome-mcp-server extension from the Chrome Web Store:
| |
In the extension management page, confirm the extension ID is hbdgbgagpkpjffpklnamcljpakneikee and that the Service Worker is running in the background.
4. Verify the installation
| |
Confirm that the key items are all [OK]:
| |
5. Configure ~/.claude.json
| |
mcp-chrome-bridgeregisters themcp-chrome-stdiocommand automatically after installation. An absolute path also works:
1/usr/local/node-v24.14.0-linux-x64/lib/node_modules/mcp-chrome-bridge/dist/mcp/mcp-server-stdio.jsFind the exact path with
npm list -g mcp-chrome-bridge.
6. Restart Chrome and Claude Code
When Chrome restarts, it automatically launches the mcp-chrome-bridge child process, which listens on port 12306. After Claude Code restarts, the chrome-control tools are available.
How It Works
| Layer | Protocol | Components |
|---|---|---|
| Claude → bridge | HTTP (port 12306) | MCP Server ↔ mcp-chrome-bridge daemon |
| Bridge → Chrome extension | Native Messaging (stdin/stdout) | Daemon ↔ Chrome Extension |
| Extension → page | CDP (Chrome DevTools Protocol) | The extension controls browser tabs through CDP |
Key points
- No
--remote-debugging-portstartup flag is required. - No socket/pipe files are involved.
- Native Messaging uses a stdin/stdout pipe; the message format is
[4-byte length][JSON]. - The Chrome extension uses CDP internally to access tabs — the same protocol used by DevTools.
What It Can Do
Tab management
| Tool | Description |
|---|---|
get_windows_and_tabs | List all windows and tabs, including URLs and titles |
chrome_switch_tab | Switch to a specific tab |
chrome_close_tabs | Close specified tabs |
chrome_navigate | Navigate the current tab to a new URL, refresh the page, or go back/forward |
Page reading
| Tool | Description |
|---|---|
chrome_read_page | Read the page’s accessibility tree to get the page structure and visible elements. Can filter to interactive elements only (buttons/links/inputs) and can extract plain text |
chrome_get_web_content | Get visible text or HTML content, with CSS selector support for specific regions |
chrome_screenshot | Capture a screenshot of the current page or a specific element |
Page interaction
| Tool | Description |
|---|---|
chrome_click_element | Click an element (CSS selector, XPath, element ref, or viewport coordinates). Supports left/right/middle button, double-click, and modifier keys (Ctrl/Shift/Alt) |
chrome_fill_or_select | Fill forms (inputs, textareas, selects, checkboxes, radio buttons) |
chrome_keyboard | Simulate keyboard input (single keys, shortcuts like Ctrl+C, text input), optionally targeting a specific element |
chrome_computer | Combined operations: mouse click/drag/scroll, keyboard input, wait, zoom, screenshot |
chrome_upload_file | Upload files through a file picker (local path, URL download, or base64 data) |
chrome_handle_dialog | Handle JavaScript dialogs (alert/confirm/prompt) by accepting or dismissing |
JavaScript execution
| Tool | Description |
|---|---|
chrome_javascript | Execute arbitrary JavaScript in the page context, with top-level await support and a return value |
Forms and network
| Tool | Description |
|---|---|
chrome_network_capture | Start/stop capturing network requests, including request/response details and optional response bodies |
chrome_console | Capture page console output (log/warn/error) in Buffer or snapshot mode |
chrome_network_request | Send network requests directly from the browser with the browser’s cookies and context |
GIF recording
| Tool | Description |
|---|---|
chrome_gif_recorder | Record a tab interaction as an animated GIF. Supports fixed-FPS mode and auto-capture mode (captures a frame after each action), with configurable FPS, duration, size, click indicators, and action labels |
Performance analysis
| Tool | Description |
|---|---|
performance_start_trace | Start a performance trace, with optional page reload and auto-stop duration |
performance_stop_trace | Stop the trace and export the Trace JSON |
performance_analyze_insight | Analyze the recorded trace and produce performance insights |
Browser management
| Tool | Description |
|---|---|
chrome_bookmark_search | Search bookmarks |
chrome_bookmark_add | Add a bookmark |
chrome_bookmark_delete | Delete a bookmark |
chrome_history | Search browsing history |
chrome_handle_download | Wait for and get download details |
What It Cannot Do
- Access pages that are not open
- Read browsing history, bookmarks, or passwords
- Install extensions or change browser settings
- Access the content of closed tabs
Limitations
JavaScript cannot run when CDP is occupied
The chrome-mcp-server extension itself holds the CDP connection. When CDP is occupied, chrome_javascript falls back to chrome.scripting.executeScript (isolated world), but in practice the fallback also fails to return results. This means that in some scenarios you cannot extract data in bulk through JavaScript.
No structured data extraction tools
| Missing capability | Impact |
|---|---|
| Built-in DOM query / CSS selector data extraction | List pages (such as torrent lists) only yield plain text, requiring an external Python script for a second parsing pass |
No page.$$eval() equivalent | There is no Playwright/Puppeteer-style way to run a selector on the page and return structured JSON |
| Unstructured return values | chrome_get_web_content and chrome_read_page both return plain text, so tabular data loses its row/column structure |
Scenario comparison
| Scenario | chrome-control | Playwright/Puppeteer |
|---|---|---|
| Clicking, filling forms, navigation | ✅ Convenient | ✅ Convenient |
| Reading visible page text | ✅ Works | ✅ Works |
| Bulk list extraction | ❌ Needs external parsing | ✅ One line with page.$$eval() |
| Operating on already-logged-in pages | ✅ Native support | ❌ You handle cookies yourself |
| Screenshots | ✅ | ✅ |
Workarounds
If you need bulk data extraction, consider a dedicated browser automation MCP:
| |
Or use a Python + Playwright script and bypass the MCP layer entirely.
Session Reuse
Login state (cookies/session) in Chrome is inherited automatically. For a site already logged in in a tab (such as M-Team), operating in that tab’s context carries the login state.
FAQ
The Chrome Control MCP server is not connected
| |
Possible causes:
- The configuration in
~/.claude.jsonwas modified or deleted - The mcp-chrome-bridge daemon is not running (nothing is listening on port 12306)
- The Chrome extension is disabled or uninstalled
- The mcp-chrome-bridge child process did not start correctly after Chrome restarted
Resolution:
- Confirm the chrome-control configuration exists in
~/.claude.json - Check whether port 12306 is listening:
ss -tlnp | grep 12306 - Check whether the Chrome extension
hbdgbgagpkpjffpklnamcljpakneikeeis enabled - Restart Chrome (this also restarts the mcp-chrome-bridge child process)
- Restart Claude Code
Tool calls fail with “Failed to connect to MCP server” / “Already connected to a transport”
Symptoms: All chrome-control tool calls fail with Failed to connect to MCP server, while claude mcp list still shows ✔ Connected.
Root cause (diagnosed on 2026-08-12): In mcp-chrome-bridge 1.0.31, the daemon (dist/server/index.js) uses a singleton MCP Server (getMcpServer() in dist/mcp/mcp-server.js) to connect every new transport in the /mcp and /sse routes. The MCP SDK’s Protocol.connect() allows only one transport (protocol.js throws “Already connected to a transport”). Once a client disconnects abnormally and the transport does not fire onclose, the singleton is stuck forever, and all subsequent connections are rejected. The daemon’s stderr log fills with ERR_HTTP_HEADERS_SENT (the old log grew beyond 200 MB).
Fix (patched in dist/):
dist/mcp/mcp-server.js: add acreateMcpServer()factory that returns an independent Server instance with tools registered each timedist/server/index.js: change the/mcpand/sseroutes to usecreateMcpServer()(instead ofgetMcpServer()), giving each connection its own Serverdist/server/index.jsGET/mcproute: remove the manual SSE header pre-write (setHeader/flushHeaders) and hand header writing entirely to the SDK transport afterreply.hijack(), eliminatingERR_HTTP_HEADERS_SENT
Verification: single end-to-end connection ✓, 3 concurrent clients all connected ✓, zero errors in the log ✓.
Note: The patch modifies the compiled dist/ output directly, so upgrading the npm package overwrites it. Re-apply the patch after upgrading. The backup made during the fix has been deleted; back up with cp before changing anything.
Recovery steps:
- Kill the broken daemon (the Chrome extension will automatically reconnect and start a new one):
1 2ss -tlnp | grep 12306 # find the pid kill <pid> - If a session still cannot connect (its stdio client cached the old connection), restart that Claude session or reconnect via
/mcp.
Chrome does not respond to operations
If an operation hangs and never returns, possible causes:
- A dialog is open on the page (alert/confirm/prompt)
- The page is still loading
- An unclosed modal is present
Resolution: use chrome_handle_dialog to handle dialogs, or close them manually and retry.
Element not found
If chrome_read_page does not return the target element:
- The element is outside the viewport; scroll to it with
scroll_toand retry - The element is inside an iframe; specify
frameId - The page is a dynamically loaded SPA; wait for the data to load before reading
Relationship with Other MCPs
| MCP | Configuration file | Purpose | Startup |
|---|---|---|---|
| chrome-control | ~/.claude.json | Browser control | Chrome launches it as a child process at startup |
| browsermcp | ~/.claude/settings.json | General browser control | Started on demand |
| mysql | ~/.claude/settings.json | MySQL database | Started on demand |
The three run independently and do not affect each other.
@playwright/mcp
Configuration
Installation (already installed):
| |
Key parameters:
| Parameter | Value | Description |
|---|---|---|
--browser chrome | chrome | Use the system-installed Chrome instead of Playwright’s bundled Chromium |
--user-data-dir | Existing Chrome profile dir | Reuse the existing Chrome user data (cookies, login state, and extensions all inherited) |
--headless | Headless mode | No visible browser window, saves resources; remove it to run with a UI |
Comparison with chrome-control
| Feature | chrome-control | @playwright/mcp |
|---|---|---|
| Attach to existing browser | ✅ Attaches to the Chrome you are using | ❌ Starts its own instance |
| Reuse login state | ✅ Inherited automatically | ✅ Inherited via --user-data-dir |
| JavaScript execution | ❌ CDP is occupied by the extension | ✅ Fully functional |
| CDP conflicts | ❌ Conflicts with chrome-mcp-server | ✅ Exclusive CDP |
| Data extraction | Plain text, needs a second pass | Returns structured JSON directly |
| DOM queries | No built-in tool | ✅ Arbitrary queries with page.evaluate() |
| Startup | Chrome child process, always running | On demand (npx) |
Installation (other machines)
| |