browser-ext-agent
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@browser-ext-agent navigate to localhost:3000, click the login button, and capture console errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
browser-ext-agent
Let your AI agent drive your real browser — via a Chrome extension, only while you have it enabled.
agent ⇄ MCP (stdio) ⇄ server (Node) ⇄ WebSocket ⇄ Chrome extension (MV3) ⇄ web pageBuilt for debugging: your agent reads the page, clicks, types, scrolls, screenshots, and reads console logs — on the browser that already has your sessions, extensions and login state. No headless setup, no re-authentication.
Highlights
Consent by default — the extension connects only after you click Enable in its popup. Turn it off and every tool call fails immediately. The agent has no way to enable itself.
Secret protection — input values are never returned to the agent (
value=•••), password/OTP/card fields are masked entirely, screenshots blur sensitive fields before capture, and token-like strings (sk-…,Bearer …, AWS keys, JWTs) are redacted from page text.Token-cheap observations — the agent sees a compact text outline with stable element refs (
[ref=e12] button "Place order"), not raw HTML. Screenshots on demand.Console capture —
console.*output and uncaught exceptions are buffered per tab and readable via a tool. Made for debugging apps in the page.One npm package — MCP server + WebSocket server ship as a single
npx-able binary; the extension installs unpacked.
Related MCP server: byob
Tools exposed to the agent
Tool | What it does |
| Open a URL (returns title + url + snapshot) |
| Text outline of interactive elements + text, each with a |
| Act on an element by |
| Scroll; wait for text or a selector |
| PNG of the tab (sensitive fields pre-masked) |
| Tab management |
| Captured console logs / exceptions per tab |
Setup
Zero-to-running guide: SETUP.md. Quick version:
1. Compile & run the server
pnpm install
pnpm build
node packages/server/release/index.js # MCP on stdio + WS on ws://localhost:8765Options: --port, --host (bind non-localhost requires --token), or env PORT / HOST / EXT_TOKEN / SECRET_CONFIG_PATH.
2. Install the extension
Chrome → chrome://extensions → Developer mode → Load unpacked → packages/extension/release/
3. Connect
Click the extension icon → server URL (default is already right for localhost) → token if the server requires one → Enable. The badge shows ON while connected.
4. Add the MCP server to your agent
# straight from GitHub — no clone needed
claude mcp add browser-ext-agent -- npx -y github:haipham22/browser-ext-agent
# or from a local clone (while developing)
claude mcp add browser-ext-agent -- node /absolute/path/packages/server/release/index.jsThen try: browser_navigate → browser_snapshot → browser_click → browser_console_logs.
Security model
Redaction happens inside the content script — the last layer before data leaves your browser. The server and agent never have a code path to the raw values.
Known limits (stated plainly): if a page displays a secret as plain text (e.g. a token printed on a dashboard), it can appear in a snapshot — token-pattern redaction mitigates common formats. There are deliberately no tools for cookies, localStorage, network traffic or history. Tune the extra guards via SECRET_CONFIG_PATH (JSON with blockedDomains, blockedSelectors, sensitivePatterns regexes).
Architecture
packages/shared— zod protocol (commands/responses), central error codes, secret config, scenario schema (v2-ready)packages/server— WebSocket server + bridge + 12 MCP tools in one Node processpackages/extension— MV3 service worker (WS client, router), content script (snapshot refs, redact, actions, console capture), popup
Design decisions and rationale: context/DECISIONS.md. Architecture doc: context/ARCHITECTURE.md.
Development
pnpm test # 16 tests across the 3 packages
pnpm --filter @haipham22/browser-ext-agent-extension exec tsc --noEmit # typecheck
cd packages/extension && node compile.mjs # rebuild extension bundlePlanned (v2): scenario runner — a scenario is just a JSON list of steps reusing the same command protocol (scenarioSchema is already in shared).
License
Available Tools
12 toolsbrowser_clickB
Click an element by ref from the last snapshot. Returns action result + fresh snapshot.
Inputs: ref (required), tabId.
browser_console_logsB
Read captured console logs (log/info/warn/error, uncaught exceptions) from a tab — for debugging.
Inputs: level, since, tabId.
browser_screenshotB
Screenshot the current tab (PNG, sensitive fields are masked). Returns an image.
Inputs: tabId.
browser_scrollC
Scroll the page up/down. Returns new scroll position.
Inputs: direction (required), tabId, amount.
browser_snapshotA
Text outline of the page: interactive elements + meaningful text, each with a ref like [ref=e12]. Use refs for click/type. Long pages are paginated — pass offset from the footer to get the next page.
Inputs: tabId, offset.
browser_tab_closeB
Close a browser tab (defaults to the active tab).
Inputs: tabId.
browser_tab_listA
List open browser tabs (id, title, url, active).
Inputs: no named parameters.
browser_tab_newC
Open a new browser tab, optionally with a URL.
Inputs: url.
browser_tab_selectC
Focus a browser tab by id.
Inputs: tabId (required).
browser_typeB
Type text into an input/textarea by ref. submit=true presses Enter. Returns result + fresh snapshot.
Inputs: ref (required), text (required), tabId, submit.
browser_wait_forC
Wait until text appears or a CSS selector matches (after navigation/loading).
Inputs: text, tabId, selector, timeoutMs.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool maps to a distinct action on a distinct resource: navigation, snapshot, click, type, scroll, screenshot, wait, console logs, and explicit tab lifecycle operations. The only mild overlap is browser_navigate vs browser_tab_new, but the descriptions clearly differentiate opening a URL from creating a blank/optionally-URL tab.
All names use a consistent browser_ prefix and snake_case, with tab operations cleanly grouped as browser_tab_*. A few names are noun-style (browser_snapshot, browser_screenshot, browser_console_logs) rather than verb_noun, but the overall pattern remains predictable.
Twelve tools is well within the ideal 3-15 range for a browser automation server. Each tool covers a necessary capability—interaction, inspection, waiting, and tab management—without redundant entries.
Core agent browser workflows are covered: navigate, observe via snapshot/screenshot, click/type/scroll, wait, console debugging, and full tab lifecycle. Minor gaps exist around hover, dropdown selection, key presses, JS evaluation, and back/forward/reload navigation, but most can be worked around.
Maintenance
Related MCP Connectors
Let AI agents use your real, signed-in Chrome: tabs, clicks, forms, screenshots and video.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Let your AI agent operate any website through a real, logged-in browser session.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to directly control your real Chrome browser with full context including login sessions, cookies, and open tabs. It provides tools for page scanning, JavaScript execution, CDP control, screenshots, and physical mouse/keyboard input for authentic browser automation.20243MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to drive the user's real, already-logged-in Chrome browser locally, so they can read and navigate pages, click, type, fill forms, take screenshots, and inspect cookies, tabs, console, and network traffic without headless browsers or remote-debugging ports.1 npmISC
- AlicenseNot gradedqualityAmaintenanceLets AI agents control the real, already-logged-in Chrome browser: reading pages, clicking, typing, navigating tabs, taking screenshots, and inspecting cookies, network traffic, console output, and storage. It connects as a local extension over Native Messaging, so no remote-debugging port or headless profile is needed.1 npmISC
- AlicenseNot gradedqualityAmaintenanceLets AI agents drive the user's real Chromium browser, including opening and controlling tabs, taking screenshots, capturing network traffic, recording screen activity, and handing control back for logins or payments while using the user's existing sessions, logins, and extensions.1,134MIT