Skip to content

browseragentprotocol/bap

Browser Agent Protocol (BAP)

Give your AI agent a real browser — fast, semantic, and reliable.

BAP 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.

BAP navigating a website, clicking through pages, and scrolling through a blog post

CLI  ·  MCP  ·  Python  ·  Docs  ·  Apache-2.0


Get Started

npm i -g @browseragentprotocol/cli
bap install-skill

Or run bap demo for a guided walkthrough.

Then give your agent a task:

Use BAP to open https://piyushvyas.com, go to Writing, find the
"Introducing Browser Agent Protocol" post, and summarize it.

Start a fresh agent session after installing the skill so it picks up the BAP guidance.

Why BAP

Real browser Prefers installed Chrome, keeps session state warm, stays close to a normal user browser
Semantic selectors role:button:"Submit" and label:"Email" instead of brittle CSS
Fewer roundtrips goto --observe, act --observe, stable refs, and structured extraction
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

See It in Action

BAP navigating a bookstore, clicking Travel category, and viewing book details
Navigate → click → browse: 3 commands, one workflow

BAP browsing GitHub to find a SKILL.md, then scoring it on skills.menu
Multi-site workflow: browse GitHub → open skills.menu → paste & score

Quick Example

# Navigate and observe the page
bap goto https://piyushvyas.com --observe

# Click through to a blog post
bap act click:text:"Writing" --observe
bap act click:text:"Introducing Browser Agent Protocol" --observe

# Scroll and extract
bap scroll down --pixels=5000
bap extract --fields="title,content"

Interfaces

Interface Install Best for
CLI + SKILL.md npm i -g @browseragentprotocol/cli Coding agents with shell access
MCP npx -y @browseragentprotocol/mcp Tool-native MCP clients
TypeScript SDK npm i @browseragentprotocol/client Apps and agent backends
Python SDK pip install browser-agent-protocol Notebooks and Python agents

Tips

  • BAP defaults to headful Chrome with a persistent session.
  • Use --headless for CI or background runs.
  • Use --no-profile if your Chrome profile is busy.
  • Use bap close-all to stop the daemon and all sessions.

Against Other Tools

  • vs Playwright CLI — BAP is built for agent workflows, not human shell scripting.
  • vs Playwright MCP — When shell access is available, BAP CLI solves the same job with fewer roundtrips. In MCP mode, --slim cuts tool definitions to ~600 tokens vs ~4,200 for Playwright MCP's 70+ tools.
  • vs Chrome DevTools / CDP — CDP is the low-level transport; BAP is the agent layer on top.

Docs

Contributing

License

Apache-2.0. See LICENSE for details.

About

Open protocol for AI agents to control web browsers. TypeScript & Python SDKs with MCP integration.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors