Skip to main content

Overview

BAP and Playwright both use the Playwright engine for browser automation. They differ in architecture, API design, and optimization for AI agent workflows.
DimensionBAPPlaywright
PublisherbrowseragentprotocolMicrosoft
LicenseApache-2.0Apache-2.0
ArchitectureTwo-process (WebSocket bridge)Single-process
MCP Package@browseragentprotocol/mcp@playwright/mcp
CLI Package@browseragentprotocol/cli@playwright/cli

MCP Server Comparison

BAP MCP

  • 23 MCP tools - Composite act batches N steps in 1 call - observe returns structured elements with refs - extract with JSON Schema - 6 fusion operations - Response tiers (full/interactive/minimal) - WebMCP discovery - Session persistence across restarts

Playwright MCP

  • 31 tools (17 core + 6 vision + 5 test + 3 other) - No built-in batching - browser_snapshot returns raw accessibility tree - browser_evaluate for custom JS extraction - Lower per-call latency (single-process) - Simpler setup (npx @playwright/mcp) - 27.5k GitHub stars, Microsoft-backed

Feature Matrix

FeatureBAPPlaywright MCP
Composite actions (batch N steps)YesNo
Structured observation with refsYesAccessibility tree
JSON Schema extractionYesCustom JS
Navigate + observe fusionYesNo
Act + pre/post observe fusionYesNo
Incremental observationYesNo
Response compression tiersYesNo
WebMCP tool discoveryYesNo
Session persistenceYesNo
Multi-client (CLI + MCP)YesNo
Batched form fillingact (N fills + click = 1 call)browser_fill_form (fills batched, click separate)
Per-call latency+50-200ms (WebSocket)Lower (in-process)
Element disambiguationSemantic selectors (can be ambiguous)Positional refs (always unique)
SKILL.md support13 platformsClaude Code, GitHub Copilot

CLI Comparison

DimensionBAP CLIPlaywright CLI
Commands26~70+ (granular)
Composite actionsbap act fill:...=val click:...Individual commands
Semantic selectorsrole:button:"Submit", label:"Email"Accessibility tree refs
Observationbap observe --tier=interactiveplaywright-cli snapshot
Extractionbap extract --fields="title,price"playwright-cli eval (custom JS)

Benchmark Results

All data from the reproducible benchmark suite. See Benchmarks for full methodology.
ScenarioBAP StandardBAP FusedPlaywrightStd vs PWFused vs PW
baseline222TieTie
observe212Tie-50%
extract222TieTie
form435-20%-40%
ecommerce8511-27%-55%
workflow545Tie-20%
Total231727~15%~37%
The fair comparison is BAP Standard vs Playwright. BAP Standard follows the same observe-then-act pattern as Playwright. BAP Fused is an optimization layer that is not apples-to-apples.

Where BAP Wins

  • Composite act: Batching multiple steps into one call is the primary advantage. Most impactful in multi-step flows like ecommerce (8 vs 11 calls).
  • Fused operations: navigate(observe:true) and act(postObserve:true) eliminate redundant roundtrips.
  • Structured extract: JSON Schema-based extraction vs writing custom JS.
  • Session persistence: Browser state survives across client restarts.
  • Multi-client: CLI and MCP share the same browser simultaneously.

Where Playwright Wins

  • Per-call latency: Single-process architecture. No WebSocket overhead.
  • Element disambiguation: Positional snapshot refs uniquely identify elements. BAP’s observe can return ambiguous selectors for identical elements (e.g., 6 “Add to cart” buttons).
  • Setup simplicity: npx @playwright/mcp — single process, no daemon management.
  • Ecosystem: 27.5k GitHub stars, Microsoft-backed, extensive testing integration.
  • Tool count: 31 tools covering more granular operations.

When to Use Which

Choose BAP

  • Multi-step form automation - AI agent workflows (observe-decide-act loop) - Need CLI + MCP access to same browser - Session persistence matters - Token efficiency is critical

Choose Playwright

  • Per-call latency is the priority - Already in the Playwright testing ecosystem - Need the simplest possible setup - Element disambiguation is critical - Vision-based automation (6 vision tools)