Skip to main content
Glama

cc-chrome-bridge

Browser control for Claude Code (and any MCP client) that uses your existing signed-in Chrome profile.

Works with Bedrock, LiteLLM, or any model backend — because the model never touches the browser at all. It only sends tool calls; a zero-dependency Node bridge forwards them to a companion Chrome extension that does the real work via CDP (Chrome DevTools Protocol) in your normal tabs. No Playwright, no fresh profile, no cookies to copy, and no first-party Anthropic API required — which is exactly why it works where Anthropic's built-in "Claude in Chrome" tool doesn't on Bedrock.

Claude Code / any MCP client          bridge-mcp.js                  your Chrome profile
        |  MCP stdio (JSON-RPC)           |                                |
        |-------------------------------->|                                |
        |   chrome_snapshot, etc.         |  long-poll GET /next?name=...  |
        |                                  |<----------------------------|
        |                                  |-- command {id,action,params} ->|
        |                                  |<- POST /result {id,ok,result}-|
        |<---------------------------------|                                |

Why not the built-in browser tool?

Claude Code's native chrome integration (--chrome-native-host) authenticates against Anthropic's first-party API. On Bedrock (or any proxy) that auth path doesn't exist, so the tool is unavailable. This project sidesteps the problem entirely: it's a dumb pipe plus an extension — model-agnostic by construction.

Related MCP server: YaviControl MCP Server

Features

  • Your real profile — signed-in sessions, cookies, and extensions are all live; no re-login, no parallel browser instance

  • DOM-based, not vision-based — chrome_snapshot returns structured text (stable element uids, visible actions, form fields), so it works with text-only models. Screenshots via CDP are available as an optional layer for multimodal models

  • Real input events — clicks/typing go through Chrome's actual input layer (CDP), satisfying normal user-activation gates; bypasses page CSP because injection happens at the browser level, not in page JavaScript

  • Background mode by default — tools never steal focus or activate tabs. New/grouped tabs join a per-session tab group ("Claude Code"). Pass "background": false on a call to allow foreground work

  • Zero dependencies — one Node file (Node 18+), no npm install

Quickstart

Requires: Node 18+, Chrome with Developer mode enabled.

git clone https://github.com/joshoq/cc-chrome-bridge
cd cc-chrome-bridge
  1. Load the extension (one-time, manual — it uses a native file picker):

    • chrome://extensions → enable Developer mode → Load unpacked → select browser-extension/

    • It appears as "CC Chrome Bridge". Keep that Chrome window open; the MV3 service worker polls the bridge.

  2. Run the bridge (keep it running — use your service manager for persistence):

    node bridge-mcp.js
    # listens on 127.0.0.1:17318, waits for MCP requests on stdin
  3. Register with Claude Code:

    claude mcp add cc-chrome -- node /path/to/cc-chrome-bridge/bridge-mcp.js

    Verify in a session with /mcp — you should see cc-chrome connected with 21 tools.

  4. Verify end-to-end: ask Claude to list your open tabs (chrome_tab, action list). The first call may take a moment while the service worker wakes up (MV3 workers sleep after ~5 min idle; any tab activity wakes them).

Other MCP clients

bridge-mcp.js is a standard MCP stdio server — point any client at it:

{ "mcpServers": { "cc-chrome": { "command": "node", "args": ["/path/to/bridge-mcp.js"] } } }

Tools (21)

Tool

Purpose

chrome_launch

Check bridge status; optionally open a URL in the existing profile

chrome_tab

List / create / activate / close / group / ungroup tabs (list, new, activate, close, group, ungroup, version)

chrome_snapshot

Agent-friendly page observation: stable uids, visible actions, form fields; zoom with mode/query/nearUid

chrome_find

Find controls/text by natural-language query → ranked matches with uids + coordinates

chrome_inspect

Deep context around one uid/selector: nearby text, actions, ancestors, suggested click target

chrome_navigate

Navigate a tab (never replaces your active tab without an explicit target); optional initScript at document_start

chrome_evaluate

Run JS in the page's MAIN world via CDP — works under strict CSP

chrome_click / chrome_type / chrome_fill / chrome_key

Real-input actions by uid, selector, or coordinate; optional fresh snapshot after

chrome_wait_for

Poll until a selector exists or an expression is truthy

chrome_list_console_messages / chrome_list_network_requests / chrome_get_network_request

Captured console + XHR/fetch activity (with response bodies)

chrome_screenshot

CDP screenshot to disk (PNG/JPEG, optional full-page tiles); no tab activation

chrome_hover / chrome_drag / chrome_tap / chrome_scroll

Pointer movement, drag, real touch events, momentum-shaped wheel scroll

chrome_upload_file

Attach local files to <input type=file> without the native picker

All tools accept optional targeting: targetId, urlIncludes, or titleIncludes. Without a target they act on this session's dedicated automation tab — never your active tab.

Security model

  • Loopback only — the bridge binds 127.0.0.1; nothing is exposed to the network

  • Origin-gated endpoints — /next and /result accept requests only from chrome-extension:// origins (403 otherwise); CORS headers are issued solely for extension origins

  • No secrets in transit — commands/results stay between your local bridge and your own browser; the model sees tool results, not raw credentials

  • The extension needs broad permissions (<all_urls>, debugger) because it performs CDP work on your behalf — load it only in a profile you trust an agent with

Environment variables

Variable

Default

Purpose

CC_CHROME_BRIDGE_PORT

17318

Bridge port. Must match the extension's hardcoded URL (service_worker.js line 1) — change both together

CC_CHROME_SESSION_KEY

claude-code

Session key scoping tabs/groups per agent session (run multiple agents with different keys to keep their tab groups separate)

Self-test (no Chrome needed)

node bridge-selftest.mjs

Exercises the full protocol on port 17999: MCP handshake, tools/list, long-poll command delivery, /result round-trip resolving a pending tool call, origin gating, and background-mode enforcement.

Troubleshooting

  • Tool times out with "extension is not polling" — the extension isn't running or its service worker is asleep. Check chrome://extensions shows CC Chrome Bridge enabled; open any tab in that profile to wake it

  • Port 17318 already in use — another bridge owns it (e.g., a Pi session on the same machine). Set CC_CHROME_BRIDGE_PORT and patch BRIDGE_URL in service_worker.js line 1 to match

  • "Tab activation is blocked by background mode" — expected. Pass "background": false in that tool call if you truly need foreground focus

License

MIT — see LICENSE.

The browser-extension/ directory is derived from pi-chrome (© pi-chrome contributors, MIT) — see browser-extension/LICENSE.

Available Tools

21 tools
chrome_clickC

Click a snapshot uid, CSS selector, or viewport coordinate using Chrome's real input layer.

Inputs: x, y, uid, selector, +7 more.

chrome_dragC

Drag from one uid/selector/point to another using Chrome pointer input.

Inputs: toX, toY, fromX, fromY, +9 more.

chrome_evaluateB

Evaluate JavaScript in an existing Chrome tab. Runs in the page context and returns JSON-serializable values.

Inputs: expression (required), targetId, background, urlIncludes, +2 more.

chrome_fillC

Set the full value of a text input, textarea, or contenteditable using Chrome click/select/delete/type input.

Inputs: text (required), uid, submit, selector, +8 more.

chrome_findB

Find matching controls/text/regions on the current Chrome page by query. Returns ranked matches with stable uids and coordinates.

Inputs: query (required), mode, targetId, background, +3 more.

chrome_get_network_requestB

Retrieve one captured fetch/XMLHttpRequest entry, including response body when available.

Inputs: requestId (required), targetId, urlIncludes, titleIncludes.

chrome_hoverB

Hover over an element by uid, selector, or x/y using Chrome pointer movement.

Inputs: x, y, uid, selector, +4 more.

chrome_inspectA

Inspect one snapshot uid or selector deeply: nearby text, nearby actions, form context, ancestors, and suggested click target.

Inputs: uid, selector, targetId, background, +3 more.

chrome_keyB

Send a keyboard key to an existing Chrome tab (Enter, Escape, Tab, Backspace, Delete, ArrowUp/Down/Left/Right, or one character).

