Overview
Fast native Rust CLI for browser automation via CDP with accessibility-tree snapshots.
Setup
Run with npx:
npm install -g @anthropic-ai/agent-browserConfiguration
AGENT_BROWSER_URL environment variableDocumentation
Agent-Browser MCP Server
Overview
agent-browser is a fast, native Rust CLI for browser automation via CDP with accessibility-tree snapshots. Unlike traditional browser automation tools that rely on visual screenshots, agent-browser uses accessibility tree data for precise, efficient browser interaction.
With over 11,753 GitHub stars, agent-browser has become a popular choice for AI agent browser automation, especially for accessibility-focused workflows and fast browser-based tooling.
Features
- Accessibility-tree snapshots — Precise element detection via accessibility tree
- Native Rust implementation — Fast, memory-efficient browser automation
- CDP protocol support — Works with Chrome, Chromium, and Edge
- MCP integration — Standard Model Context Protocol support
- Cross-platform — Supports Windows, macOS, and Linux
- Zero dependencies — No heavy browser automation frameworks required
- Real-time interaction — Low-latency browser commands
- Headless mode — Fully headless execution for CI/CD
Installation
Quick Setup
# Install via npm (recommended)
npm install -g @anthropic-ai/agent-browser
# Or install from source
cargo install agent-browser
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"agent-browser": {
"command": "agent-browser",
"args": ["serve"],
"env": {
"AGENT_BROWSER_URL": "http://localhost:3000"
}
}
}
}
Docker Setup
docker run -p 3000:3000 agent-browser:latest
Setup
-
Install Chrome or Chromium
- Ensure Chrome/Chromium is installed and accessible
- For headless mode, ensure Chrome can run headless
-
Start the Browser
agent-browser start -
Connect to MCP
agent-browser serve
Available Tools
| Tool | Description |
|---|---|
browser_navigate | Navigate to a URL |
browser_snapshot | Get accessibility tree snapshot |
browser_click | Click an element by selector |
browser_type | Type text into an element |
browser_scroll | Scroll the page |
browser_back | Navigate back |
browser_forward | Navigate forward |
browser_refresh | Refresh the page |
browser_get_text | Get text content of element |
browser_get_html | Get HTML content of element |
browser_take_screenshot | Take a screenshot |
browser_execute_js | Execute JavaScript |
Usage Examples
Navigate to a URL
{
"name": "browser_navigate",
"arguments": {
"url": "https://github.com/anthropics/agent-browser"
}
}
Get Accessibility Snapshot
{
"name": "browser_snapshot",
"arguments": {
"depth": 5
}
}
Click an Element
{
"name": "browser_click",
"arguments": {
"selector": "#submit-button"
}
}
Type Text
{
"name": "browser_type",
"arguments": {
"selector": "#search-input",
"text": "MCP servers",
"slowly": true
}
}
Take Screenshot
{
"name": "browser_take_screenshot",
"arguments": {
"fullPage": false,
"format": "png"
}
}
Advanced Features
Accessibility Tree Parsing
agent-browser excels at accessibility tree parsing, providing structured data about page elements:
{
"name": "browser_snapshot",
"arguments": {
"includeHidden": false,
"maxDepth": 10
}
}
Headless Mode
For CI/CD and automated workflows:
agent-browser start --headless
Multi-Tab Support
agent-browser supports multiple browser tabs:
{
"name": "browser_new_tab",
"arguments": {
"url": "https://example.com"
}
}
Form Filling
Automated form filling with accessibility-aware selectors:
{
"name": "browser_fill_form",
"arguments": {
"fields": {
"username": "testuser",
"password": "securepassword123"
},
"submit": true
}
}
Integration with AI Agents
Claude Code Integration
agent-browser works seamlessly with Claude Code for browser automation:
# In Claude Code, use browser tools
> Click the login button
> Type my email in the input
> Submit the form
Agent Workflow Example
# Example agent workflow using agent-browser
async def search_and_extract(url: str, query: str):
# Navigate
await browser_navigate(url)
# Search
await browser_type("#search", query)
await browser_click("#search-button")
# Extract results
snapshot = await browser_snapshot()
return parse_results(snapshot)
Pros
- ✅ Fast native Rust implementation
- ✅ Accessibility-tree snapshots for precise interaction
- ✅ MCP standard integration
- ✅ Cross-platform support
- ✅ Low latency browser commands
- ✅ Headless mode for CI/CD
- ✅ Works with any CDP-compatible browser
Cons
- ❌ Requires Chrome/Chromium installation
- ❌ Accessibility tree may miss visual-only elements
- ❌ Less mature than Playwright/Puppeteer
- ❌ No built-in waiting mechanisms
- ❌ Limited screenshot-based debugging
When to Use
- AI agent browser automation
- Accessibility-focused web scraping
- Fast browser-based tooling
- MCP-integrated workflows
- Headless browser automation
- Form filling and submission
