BrowserTwin
OfficialBrowserTwin’s MCP server lets an agent drive a local Chrome profile in task spaces, inspect pages, act on them, and hand control back and forth with the user.
Run browser scripts: execute BrowserTwin SDK JavaScript with top-level await via
run_script, batching navigation, actions, waits, and snapshots, returning console output and errors.Inspect pages: take text/accessibility snapshots in
tree,summary,text,list,tables, orpairsformats, with selectors, limits, deltas, layer/popup info, and character caps.Take screenshots: capture PNG screenshots of a page in a controlled task space.
Perform page actions: click, fill, press keys, select options, check/uncheck, and wait, with optional settling after clicks/keys.
Manage task spaces: list spaces, ownership/control state, and tabs/URLs for spaces the agent controls.
Support human hand-off: wait for the user to return control after the agent hands it off, up to a timeout, without taking control back.
Drives the Chrome already installed on the machine, launched in a dedicated profile over a CDP pipe, to run agent browser tasks: task spaces (windows and tabs belonging to one agent task), page snapshots with element refs, screenshots, and control hand-off between the agent and the person at the keyboard.
BrowserTwin
BrowserTwin™ lets AI agents drive the Chrome that is already installed on a computer, in a dedicated profile, and hand control back and forth with the person at the keyboard. The person can watch every step, take over at any time, and give control back when they are done.
It runs locally. There is no cloud service, no remote browser and no account.
Why we built it
We wanted an agent browser that fits into how you already work:
No new browser to install. BrowserTwin drives the Chrome you already have, in its own profile, so your everyday Chrome stays untouched.
One line to install, nothing to configure. No admin rights, no separate runtime: the installer puts everything in your user folder and brings its own Node.js (installers).
You and the agent take turns. Hand the window over, step in, and hand it back at any time.
Built to be embedded. Ship the engine inside your own app under a clear license: the AGPL-3.0, or a commercial license for closed-source products. See docs/embedding.md.
Related MCP server: chrome-faithful
What is in it
Engine: a daemon that starts Chrome over a CDP pipe, keeps task spaces (windows and tabs that belong to one agent task), tracks who is in control, and shows that on the page.
CLI
btwin: runs agent scripts against the engine (btwin nodejs), prints the usage guide for agents (btwin skill), sets up profiles and sign-in (btwin setup), and updates itself.MCP server (
btwin mcp): the same engine as a local stdio MCP server.Host API (
hostapi/1): a local socket API for apps that embed the engine or show its state.Tray / menu bar app (Tauri): status, task list, hand-off bar, settings.
Chrome extension: the toolbar button and page layer of the dedicated profile.
Prebuilt installers for macOS and Windows are attached to the releases of this repository.
Try the MCP server
BrowserTwin is listed in the Glama MCP directory. There you can browse the server's tools and check its quality score, and try it online with MCP Inspector.
Status
Beta (0.1.x). Interfaces in hostapi/1 only grow (fields and methods are added, never removed
or changed). Everything else may still change between beta versions; see the changelog in
packaging/public/CHANGELOG.md.
Requirements
Node.js 24 or newer (
.nvmrc)Google Chrome (stable) for running; tests in
npm testdo not start ChromeGit (the build fetches the pinned SDK sources, see below)
For the tray app: Rust (stable) and the platform toolchain (Xcode command line tools on macOS, MSVC Build Tools on Windows)
Build
npm ci
npm run build:sdk # builds the script SDK (packages/sdk) into dist/sdk
npm run build # TypeScript workspaces
npm test # unit and contract tests, no real browser
cargo build --manifest-path apps/menubar/Cargo.tomlThe script SDK in packages/sdk/ is derived from an MIT-licensed SDK (see
packages/sdk/LICENSE and THIRD_PARTY_NOTICES.md).
Run a development build:
node packages/cli/dist/bin.js setup # create the dedicated profile, sign in once
node packages/cli/dist/bin.js nodejs < packaging/public/examples/02-screenshot.mjs
node packages/cli/dist/bin.js skill # usage guide for agentsMore examples: packaging/public/examples. The agent guide is
packaging/skill/SKILL.md; its references/ files are added when the
release is packaged (scripts/release/render-skill.mjs), so those links work only in an installed copy.
Release packaging (npm run package:mac, npm run package:win) needs signing keys; the steps are
in the header comments of scripts/release/package.mjs and
.github/workflows/release.yml.
Repository layout
Path | What it is |
| Shared interfaces, IPC framing, paths, host API types, i18n tables (generated) |
| The engine ( |
| Script process: runs agent scripts with the SDK against the daemon |
| Page snapshot engine (text and element refs from |
| Dedicated profile store and non-secret import from other browsers |
| In-page status layer (edge highlight, agent pointer) |
| Companion Chrome extension (MV3) |
|
|
| Local stdio MCP server |
| TypeScript reference client of the host API |
| Tray / menu bar app (Tauri, Rust + HTML) |
| Minimal host API viewer for manual checks |
| UI strings, one file per language ( |
| Installers, one-line install scripts, MCP bundle, public release files |
| Build, SDK fetch, release tooling |
| Contract, corpus, chaos and integration tests |
Embedding the engine in another app
See docs/embedding.md for the options an embedding app sets (no BrowserTwin UI, own data folder, own server name, updates off) and docs/hostapi.md for the socket protocol. The engine never exposes cookies, page storage or passwords through any API.
Security
Report vulnerabilities privately; see SECURITY.md.
Contributing
Bug reports and ideas go to the issues of this repository. See CONTRIBUTING.md.
License
Draft wording, to be reviewed by a lawyer before publication.
BrowserTwin is free software under the GNU AGPL-3.0 (AGPL-3.0-only). You can install and use it at home or at work, for any purpose, at no cost.
If you want to embed BrowserTwin in a product you distribute, or run a modified version as a network service, without publishing your source under the AGPL, a commercial license is available. See COMMERCIAL.md or email d2wolab@gmail.com.
Third-party components keep their own licenses: see THIRD_PARTY_NOTICES.md. The BrowserTwin name and logo are covered by TRADEMARKS.md, not by the code license.
Available Tools
6 toolslist_spacesList task spacesARead-only
List task spaces: id, name, ownership (agent, agentDelegatedToUser = the user has control, user) and, for spaces you control, their tabs with URLs.
Inputs: no named parameters.
run_actionsRun page actionsADestructive
Run a list of page actions (click, fill, press, select, check, uncheck, wait) in order in one call, on a page of a task space you control. Stops at the first failure; nothing is reordered or retried. Each step reports what changed (URL, dialog, new tab, list counts, messages); after a click or key the next step waits for the page to be quiet (≤300 ms). Stops if the user has control. For anything else use run_script.
Inputs: actions (required), space_id (required), page, settle.
run_scriptRun browser scriptADestructive
Run a BrowserTwin SDK script (JavaScript, top-level await; same API as btwin nodejs, see resource wwt-lite://guide or help()). Batch several steps into one script: open or resume a space, act, wait, then console.log what the next step needs (a snapshot last). Returns the console output and errors. If the output says the user has control, stop and tell the user.
Inputs: code (required).
screenshotPage screenshotARead-only
PNG screenshot of a page in a task space you control; default is its active page. Read-only; stops if the user has control.
Inputs: space_id (required), page.
snapshotPage snapshotARead-only
Text snapshot (accessibility tree with @refs) of a page in a task space you control (default: its active page). For an overview use format "summary" (fields with dropdown options, buttons, links). To read data use "text", "list" with a selector (one line per item), "tables" or "pairs" (JSON). Output is cut at max_chars. Read-only; stops if the user has control. In a script, print page.snapshot() last instead.
Inputs: space_id (required), page, delta, limit, +5 more.
wait_for_controlWait for controlARead-only
After handing control to the user (task.handOff({ message })), wait until they give it back in the browser, then continue. Returns when control is back or after timeout_minutes (default 10); call again to keep waiting. Never takes control back.
Inputs: space_id (required), timeout_minutes.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools have clearly distinct purposes: list_spaces, snapshot, screenshot, and wait_for_control are unambiguous. The main overlap is run_script versus run_actions, since both can click/fill/wait on pages, but the descriptions explicitly delineate the boundary (ordered action lists vs. arbitrary SDK scripting) so misselection is unlikely.
Four of six tools follow a verb_noun pattern (run_script, run_actions, list_spaces, wait_for_control), while snapshot and screenshot are bare nouns. The deviation is minor and readable, but it keeps the set from being fully uniform.
Six tools is a tight, well-scoped set for a browser-automation server: observation (snapshot, screenshot), action (run_actions, run_script), discovery (list_spaces), and handoff (wait_for_control). Each tool earns its place with no redundancy.
The surface covers the core loop of listing spaces, observing pages, acting, and handing control to the user, with run_script serving as a general escape hatch for opening/resuming spaces and other SDK operations. Explicit lifecycle tools for spaces (create/close) and navigation are absent, but agents can work around this via run_script.
Maintenance
Related MCP Connectors
Real Chrome for coding agents over MCP: browse, replay playbooks, human takeover, HIPAA & BAA.
Browser automation MCP for whole web tasks in a cloud browser: saved logins, bot checks, replays.
Cloud browsers for AI agents: get past bot detection, sign in with MFA, run web tasks at scale.
A paid remote MCP for AI agent browser MCP session, built to return verdicts, receipts, usage logs,
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI coding agents to take over a real, already-logged-in Chrome via CDP, with port lease, watchdog, and state-machine governance for concurrency and stability.1MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that gives AI agents faithful control of real, logged-in Chrome profiles via a secure local bridge and extension, with exact multi-profile routing and no debug profiles or remote debugging ports.5MIT
- AlicenseBqualityCmaintenanceA CDP-native MCP server that lets AI agents drive a real Chrome browser with deep network/console inspection, robust page interaction, and the ability to reverse-engineer a site's API flow into runnable code with dependency chaining and replay verification.5222 npm3MIT
- AlicenseNot gradedqualityAmaintenanceA local MCP server that lets AI agents and human operators drive isolated Chromium profiles with their own cookies, fingerprints, and proxies, exposing tools for navigation, clicking, typing, extraction, screenshots, JavaScript evaluation, tabs, cookies, and waits. Because session and login state persist per profile, agents can carry out real authenticated workflows across sessions.MIT