# Your Browser Agent Connect AI apps to your browser to automate tasks and testing. Your Browser Agent is an MCP server + Chrome extension that lets AI applications like **Claude, Cursor, VS Code, and Windsurf** drive your real, logged-in Chrome browser — automation happens locally on your machine, so your browser activity stays private and you stay logged into everything. ## Why Your Browser Agent - **Fast** — automation runs locally, no network hop to a remote browser. - **Private** — nothing leaves `127.0.0.1`; no accounts, no cloud. - **Logged in** — uses your existing Chrome profile and sessions. - **Stealthy** — drives your real browser fingerprint, avoiding basic bot detection. ## How it works ``` ┌──────────────┐ MCP ┌────────────────┐ WebSocket ┌──────────────────┐ │ AI app │ ─────────────>│ MCP server │ ─────────────> │ Chrome extension │ │ (Claude, ...) │ stdio │ (spawned by │ 127.0.0.1 │ (your browser) │ └──────────────┘ │ the AI app) │ ws://…:7799/ext└──────────────────┘ └────────────────┘ ``` ## Multiple agents, one browser Each AI app spawns its own copy of the MCP server, but only one browser connection can exist at a time. To make that transparent, the first instance to start becomes the **hub** (it owns the real connection to the extension); every later instance detects the hub and becomes a lightweight **follower** that proxies its tool calls through it instead of fighting over the port. Concurrently driving different tabs works too — the extension keeps a separate debugger session per tab, so one agent's tab doesn't interrupt another's. If the hub's AI app closes, the next follower automatically takes over as the hub. Each spawned server instance is also its own identified agent: the extension remembers each agent's own last-used tab separately, so if one agent omits `tabId` on a call, it still lands on *that agent's* tab — not whichever tab another agent (or the browser's focus) most recently touched. Commands are queued **per tab**, not globally — a slow or stuck command on one tab (e.g. a heavy news site still loading) no longer blocks unrelated commands on other tabs. Within a single tab, commands still run one at a time for CDP safety. ## Get started ### 0. Requirements - **Google Chrome** (or another Chromium browser: Edge, Brave, ...) - **Node.js ≥ 18** installed and on your `PATH` — that's it. The MCP server is a single pre-built file with everything bundled in; there's no `npm install` step for end users. ### 1. Install the extension 1. Open `chrome://extensions` 2. Turn on **Developer mode** (top right) 3. Click **Load unpacked** and select the **`extension/`** folder from this repository 4. Pin the **Your Browser Agent** icon to the toolbar > You'll see a permission warning for the `debugger` API — that's what powers > trusted clicks/typing on your behalf. See [Security](#security). ### 2. Set up the MCP server Add Your Browser Agent to your AI app's MCP configuration, pointing at the pre-built server bundle: `extension/server/dist/mcp-server.mjs` (no install step — it's a single self-contained file). **Claude Desktop** — edit `claude_desktop_config.json`: ```json { "mcpServers": { "your-browser-agent": { "command": "node", "args": ["/absolute/path/to/YourBrowserAgent/extension/server/dist/mcp-server.mjs"] } } } ``` **Cursor / Windsurf** — same `mcpServers` block in their MCP settings. **VS Code** — add to `.vscode/mcp.json` (workspace) or User Settings → MCP: ```json { "servers": { "your-browser-agent": { "command": "node", "args": ["/absolute/path/to/YourBrowserAgent/extension/server/dist/mcp-server.mjs"] } } } ``` Restart/reload the app so it picks up the new server. ### 3. Connect the extension Click the **Your Browser Agent** icon → press **Connect**. The dot turns green once your AI app has started the MCP server and the extension can reach it. Press **Disconnect** any time to stop the browser from being controllable — it stays disconnected until you press Connect again. ### 4. Start automating Ask your AI app to use the browser — e.g. *"open gmail and tell me the last email"*, *"fill out this form and submit it"*, *"take a screenshot of this page"*. It calls the tools below directly; no extra prompting needed. ## Browser tools **Tabs & navigation** | Tool | What it does | | --- | --- | | `tabs` | List open tabs | | `newTab` / `goto` | Open a URL in a fresh tab / navigate an existing one | | `activate` / `closeTab` | Focus a tab / close a tab | | `reload` / `back` / `forward` | Reload / history navigation | **Reading the page** | Tool | What it does | | --- | --- | | `snapshot` | Accessibility-style snapshot with stable refs (e1, e2, ...) for interactive elements. Pass `diff:true` to get only what changed since your last snapshot of that tab | | `snapshotMany` | Snapshot several tabs in one call (default: all open tabs) — handy when running multiple tasks/agents at once | | `readPage` | Cheap alternative to `snapshot`: title, url, plain text, and links — for when you just need to *read*, not interact | | `frames` | List iframes (same-origin + cross-origin) | | `screenshot` / `pdf` | Visual capture / print-to-PDF | | `getConsoleLogs` | This tab's captured console output (log/warn/error/exceptions) | **Acting on the page** | Tool | What it does | | --- | --- | | `click` / `hover` | Trusted pointer input, including clicking into cross-origin frames by coordinate | | `fill` (`type`) / `press` | Type into fields, checkboxes/selects, keyboard shortcuts | | `selectOptions` | List a `