SuperAPIAI Directory

agent-browser

github.com · AI agents

agent-browser is a browser automation command-line tool for AI agents developed by Vercel Labs, written in native Rust. It lets AI agents drive the browser through individual shell commands: open pages, read page content as an accessibility tree, and perform actions on page elements. The snapshot command returns the page as compact text, attaching a reference identifier like @e1 to each element; the agent first performs an action on a reference, then re-reads the page to confirm the result, and repeats this loop. The browser stays open between commands, so each step requires only a short shell call. It supports Homebrew, a Linux install script, and running via npx without installation, and also supports connecting to clients through the MCP protocol.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsiOS · macOS · Linux

About this tool

Purpose

agent-browser provides AI agents with a browser that can be driven command by command from the command line. It breaks page reading and element actions into short commands, making it suitable for agents to complete web interaction tasks in a "snapshot—act—snapshot again" loop.

Main capabilities

  • Page snapshots: The snapshot command returns the page as compact text, with each element carrying a reference (ref) such as @e1. References describe the page state at the moment of the snapshot; after navigation or DOM changes, a new snapshot is required before using references again.
  • Element actions: Agents can perform actions on references, then re-read the page to check the result.
  • Multiple locating methods: In addition to references, it also supports CSS selectors, text, XPath, and semantic locators, for example agent-browser find role button click --name "Submit".
  • Failure feedback: When the target is hidden, disabled, outside the viewport, or covered by another element (such as a consent banner), the click fails instead of reporting success; the covering element must be handled first, then a new snapshot taken and the action retried.
  • Sessions and daemon: The CLI sends each command to a background daemon, which starts on the first command and controls the browser via the Chrome DevTools Protocol. Each --session has its own independent daemon and browser. By default, after one hour without commands the daemon closes the headless browser and exits; if session persistence is configured, it saves state first.
  • Browser selection: By default it uses Chrome for Testing; it can attach to a running Chrome via --cdp or --auto-connect; --engine can select the Lightpanda or Obscura engine; it can drive Mobile Safari in the iOS Simulator; and it can use cloud browser providers such as Browserbase, Browserless, Browser Use, Kernel, and AgentCore.
  • Skills and MCP: The CLI ships with skills matching its version; installed skills are thin stubs that instruct the agent to load agent-browser skills get core, ensuring the instructions match the installed CLI. For MCP clients,agent-browser mcp starts a stdio-based MCP server.

Usage

Installation:

  • Homebrew:brew install agent-browser, then agent-browser install。
  • Linux:agent-browser install --with-deps also installs the browser's system libraries.
  • No installation:npx agent-browser open example.com.

For project installation, building from source, upgrading, and doctor, see the installation documentation. For the full command list, run agent-browser --help, and for help on a single command use agent-browser <command> --help. Flags, environment variables, and agent-browser.json are described in the configuration documentation.

Building from source requires Node.js 24 or later, pnpm 11 or later, and Rust; run the Rust checks in the cli/ directory.

Use cases

Suitable for automation tasks that require an AI agent to operate web pages via the command line, read page structure, and verify operation results step by step; also suitable for connecting through MCP to clients that support the protocol.

Limitations

References are valid only at the moment of the snapshot; after the page changes, a new snapshot must be taken. Clicks fail when the target is not visible, disabled, outside the viewport, or obscured. Native binaries cover macOS (ARM64, x64), Linux (ARM64, x64, glibc and musl), and Windows (x64); the npm package selects the correct binary for the host. Other features, billing, and pricing information are not yet available.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools