In the agent browser vs Playwright choice, pick agent-browser when a coding agent needs the shortest possible page reads and you want security controls (domain allowlist, action policy, credential vault) built into the browser tool. Pick Playwright CLI when you also want every action echoed as real Playwright code you can paste into a test, or you need Firefox and WebKit. Pick Playwright MCP only when your client speaks MCP but cannot run shell commands. On our test page, agent-browser's interactive snapshot was 3,864 characters against about 11,800 for Playwright's full snapshot.

The question is trending because vercel-labs/agent-browser sat on GitHub's daily trending list on November 9 and again on November 10, 2026, with about 48,900 stars, and Google now suggests "agent browser vs playwright", "vs playwright cli" and "vs playwright mcp" as you type. All three tools below are open source and free; the cost that matters is how much page text lands in your agent's context.

Agent browser vs Playwright at a glance

Itemagent-browserPlaywright CLIPlaywright MCP
MakerVercel LabsMicrosoftMicrosoft
Version we tested0.42.0@playwright/cli 0.1.24@playwright/mcp 0.0.85
LicenseApache 2.0Apache 2.0Apache 2.0
Built inRust (native binary)Node.js on PlaywrightNode.js on Playwright
How the agent calls itshell commands, or agent-browser mcpshell commandsMCP tools over stdio, or HTTP with --port
BrowsersChrome via CDP, plus Lightpanda, Obscura, iOS Simulator, cloud providersChrome, Edge, Firefox, WebKitChrome, Edge, Firefox, WebKit
Agent instructionsagent-browser skills get coreplaywright-cli install --skillstool schemas sent by the server
Writes test code for youNoYes, after every actionYes, after every action
Built in guardrailsallowlist, action policy, confirmations, vault, output caporigin allow and block listsorigin allow and block lists (not a security boundary)

How each tool works

agent-browser is a native Rust CLI. The first command starts a background daemon that controls Chrome over the Chrome DevTools Protocol, and every later command is a short shell call to that daemon, so the browser stays open between steps. The loop its README describes is simple: open a page, run snapshot -i to get interactive elements with refs such as @e5, act on a ref with click or fill, then snapshot again to check. A headless session closes after one hour without commands. Besides Chrome it can attach to a running browser, switch engines with --engine, or connect to hosted browsers such as Browserbase, Browserless, Browser Use, Kernel and AgentCore.

Playwright CLI is Microsoft's newer command line wrapper around Playwright, built for coding agents. You install it with npm install -g @playwright/cli@latest, and its README argues that a CLI plus skills uses fewer tokens than MCP because the agent does not load large tool schemas. Sessions keep cookies in memory by default (--persistent saves the profile to disk), a headless session also shuts down after an hour idle, and playwright-cli show opens a dashboard where you can watch background sessions and take over the mouse.

Playwright MCP is the MCP server version of the same engine. Your client (for example Claude Code with claude mcp add playwright npx @playwright/mcp@latest) receives a list of tools such as browser_navigate, browser_snapshot and browser_click, and the model calls them by name. Our earlier comparison of Browser Use vs Stagehand vs Playwright MCP covers where it fits next to full browser agent frameworks.

What we measured on one test page

We served one local page with a signup form (name, email, terms checkbox, plan dropdown, Subscribe button) and a list of 60 product links with Add buttons, then drove it with each tool. This is one page on one machine, so treat the numbers as a picture of output style, not a benchmark.

Outputagent-browser 0.42.0Playwright CLI 0.1.24Playwright MCP 0.0.85
Full page snapshot10,224 chars11,794 chars12,427 chars (tool result JSON)
Interactive only snapshot3,864 chars (snapshot -i)no equivalent flagno equivalent flag
Output of four form actions36 chars757 charsnot run
Opening the pagetitle and URL only441 chars, snapshot saved to a file405 chars, snapshot saved to a file
--help text31,133 chars7,593 charsnot applicable
MCP tools listed33 tools, 25,853 charsnot applicable25 tools, 22,238 chars

Three things stood out.

agent-browser's interactive snapshot is the smallest useful read. It drops headings, text and layout wrappers and keeps only things you can act on, with each dropdown's options nested underneath. For a form task that is all the agent needs. Playwright's snapshot keeps the full tree, including every link's URL, which is why it was three times longer here. Playwright CLI can shrink a read in other ways: pass an element ref to snapshot only part of the page, or use --depth.

Playwright CLI tells you what it did in Playwright code. Each action printed the equivalent line, for example await page.getByRole('textbox', { name: 'Name' }).fill('Ada'), plus a link to a fresh snapshot file. That costs more characters per step, but an agent that is writing an end to end test can copy those lines straight into a spec. agent-browser replied with a bare "Done" for each action, which is cheaper but leaves test writing to you.

Both CLIs keep the big snapshot out of the reply by default when navigating. Playwright CLI and Playwright MCP wrote the page tree to a YAML file and returned a link after open or browser_navigate; the agent asks for the snapshot only when it needs it. agent-browser returns just the title and URL after open.

