Skip to content

Chrome extension + MCP

BrowserConnect

A Chrome extension and MCP server that gives Claude Code eyes and hands in a live browser: screenshots, console, network, click, fill.

Architecture

A side panel in Chrome passes messages and actions to a loopback Express bridge, which holds requests open so replies land instantly with no fixed polling. Claude reads them over MCP (stdio) and dispatches the right tool.

Tools

21 tools including navigate, click, fill, type, screenshot, get_console_log, get_network_requests, get_dom and execute_js.

Distribution and security

Published on npm with 18 versions (npm install -g browserconnect), source-available under the Elastic License 2.0. Loopback only (127.0.0.1:21277), zero telemetry, a per-start session token and a check that rejects any origin that is not a Chrome extension.

Proof

Used throughout the IndiaNIC AI deck itself for screenshots, console logs and live clicks.

21MCP tools for seeing and driving the browser
18published npm versions, current 1.1.8
192-bitsession token, regenerated at every start
150 / 200console and network entries kept
0telemetry: everything stays on your machine
1Node process runs both the MCP server and the bridge

Architecture

BrowserConnect is a two-way bridge between Claude and a live Chrome tab. They never talk directly. One Node process speaks MCP to Claude over stdio and plain HTTP to the extension over a loopback port, and an in-memory queue decouples the two sides.

BrowserConnect: Claude talks MCP over stdio to one Node process, which bridges over a loopback HTTP port to the Chrome extension and the live tab browserconnect · one Node process Chrome extension · Manifest V3 HTTP Claude Code MCP clientover stdio mcp.js 21 tools queue.js in-memorysingleton server.js Express127.0.0.1:21277 Security layer 192-bit session token, new at every start, sent as X-BC-TokenCORS preflight rejects any origin that is not an extensionloopback only: never reachable from the network Side panel panel.js · long-polls Service worker background.js Content scripts console · network · overlay Live Chrome tab the page you are on
Claude Code, the Node process and the extension. The queue is the only link between the MCP half and the HTTP half.

Three communication patterns

Everything reduces to one of three patterns. The extension holds an open request until data is ready, instead of polling on a timer, which is why replies feel instant.

BrowserConnect's three communication patterns: message, pull and push, each held open by a long-poll so replies arrive immediately Message · you talk to Claude You type in the side panel POST /message text + screenshots queue holds the message Claude get_pending_message Reply send_response → /response Pull · Claude asks for data Claude asks get_console_log, … queue requestConsole Panel long-poll /console-pending Tab reads fresh data POST /console fulfils Claude’s call Push · Claude acts on the page Claude acts click, fill, navigate, … queue requestAction Panel long-poll /action-pending Tab runs the action POST /action returns the result
Message, pull and push. Each is a long-poll on one side and a queue promise on the other.

21 tools

GroupToolsWhat they do
Messagingget_pending_message · send_response · clear_messagesThe loop between the side panel and Claude. Reading a message removes it from the queue.
Seeing the pagetake_screenshot · get_dom · find_element · get_selected_textA JPEG of the visible tab, page or element HTML, an element found from a plain description, and the text you have highlighted.
Debuggingget_console_log · get_network_requests · get_storage · get_performanceConsole entries with stack traces, fetch and XHR calls with status and timing, localStorage, sessionStorage and cookies, and Core Web Vitals with the slowest resources.
Running codeexecute_jsJavaScript in the page’s own main world, so page globals and framework stores are reachable. Results are serialised and capped at 50,000 characters.
Actingclick_element · fill_input · type_text · press_key · hover_elementClicks, form fills that fire the right events for React, Vue and Angular, real keyboard input, key presses and hover.
Movingscroll_page · navigate_to · wait_for_elementScroll, load a URL and wait for it, and poll for an element after an async render (5 s by default, 15 s at most).

Rules shipped with it tell Claude to reach for the right tool without being asked: console for a JavaScript error, network for an API failure, storage for a lost session, performance for a slow page.

The extension

Side panel

A chat UI docked in Chrome beside every tab. It holds all the HTTP client logic: the handshake, the long-polling and executing actions in the active tab.

Service worker

Keeps the connection alive, adds an “Ask Claude” context-menu entry, captures screenshots and buffers errors.

Injector and listener split

A script in the page’s MAIN world hooks console and fetch/XHR but cannot use chrome APIs. A listener in the ISOLATED world can, and relays through postMessage. Both run at document_start so nothing fires before the hooks.

Annotation overlay

A canvas on the page for drawing arrows and boxes on a screenshot before it is sent.

Capture tools

Annotate

A full-tab screenshot with arrows, boxes and text drawn on top.

Region select

Drag a crosshair over just the element or area that matters.

Full-page capture

Scrolls the page and stitches a composite, so content below the fold is included.

Screen recorder

Hold R to record a film strip and release to send the frames. All captures are compressed before upload.

Security model

Loopback only

The bridge binds 127.0.0.1 and is never exposed to the network.

Session token

A fresh 192-bit random value at each start. Every endpoint except /health needs it as X-BC-Token.

Origin check

The custom header forces a CORS preflight. The server rejects it unless the origin is a chrome-extension URL, which stops web pages from injecting messages or forging results, even with multipart forms.

No telemetry

No cloud service and no analytics. Data goes only to Claude, through your own MCP connection.

The trust boundary

It defends against malicious web content, not against software already running as you. Any local process under your user can request a token.

A known residual

The extension-origin allowlist is not yet pinned to this extension’s ID, because it has no stable store ID yet. Until then, keep installed extensions to ones you trust.

Running Claude on a remote machine

Claude Code can run on a headless Linux server while the browser stays on your laptop. The server is pure Node and needs no browser, and an SSH tunnel carries the loopback port back to your local Chrome.

remote usage
# on your laptop: forward the bridge port, then run Claude on the remote
$ ssh -L 21277:localhost:21277 user@remote-machine
$ claude
✔ the remote Claude now sees and controls your local browser

Token efficiency

By design it is text-first and human-driven, so it spends far fewer image tokens than tools that screenshot after every step.

BrowserConnectAutonomous browser agents
After each actionNothing, unless you askA full screenshot
Console and network dataPlain textA screenshot of DevTools
Agent loopHuman-drivenAutonomous, a screenshot every step
A 10-step automation0 to 1 imagesAbout 10 full-page images

Distribution

npm package

Installed with npm. browserconnect --init writes the MCP config and adds usage notes to the project’s CLAUDE.md, so a team member needs one command per project. Cursor works the same way through its own MCP config.

Licence

Source-available under the Elastic License 2.0. It is free to use, but it is not an OSI open-source licence.

Stack

Chrome Manifest V3Side Panel APIchrome.scriptingNode.js 18+ExpressMCP SDK (stdio)multerJestnpm

browserconnect.net