# agent-browser

> A native Rust CLI that gives an AI agent a browser it can drive one shell command at a time

- Category: Agents & Automation / Computer & Browser Use
- Language: Rust
- Licence: Apache-2.0
- Repository: https://github.com/vercel-labs/agent-browser
- Website: https://agent-browser.dev
- Canonical page: https://ai-tldr.dev/tools/agent-browser/
- Updated: 2026-11-10

## In short

agent-browser is an open-source browser automation tool from Vercel Labs, built for AI agents rather than for test scripts. It is a native Rust command-line program: an agent opens a page, reads it, clicks or types, and checks the result, one shell command at a time. It sits in the Computer & Browser Use category of the Agents & Automation tools and is open-source, written in Rust and licensed Apache-2.0.

## Overview

agent-browser is an open-source browser automation tool from Vercel Labs, built for AI agents rather than for test scripts. It is a native Rust command-line program: an agent opens a page, reads it, clicks or types, and checks the result, one shell command at a time. Because every step is a plain command with text output, any coding agent that can run a terminal can use it, and an `agent-browser mcp` command also exposes it as an MCP server over stdio.

The core loop is built on snapshots. `agent-browser snapshot` returns the page as a compact accessibility tree with a ref such as `@e1` for each element, and the agent acts on those refs. Refs only hold for the page state they came from, so after a navigation or DOM change the agent takes a new snapshot. A click fails instead of reporting success when the target is hidden, disabled, off-screen or covered. CSS selectors, text, XPath and semantic locators work too.

Under the hood, the CLI sends each command to a background daemon that starts on the first command and controls the browser over the Chrome DevTools Protocol. Each `--session` gets its own daemon and browser, and a headless browser shuts down after an hour without commands. Chrome for Testing is the default; the tool can also attach to a running Chrome, use the Lightpanda or Obscura engines, drive Mobile Safari in the iOS Simulator, or connect to cloud browsers such as Browserbase, Browserless, Browser Use, Kernel and AgentCore. Its sibling project agent-desktop does the same for native desktop apps.

## What it does

- Accessibility-tree snapshots with a ref per element (`@e1`) that the agent acts on, then re-reads to verify
- Clicks fail loudly when the target is hidden, disabled, off-viewport or covered
- CSS, text, XPath and semantic locators, e.g. `find role button click --name "Submit"`
- Background daemon per session talking to the browser over the Chrome DevTools Protocol
- Chrome for Testing by default; attach to a running Chrome with `--cdp` or `--auto-connect`; Lightpanda and Obscura engines; Mobile Safari in the iOS Simulator
- Cloud browser providers: Browserbase, Browserless, Browser Use, Kernel and AgentCore
- Built-in MCP server (`agent-browser mcp`) and version-matched agent skills (`agent-browser skills get core`)
- Experimental saved flows (v0.42.0): record a browser task once and replay its requests
- Native binaries for macOS, Linux (glibc and musl) and Windows

## Getting started

agent-browser ships as an npm package and a Homebrew formula with native binaries for macOS (ARM64, x64), Linux (ARM64, x64) and Windows (x64). The npm package needs Node 22 or later.

1. Install the CLI and a browser

   Install globally, then download Chrome for Testing once. Homebrew works too (`brew install agent-browser`). On Linux, `agent-browser install --with-deps` also installs the browser's system libraries.

```bash
npm install -g agent-browser
agent-browser install
```

2. Open, snapshot, act, check

   Open a page, list its interactive elements with refs, act on a ref, and check the result. Take a new snapshot after anything changes the page.

```bash
agent-browser open example.com
agent-browser snapshot -i       # interactive elements, each with a ref
agent-browser click @e1         # act on a ref from that snapshot
agent-browser get url           # check the result
agent-browser close
```

3. Teach your agent the loop

   Load the core skill into your agent before first use; the README suggests adding this instruction to AGENTS.md. `skills list` shows specialised skills such as electron and slack.

```bash
agent-browser skills get core
agent-browser skills list
```

4. Or run it as an MCP server

   For agents that prefer MCP tools over shell commands, start the built-in MCP server over stdio.

```bash
agent-browser mcp
```

## When to use it

- Letting a coding agent check its own web UI changes in a real browser
- Filling forms and walking through multi-step web flows from an agent's shell
- Running isolated browser sessions in parallel, one per `--session`
- Pointing an agent at a hosted cloud browser instead of a local Chrome

## Version history

- 2026-11-10 v0.42.0: Adds experimental saved flows: record a browser task once and replay its requests, trying direct HTTP first, then page requests, then the recorded commands. Also trims MCP tool arguments, fixes session reuse and Safari/iOS sessions, and now needs Node 22 or later.