One honest caveat on the MCP row: agent-browser's own MCP server exposed more tools and a slightly longer tool list than Playwright MCP. If you plan to reach agent-browser through MCP, its token edge over Playwright MCP mostly comes from snapshots (its MCP snapshots default to interactive mode, per its help text), not from the tool list. The bigger saving in both families comes from using the CLI with a skill instead of MCP, the same idea behind Code Mode for MCP.

Agent browser vs Playwright CLI: setup for coding agents

Both CLIs teach the agent through agent skills, and they handle versioning differently.

  • agent-browser: install with npm install -g agent-browser (or Homebrew), then agent-browser install for Chrome for Testing; on Linux, --with-deps adds system libraries. npx skills add vercel-labs/agent-browser installs a stub skill that tells the agent to run agent-browser skills get core, so the instructions always match the installed version. That core skill printed 15,916 characters on our box. You can skip the skill and put one line in AGENTS.md instead.
  • Playwright CLI: playwright-cli install --skills writes skills for Claude Code by default, or for other agents with --skills=agents. Its README also suggests simply telling the agent to read playwright-cli --help, which was a quarter the length of agent-browser's help on our box.

In our run agent-browser drove the system Chrome that was already installed and warned that it was one release behind Chrome stable, with the count of CVEs fixed since. That version check is documented on its security page and never blocks a command.

Agent browser vs Playwright MCP: security and control

This is the clearest difference. The agent-browser security docs list controls that are all off until you turn them on:

  • Domain allowlist (--allowed-domains) blocks navigation and sub resource requests to other domains, patches WebSocket and EventSource, and turns off WebRTC in supported Chromium sessions.
  • Action policy (--action-policy) allows or denies categories such as eval, download and upload, and --confirm-actions makes chosen categories wait for approval (pending ones auto deny after 60 seconds).
  • Auth vault stores logins encrypted with AES-256-GCM so auth login can sign in without the password ever reaching the model.
  • Content boundaries wrap page text in markers with a random nonce so the orchestrator can tell page content from tool output, and --max-output caps how much page text comes back.

The docs are candid that the allowlist is not an operating system firewall and that boundaries depend on the model respecting them. Playwright MCP offers --allowed-origins and --blocked-origins, and its README says plainly that these do not serve as a security boundary and do not affect redirects. If an agent will browse untrusted sites with real accounts, agent-browser gives you more built in levers, but run either one inside a sandbox with network egress rules for anything serious.

Which should you pick?

  • Claude Code, Codex or another shell capable agent doing everyday web tasks: agent-browser. Short interactive snapshots and quiet action replies keep context small over long sessions.
  • Writing or fixing end to end tests: Playwright CLI. The echoed Playwright code, Firefox and WebKit support, and the Playwright test tooling behind it outweigh the extra characters.
  • A chat client or IDE that only speaks MCP: Playwright MCP is the mature default. agent-browser's mcp command works too if you want its guardrails.
  • Logins, untrusted pages or unattended runs: agent-browser with an allowlist, an action policy and the vault, inside a sandbox.
  • A full autonomous browsing agent rather than a tool: look at Browser Use or Stagehand in our browser agent comparison.

You can also install both CLIs. They use separate sessions and do not conflict; on our box they ran one after the other against the same page without any setup changes.

FAQ

Is agent-browser built on Playwright?

No. agent-browser is a native Rust binary that talks to Chrome directly over the Chrome DevTools Protocol through its own daemon. It is distributed through npm, which installs a small Node wrapper and the right binary for your platform, and through Homebrew.

Is agent-browser better than Playwright MCP?

For shell capable coding agents it usually uses less context, because its interactive snapshot drops non interactive content and its action replies are tiny. Playwright MCP is better when your client can only use MCP tools, when you need Firefox or WebKit, or when you want generated Playwright code after each step. If the agent is debugging your own web app in Chrome (performance traces, logpoints, network mocks), Google's Chrome DevTools MCP is the better fit than either.

Does agent-browser have an MCP server?

Yes. agent-browser mcp starts an MCP server over stdio. On version 0.42.0 it listed 33 tools, covering navigation, snapshots, clicks, form filling, waits, screenshots, tabs and saved flows.

What is the difference between Playwright CLI and Playwright MCP?

They share the same Playwright engine and snapshot format. The CLI is called with shell commands and learns its commands from a skill or --help, while MCP sends the client a schema for every tool up front. Microsoft's own README recommends the CLI for coding agents and MCP for long running loops that need rich page introspection.

Are agent-browser and Playwright free?

Yes. All three are open source under Apache 2.0 and free to run on your own machine. You pay only for the model that drives them, and for a hosted browser service such as Browserbase if you use one.

Which browsers does agent-browser support?

Chrome for Testing by default, any Chrome you attach to with --cdp, the Lightpanda and Obscura engines, Mobile Safari in the iOS Simulator, and several cloud browser providers. Playwright CLI and Playwright MCP accept Chrome, Edge, Firefox and WebKit.