> ## Documentation Index
> Fetch the complete documentation index at: https://piyushvyas.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Four ways to integrate BAP into your AI agent workflow

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

<CardGroup cols={2}>
  <Card title="CLI + SKILL.md" icon="terminal" href="/getting-started/cli">
    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 `
  </Card>

  <Card title="MCP Server" icon="plug" href="/getting-started/mcp">
    Best for tool-native MCP clients like Claude Code, Codex, and Cursor. Zero config -- just add
    the MCP server. `bash npx -y @browseragentprotocol/mcp `
  </Card>

  <Card title="TypeScript SDK" icon="code" href="/getting-started/typescript-sdk">
    Best for apps and agent backends. Full programmatic control with semantic selector helpers.
    `bash npm i @browseragentprotocol/client `
  </Card>

  <Card title="Python SDK" icon="python" href="/getting-started/python-sdk">
    Best for notebooks, Python agents, and data pipelines. Async and sync APIs available. `bash
            pip install browser-agent-protocol `
  </Card>
</CardGroup>

## 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`

<Tip>
  BAP defaults to your installed Chrome browser with a persistent session. No separate browser
  install is needed for most setups.
</Tip>

## 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

| Feature                | What it means                                                                          |
| ---------------------- | -------------------------------------------------------------------------------------- |
| **Real browser**       | Prefers installed Chrome, keeps session state warm, behaves like a normal user browser |
| **Semantic selectors** | `role:button:"Submit"` and `label:"Email"` instead of brittle CSS                      |
| **Fewer roundtrips**   | Fused operations like `goto --observe` and composite `bap act` reduce server calls     |
| **Warm daemon**        | Browser stays alive across commands -- agents keep momentum                            |
| **Token efficient**    | `--slim` mode exposes 5 tools (\~600 tokens) vs 70+ in competitors (\~4,200 tokens)    |
| **Multiple surfaces**  | CLI, MCP, TypeScript SDK, Python SDK -- pick what fits your stack                      |

## Quick Example

```bash theme={null}
# 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

<CardGroup cols={2}>
  <Card title="CLI Quickstart" icon="terminal" href="/getting-started/cli">
    Install and run your first commands
  </Card>

  <Card title="Selectors" icon="crosshairs" href="/concepts/selectors">
    Learn the 10 selector types
  </Card>

  <Card title="Fusion" icon="bolt" href="/concepts/fusion">
    Reduce roundtrips with fused operations
  </Card>

  <Card title="Workflows" icon="list-check" href="/concepts/workflows">
    Record and replay browser workflows
  </Card>
</CardGroup>