Inputs: key (required), targetId, modifiers, background, +4 more.

chrome_launchC

Check the local bridge used by the companion Chrome extension. With url, opens it in the existing profile after connecting.

Inputs: url.

chrome_list_console_messagesC

List console messages captured in the page by the companion extension.

Inputs: clear, targetId, urlIncludes, titleIncludes.

chrome_list_network_requestsC

List fetch/XMLHttpRequest activity captured in the page by the companion extension.

Inputs: clear, targetId, urlIncludes, titleIncludes, +1 more.

chrome_navigateA

Navigate a Chrome tab to a URL. With no target, navigation goes to this session's dedicated automation tab — it never replaces the user's active tab.

Inputs: url (required), targetId, timeoutMs, background, +4 more.

chrome_screenshotB

Capture a screenshot of a Chrome tab via CDP and save it to disk without activating background tabs.

Inputs: path, format, quality, fullPage, +4 more.

chrome_scrollA

Scroll the page or a specific scrollable element by dispatching real wheel events with momentum-shaped deltas.

Inputs: uid, steps, deltaX, deltaY, +5 more.

chrome_snapshotA

Inspect a page in the existing Chrome profile. Returns an agent-friendly observation with stable uids, visible actions, form fields, and page hints. Use mode/query/nearUid to zoom instead of dumping the whole page.

Inputs: mode, query, nearUid, targetId, +7 more.

chrome_tabA

List, create, activate, close, group, ungroup, or inspect tabs in the user's existing Chrome profile. New/grouped tabs join this session's tab group. activate/close/group/ungroup require a target (targetId/urlIncludes/titleIncludes); with no target they act on this session's automation tab if one exists.

Inputs: action (required), url, targetId, background, +3 more.

chrome_tapA

Dispatch a real touchstart/touchend tap through Chrome's input layer. Use for sites that gate on TouchEvent.

Inputs: x, y, uid, selector, +4 more.

chrome_typeB

Focus an optional snapshot uid or CSS selector, then type using Chrome's real input. Set perCharacter=true for editors needing individual keydown events.

Inputs: text (required), uid, selector, targetId, +7 more.

chrome_upload_fileA

Attach local files to an element using Chrome DevTools file-input control. Does NOT open the native file picker.

Inputs: paths (required), uid, selector, targetId, +3 more.

chrome_wait_forB

Poll an existing Chrome tab until a selector exists or a JavaScript expression returns truthy.

Inputs: kind (required), value (required), targetId, timeoutMs, +3 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 21 tools

    Disambiguation4/5

    Tools are largely distinct, each targeting a specific action (click, type, fill, key, hover, drag, tap, scroll, etc.). Minor overlap exists between snapshot/find/inspect for element discovery and between fill/type for text input, but descriptions clearly differentiate them.

    Naming Consistency3/5

    Most tools follow a chrome_verb_noun pattern (navigate, evaluate, click, type, wait_for, upload_file), but a few use bare nouns (tab, snapshot, launch) which breaks consistency. Mixed conventions but still readable and predictable.

    Tool Count3/5

    21 tools is on the higher end for a server, but the breadth of Chrome automation (navigation, interaction, inspection, debugging, tab management) justifies the count. Slightly heavy but not excessive.

    Completeness4/5

    Covers a comprehensive set of browser automation capabilities: navigation, user input, element inspection, JavaScript evaluation, waiting, console/network monitoring, screenshots, file uploads, and tab management. Missing explicit cookie/storage controls, but these can be handled via evaluate.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Use your signed-in Chrome through a local MCP server and companion extension. Supports tabs, navigation, forms, screenshots, and page reading, with a deny-all domain allowlist. Install: npx -y mcp-browser-extension@latest.
      22
      177 npm
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to control an existing signed-in Chrome profile through MCP stdio, using its current tabs, cookies, and logins without pairing or a separate browser. It exposes tab management, page interaction, screenshots, and Chrome DevTools Protocol commands.
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Lets AI coding tools directly control the user's already-open, logged-in Chrome to read pages, navigate, click, type, screenshot, inspect network/storage, and automate browser tasks through local MCP tools.
      1 npm
      ISC