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.
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.
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.
21 tools
| Group | Tools | What they do |
|---|---|---|
| Messaging | get_pending_message · send_response · clear_messages | The loop between the side panel and Claude. Reading a message removes it from the queue. |
| Seeing the page | take_screenshot · get_dom · find_element · get_selected_text | A JPEG of the visible tab, page or element HTML, an element found from a plain description, and the text you have highlighted. |
| Debugging | get_console_log · get_network_requests · get_storage · get_performance | Console 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 code | execute_js | JavaScript in the page’s own main world, so page globals and framework stores are reachable. Results are serialised and capped at 50,000 characters. |
| Acting | click_element · fill_input · type_text · press_key · hover_element | Clicks, form fills that fire the right events for React, Vue and Angular, real keyboard input, key presses and hover. |
| Moving | scroll_page · navigate_to · wait_for_element | Scroll, 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.
# 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.
| BrowserConnect | Autonomous browser agents | |
|---|---|---|
| After each action | Nothing, unless you ask | A full screenshot |
| Console and network data | Plain text | A screenshot of DevTools |
| Agent loop | Human-driven | Autonomous, a screenshot every step |
| A 10-step automation | 0 to 1 images | About 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.