One-Command Setup
Client Configuration
- Claude Code
- Claude Desktop
- Codex CLI
- Codex Desktop
- Cursor
Available Tools
The MCP server exposes 23 tools by default, grouped by category:Navigation (4 tools)
Navigation (4 tools)
Element Interaction (7 tools)
Element Interaction (7 tools)
| Tool | Description | |------|-------------| |
click | Click an element using semantic
selectors | | type | Type text character by character | | fill | Fill a form field (clears
existing content) | | press | Press keyboard keys (Enter, Tab, shortcuts) | | select | Select
a dropdown option | | scroll | Scroll the page or a specific element | | hover | Hover over an
element |Observation (5 tools)
Observation (5 tools)
| Tool | Description | |------|-------------| |
screenshot | Take a page screenshot | |
accessibility | Full accessibility tree | | aria_snapshot | Token-efficient YAML snapshot
(~80% fewer tokens) | | content | Page text content as text or markdown | | element | Query
element properties (exists, visible, enabled) |AI Agent Methods (3 tools)
AI Agent Methods (3 tools)
| Tool | Description | |------|-------------| |
observe | AI-optimized observation with
interactive elements and stable refs. Supports incremental and responseTier | | act |
Execute a sequence of browser actions in one call. Supports fused postObserve | | extract |
Extract structured data using schema and CSS heuristics |Page Management (3 tools)
Page Management (3 tools)
| Tool | Description | |------|-------------| |
pages | List all open pages/tabs | |
activate_page | Switch to a different page/tab | | close_page | Close the current page/tab |Discovery (1 tool)
Discovery (1 tool)
| Tool | Description |
|---|---|
discover_tools | Discover WebMCP tools exposed by the current page |
Slim Mode
Use--slim to expose only 5 essential tools, reducing tool definitions from ~4,200 to ~600 tokens:
navigate, observe, act, extract, screenshot.
CLI Options
Connected Mode
If you already have a BAP Playwright server running, connect to it directly:In-Process Mode
For zero-overhead MCP, use--in-process to bypass the WebSocket layer entirely:
DirectTransport.
In-process mode does not support server-push notifications (event streaming). Use standard mode if
you need console error and network failure forwarding.
Event Streaming
Browser console errors and 4xx/5xx network responses are automatically forwarded to connected MCP clients asnotifications/message log entries. No configuration needed.
Selector Formats
All tools that accept aselector parameter support these formats:
Programmatic Usage
Troubleshooting
Connection closed on Windows
Connection closed on Windows
On native Windows (not WSL), use the
cmd /c wrapper:Server not starting
Server not starting
Ensure Playwright browsers are installed:
bash npx playwright install chromium Headless mode on retina displays
Headless mode on retina displays
MCP defaults to
headless: true. If you override to headless: false on a retina Mac, screenshots will be 2x DPI, doubling their size. BAP mitigates this with deviceScaleFactor: 1 and scale: "css" on screenshots.