How vercel-labs/agent-browser works
agent-browser is a Rust browser-automation CLI for AI agents, with typed MCP access and live browser streaming. The main workflow is an agent invoking CLI commands to launch/connect to a browser, perform page actions, and receive snapshots or other results. The README establishes the user-facing capabilities; source-index references and sampled excerpts support selected internal links. Unsampled subsystems are represented where documented, but their internal call paths are not inferred.
Main entry points: main.rs CLI entry · commands.rs Command parsing · client.rs CDP transport · browser.rs Browser control
Components 23
CLI entry
- CLI entry
cli/src/main.rs - Command parsing
cli/src/commands.rs - Flags and config
cli/src/flags.rs
Browser automation
- Browser control
cli/src/native/browser.rs - Page actions
cli/src/native/actions.rs - CDP transport
cli/src/native/cdp/client.rs - Accessibility snapshot
cli/src/native/snapshot.rs - Network control
cli/src/native/network.rs - WebMCP tools
cli/src/native/webmcp.rs - Readable page content
cli/src/read.rs - Session recording
cli/src/native/recording.rs
Agent interfaces
- MCP server
cli/src/mcp.rs - Agent skills
cli/src/skills.rs - Live streaming
cli/src/native/stream/mod.rs - CDP stream loop
cli/src/native/stream/cdp_loop.rs - Browser chat
cli/src/chat.rs - Eve extension tools
packages/@agent-browser/eve/extension/tools/drag.ts
Runtime operations
- Browser installation
cli/src/install.rs - Environment diagnostics
cli/src/doctor/mod.rs
Session dashboard
- Dashboard UI
packages/dashboard/src/app/page.tsx - Dashboard routes
packages/dashboard/src/lib/dashboard-routes.ts
Other components
- AI agent
- Browser runtime
Connections 26
- AI agent → CLI entry: runs commands
README.md - CLI entry → Command parsing: dispatches commands
cli/src/main.rs - CLI entry → Flags and config: parses options
cli/src/main.rs - CLI entry → MCP server: serves MCP
cli/src/main.rs - CLI entry → Browser installation: installs browser
cli/src/main.rs - CLI entry → Environment diagnostics: runs checks
cli/src/main.rs - Command parsing → WebMCP tools: parses tools
cli/src/commands.rs - Command parsing → Readable page content: parses read
cli/src/commands.rs - Command parsing → Session recording: parses recording
cli/src/commands.rs - AI agent → Browser control: controls browser
README.md - Browser control → Browser runtime: drives browser
README.md - AI agent → Accessibility snapshot: requests snapshot
README.md - AI agent → Page actions: requests actions
README.md - AI agent → Network control: configures network
README.md - AI agent → MCP server: discovers tools
README.md - AI agent → Agent skills: loads guidance
- AI agent → Live streaming: enables streaming
README.md - Live streaming → CDP stream loop: uses loop
cli/src/native/stream/mod.rs - AI agent → Browser chat: starts chat
README.md - CDP transport → Browser runtime: sends protocol
- AI agent → Browser installation: installs Chrome
README.md - AI agent → Environment diagnostics: checks setup
- AI agent → Dashboard UI: views sessions
- Dashboard UI → Dashboard routes: uses routes
packages/dashboard/src/app/page.tsx - AI agent → Eve extension tools: invokes extension
- CDP transport → CLI entry: returns protocol data