$npx -y skills add vercel-labs/agent-browser --skill coreCore agent-browser usage guide. Read this before running any agent-browser commands. Covers the snapshot-and-ref workflow, navigating pages, interacting with elements (click, fill, type, select), extracting text and data, taking screenshots, managing tabs, handling forms and auth
| 1 | # agent-browser core |
| 2 | |
| 3 | Fast browser automation CLI for AI agents. Chrome/Chromium via CDP, no Playwright or Puppeteer dependency. Accessibility-tree snapshots with compact `@eN` refs let agents interact with pages in ~200-400 tokens instead of parsing raw HTML. |
| 4 | |
| 5 | Most normal web tasks (navigate, read, click, fill, extract, screenshot) are covered here. Load a specialized skill when the task falls outside browser web pages — see [When to load another skill](#when-to-load-another-skill). |
| 6 | |
| 7 | ## The core loop |
| 8 | |
| 9 | ```bash |
| 10 | agent-browser open <url> # 1. Open a page |
| 11 | agent-browser snapshot -i # 2. See what's on it (interactive elements only) |
| 12 | agent-browser click @e3 # 3. Act on refs from the snapshot |
| 13 | agent-browser snapshot -i # 4. Re-snapshot after any page change |
| 14 | ``` |
| 15 | |
| 16 | Refs (`@e1`, `@e2`, ...) are assigned fresh on every snapshot. They become **stale the moment the page changes** — after clicks that navigate, form submits, dynamic re-renders, dialog opens. Always re-snapshot before your next ref interaction. |
| 17 | |
| 18 | ## Quickstart |
| 19 | |
| 20 | ```bash |
| 21 | # Install once |
| 22 | npm i -g agent-browser && agent-browser install |
| 23 | |
| 24 | # Linux hosts can install required browser libraries too |
| 25 | agent-browser install --with-deps |
| 26 | |
| 27 | # Take a screenshot of a page |
| 28 | agent-browser open https://example.com |
| 29 | agent-browser screenshot home.png |
| 30 | agent-browser close |
| 31 | |
| 32 | # Search, click a result, and capture it |
| 33 | agent-browser open https://duckduckgo.com |
| 34 | agent-browser snapshot -i # find the search box ref |
| 35 | agent-browser fill @e1 "agent-browser cli" |
| 36 | agent-browser press Enter |
| 37 | agent-browser wait --load networkidle |
| 38 | agent-browser snapshot -i # refs now reflect results |
| 39 | agent-browser click @e5 # click a result |
| 40 | agent-browser screenshot result.png |
| 41 | ``` |
| 42 | |
| 43 | The browser stays running across commands so these feel like a single session. Use `agent-browser close` (or `close --all`) when you're done. |
| 44 | |
| 45 | ## MCP integration |
| 46 | |
| 47 | For tools that support Model Context Protocol servers, start the stdio server: |
| 48 | |
| 49 | ```bash |
| 50 | agent-browser mcp |
| 51 | agent-browser mcp --tools all |
| 52 | agent-browser mcp --tools core,network,react |
| 53 | ``` |
| 54 | |
| 55 | Configure the MCP client to launch `agent-browser` with `["mcp"]`. The server defaults to MCP protocol 2025-11-25 and accepts older supported client protocol versions during initialization. The default tools profile is `core`, which keeps MCP context small for everyday browser automation. Use `--tools all` for the full typed CLI parity surface, or combine profiles with commas, such as `--tools core,network,react`. Profiles are `core`, `network`, `state`, `debug`, `tabs`, `react`, `mobile`, and `all`; the `debug` profile includes plugin registry and command.run tools. Each tool accepts typed arguments plus `extraArgs` for advanced CLI flags and exact CLI parity. The common `allowedDomains` array maps to `--allowed-domains` and activates the same WebRTC containment and launch-mode restrictions. Tool discovery is paginated and includes read-only/open-world annotations so modern MCP clients can load the large typed surface incrementally. Use the tool `session` argument or `AGENT_BROWSER_SESSION` to isolate browser sessions. |
| 56 | |
| 57 | ## eve agent integration |
| 58 | |
| 59 | For eve agents, mount the `@agent-browser/eve` extension instead of hand-writing browser tools. It adds namespaced tools such as `browser__navigate`, `browser__snapshot`, `browser__click`, `browser__fill`, `browser__find`, and `browser__screenshot`, all backed by agent-browser running inside the eve sandbox. The sandbox bootstrap helpers (`installAgentBrowser`, `agentBrowserRevalidationKey`) ship with the same package under `@agent-browser/eve/sandbox`, so `agent/sandbox.ts` needs no extra dependency. |
| 60 | |
| 61 | ## Reading a page |
| 62 | |
| 63 | ```bash |
| 64 | agent-browser snapshot # full tree (verbose) |
| 65 | agent-browser snapshot -i # interactive elements only (preferred) |
| 66 | agent-browser snapshot -i -u # include href urls on links |
| 67 | agent-browser snapshot -i -c # compact (no empty structural nodes) |
| 68 | agent-browser snapshot -i -d 3 # cap depth at 3 levels |
| 69 | agent-browser snapshot -s "#main" # scope to a CSS selector |
| 70 | agent-browser snapshot -i --json # machine-readable output |
| 71 | ``` |
| 72 | |
| 73 | Snapshot output looks like: |
| 74 | |
| 75 | ``` |
| 76 | Page: Example - Log in |
| 77 | URL: https://example.com/login |
| 78 | |
| 79 | @e1 [heading] "Log i |