Skip to main content
BAP (Browser Agent Protocol) gives your AI agent a real browser — fast, semantic, and reliable. It keeps a browser session warm, observes pages in an AI-friendly way, and lets agents act with semantic selectors and fused operations instead of brittle CSS and endless roundtrips.

Integration Paths

CLI + SKILL.md

Best for coding agents with shell access. Install globally, run bap install-skill, and your agent learns browser commands automatically. bash npm i -g @browseragentprotocol/cli

MCP Server

Best for tool-native MCP clients like Claude Code, Codex, and Cursor. Zero config — just add the MCP server. bash npx -y @browseragentprotocol/mcp

TypeScript SDK

Best for apps and agent backends. Full programmatic control with semantic selector helpers. bash npm i @browseragentprotocol/client

Python SDK

Best for notebooks, Python agents, and data pipelines. Async and sync APIs available. bash pip install browser-agent-protocol

Prerequisites

  • Node.js >= 20.0.0 (for CLI, MCP, and TypeScript SDK)
  • Python >= 3.10 (for Python SDK only)
  • Playwright browsers: Install with npx playwright install chromium
BAP defaults to your installed Chrome browser with a persistent session. No separate browser install is needed for most setups.

Architecture

All four integration paths talk to the same BAP Playwright server:
CLI / MCP / SDK
    |
    v  (WebSocket, JSON-RPC 2.0)
BAP Playwright Server
    |
    v  (CDP / Playwright)
Browser (Chrome, Chromium, Firefox, WebKit, Edge)
The server runs as a background daemon (CLI) or child process (MCP), keeping browser sessions warm across commands.

Why BAP

FeatureWhat it means
Real browserPrefers installed Chrome, keeps session state warm, behaves like a normal user browser
Semantic selectorsrole:button:"Submit" and label:"Email" instead of brittle CSS
Fewer roundtripsFused operations like goto --observe and composite bap act reduce server calls
Warm daemonBrowser stays alive across commands — agents keep momentum
Token efficient--slim mode exposes 5 tools (~600 tokens) vs 70+ in competitors (~4,200 tokens)
Multiple surfacesCLI, MCP, TypeScript SDK, Python SDK — pick what fits your stack

Quick Example

# Navigate and observe the page in one call
bap goto https://example.com --observe

# Click through to a section
bap act click:text:"Getting Started" --observe

# Extract structured data
bap extract --fields="title,description,links"

Next Steps

CLI Quickstart

Install and run your first commands

Selectors

Learn the 10 selector types

Fusion

Reduce roundtrips with fused operations

Workflows

Record and replay browser workflows