BrowserTwin
Official# 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](https://github.com/d2wolab/browsertwin/releases/latest)).
- **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](LICENSE), or a [commercial license](COMMERCIAL.md) for closed-source products.
See [docs/embedding.md](docs/embedding.md).
## 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](https://github.com/d2wolab/browsertwin/releases/latest).
## Try the MCP server
[](https://glama.ai/mcp/servers/d2wolab/browsertwin)
BrowserTwin is listed in the [Glama MCP directory](https://glama.ai/mcp/servers/d2wolab/browsertwin). There you can browse the server's tools and check its quality score, and try it online with [MCP Inspector](https://glama.ai/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](packaging/public/CHANGELOG.md).
## Requirements
- Node.js 24 or newer (`.nvmrc`)
- Google Chrome (stable) for running; tests in `npm test` do not start Chrome
- Git (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
```sh
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.toml
```
The script SDK in `packages/sdk/` is derived from an MIT-licensed SDK (see
[packages/sdk/LICENSE](packages/sdk/LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)).
Run a development build:
```sh
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 agents
```
More examples: [packaging/public/examples](packaging/public/examples/). The agent guide is
[packaging/skill/SKILL.md](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](scripts/release/package.mjs) and
[.github/workflows/release.yml](.github/workflows/release.yml).
## Repository layout
| Path | What it is |
|---|---|
| `packages/protocol` | Shared interfaces, IPC framing, paths, host API types, i18n tables (generated) |
| `packages/daemon` | The engine (`wwt-browserd`): Chrome launch, task spaces, control hand-off, host API |
| `packages/worker` | Script process: runs agent scripts with the SDK against the daemon |
| `packages/snapshot` | Page snapshot engine (text and element refs from `Page.getAnnotatedPageContent`) |
| `packages/profile` | Dedicated profile store and non-secret import from other browsers |
| `packages/overlay` | In-page status layer (edge highlight, agent pointer) |
| `packages/extension` | Companion Chrome extension (MV3) |
| `packages/cli` | `btwin` CLI |
| `packages/mcp` | Local stdio MCP server |
| `packages/hostapi-client` | TypeScript reference client of the host API |
| `apps/menubar` | Tray / menu bar app (Tauri, Rust + HTML) |
| `tools/viewer` | Minimal host API viewer for manual checks |
| `i18n/` | UI strings, one file per language (`node scripts/make-i18n.mjs` writes the copies) |
| `packaging/` | Installers, one-line install scripts, MCP bundle, public release files |
| `scripts/` | Build, SDK fetch, release tooling |
| `test/` | Contract, corpus, chaos and integration tests |
## Embedding the engine in another app
See [docs/embedding.md](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](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](SECURITY.md).
## Contributing
Bug reports and ideas go to the
[issues of this repository](https://github.com/d2wolab/browsertwin/issues). See
[CONTRIBUTING.md](CONTRIBUTING.md).
## License
> Draft wording, to be reviewed by a lawyer before publication.
BrowserTwin is free software under the [GNU AGPL-3.0](LICENSE) (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](COMMERCIAL.md) or email d2wolab@gmail.com.
Third-party components keep their own licenses: see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
The BrowserTwin name and logo are covered by [TRADEMARKS.md](TRADEMARKS.md), not by the code license.
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.