What This Is
A practical setup guide for agent-browser, the open-source Rust CLI for AI agent browser automation from Vercel Labs. Replaces Playwright MCP with a native daemon that uses 93% less tokens for the same browser actions. Apache 2.0 licensed.
The Problem Nobody Talks About
Most AI agent browser setups burn massive amounts of context on every action. The agent fires up Playwright through MCP, the MCP wraps a Node.js process, the Node process talks to Chrome via Playwright's protocol, and every "click this button" round-trip costs thousands of tokens just for the protocol overhead. Add the page snapshot for the agent to "see," and a single browse-and-click can chew through 5,000 tokens.
For agents that browse a lot (research, scraping, QA), the protocol tax adds up fast. You hit context limits before you finish the task. You pay for tokens that did no work.
agent-browser collapses the cycle. Native Rust binary, daemon architecture, accessibility-tree snapshots instead of full-page screenshots, semantic element refs instead of CSS selectors. Same browser actions, 93% fewer tokens.
Why This Changes Everything
Native Rust, no Node.js. No interpreter overhead, no package install dance, no version conflicts with the host project. One binary, statically compiled.
Daemon architecture. Starts once, persists between commands. The agent doesn't pay startup cost on every action.
Semantic element refs. Instead of brittle CSS selectors (.btn-primary[data-id="checkout-3"]), the daemon hands the agent stable refs (@e1, @e2) from the accessibility tree. The refs survive page redesigns and only break when the underlying element actually changes.
CDP, not Playwright. Direct Chrome DevTools Protocol. No translation layer. Faster, fewer dependencies, lower token overhead.
Step 1: Install Prerequisites
You need:
- Chrome (auto-downloaded by agent-browser, or use your existing install)
- Node.js (only if you're installing via npm; not required for cargo or brew installs)
That's it. No Playwright. No Puppeteer. No separate Node daemon.
Step 2: Install agent-browser
The fastest path is via npm. Two commands.
npm install -g agent-browser
agent-browser installThe first command installs the CLI. The second downloads Chrome for Testing if needed and sets up the daemon.
Homebrew (Mac):
brew install vercel-labs/tap/agent-browser
agent-browser installCargo (any Rust toolchain):
cargo install agent-browser
agent-browser install