Skip to content
ML2

Browser Agents Compared: browser-use vs Stagehand vs Playwright MCP

A browser agent lets an A.I. model operate a real web browser: open pages, click, type, sign in and pull data out. The four tools in our directory split that job in four different ways, and picking the wrong kind costs more than picking the wrong brand. Below: which one to pick, a side-by-side table, a minimal setup from each project's own docs, how each keeps passwords away from the model, and when you don't need a browser agent at all. Every version and feature links to an official source.

Published Last verified

Which browser agent should you use?

  • browser-use if you want to hand an agent a goal in plain English and let it find the path, in Python, with any model.
  • Stagehand if you know most of the steps and want repeatable, typed automations in TypeScript, Python or Go, with A.I. only where the page is unpredictable.
  • Playwright MCP if you want Claude Code, Cursor or another MCP client to open pages, click through and check its own work.
  • Workflow Record if you use Hermes Agent and would rather show a browser chore once than describe or script it.

Only need to read pages, not click through them? Skip browser agents and use a reader or crawler instead.

What is a browser agent?

Every browser agent runs the same loop: look at the page, decide the next step, act, look again. The useful question is who owns each part of that loop, because it decides cost, repeatability and how much code you write:

  • Agent framework (browser-use): you give it a goal and a model, and it plans every step. Least code, least predictable.
  • Browser SDK with A.I. steps (Stagehand): your code owns the steps and calls the model only where a selector would break. More code, most repeatable.
  • Tool server (Playwright MCP): an agent you already run, such as Claude Code or Cursor, does the planning and calls browser tools one at a time.
  • Record and replay (Workflow Record): you do the task once, and the agent learns a skill that repeats it with new details.

Sources: Stagehand v4 migration guide (opens in new tab), Playwright MCP README (opens in new tab), browser-use README (opens in new tab).

Browser agent comparison table

Versions are the latest release on each package registry or repository on 3 Nov 2026. Each tool's section below links the source for every cell.

  • browser-use

    Browser Use · 0.13.14

    Interface
    Python 3.11+ library, CLI, local MCP server
    Licence
    MIT
    Who drives
    Its own Agent loop: the model picks every step until the task is done
    How it sees the page
    Indexed list of page elements, plus screenshots unless you set use_vision=False
    Repeat runs
    Save a run, then load_and_rerun replays clicks and typing with new values and no model call per step (extract steps still call it)
    Secrets
    sensitive_data placeholders, scoped per domain; the model sees the key name, not the value
    Hosted option
    Browser Use Cloud: cloud browsers from $0.02 per browser-hour, or a fully hosted agent API
  • Stagehand

    Browserbase · 4.3.0 · 4.3.0

    Interface
    TypeScript, Python and Go SDKs
    Licence
    MIT
    Who drives
    Your code: Playwright-style page calls, plus act, observe and extract where a selector would break
    How it sees the page
    Trimmed accessibility tree, resolved to real selectors
    Repeat runs
    Browserbase's server-side cache returns repeated act, observe and extract calls with no tokens (Browserbase browsers only)
    Secrets
    observe() returns real selectors, so your code fills credentials and they never reach the model
    Hosted option
    Browserbase cloud browsers (persistent contexts, proxies, session replay) and a hosted MCP server
  • Playwright MCP

    Microsoft · 0.0.84

    Interface
    MCP server (Node.js 18+) for any MCP client
    Licence
    Apache-2.0
    Who drives
    Your MCP client's model (Claude Code, Cursor, Codex, VS Code and others) calls one browser tool at a time
    How it sees the page
    Accessibility snapshots with element refs; no vision model needed (vision is opt-in)
    Repeat runs
    Every step is a model turn; ask the agent to write a Playwright test once the flow works
    Secrets
    --secrets loads a dotenv file of values to keep out of responses; --allowed-origins is not a security boundary
    Hosted option
    None: runs on your machine with npx, or in Docker (headless Chromium)
  • Workflow Record

    Nous Research (Hermes Labs) · 0.1.0

    Interface
    Hermes Agent plugin (hermes record CLI + skill)
    Licence
    MIT
    Who drives
    You, once: do the task while it records, then /learn turns it into a skill Hermes replays with new details
    How it sees the page
    Records clicks (CSS selector plus visible label), field values, Enter presses and navigations over the DevTools protocol
    Repeat runs
    Replays as a Hermes skill with new values each time, using Hermes' browser tools
    Secrets
    Password-like fields are masked as {SECRET:name} and filled at replay from Hermes' browser vault or an env var
    Hosted option
    None: local, Chromium-family browsers only (Chrome, Chromium, Brave, Edge)

browser-use

Browser UseAgent frameworkMIT

The best-known open-source browser agent. You hand it a task in plain English and a model, and its Agent class runs the whole look, decide, act loop in a real Chromium browser until it calls done or hits its step limit. It works with OpenAI, Anthropic, Google and local models through Ollama, or with Browser Use's own BU2 model.

Pick it if you want to hand an agent a goal in plain English and let it find the path, in Python, with any model.

Best for: Open-ended web tasks where you can't script the path in advance: research across sites, one-off data collection, filling forms on portals you have never seen.

Standout features

  • One Agent(task=...) call is a working browser agent, so prototypes take minutes.
  • Model-flexible: provider wrappers for OpenAI, Anthropic and Google, local models through Ollama, or BU2 through the Browser Use gateway.
  • Saved runs can be replayed with new variables, turning a successful exploration into a cheaper repeat job.
  • The same code moves to a cloud browser with Browser(use_cloud=True), with stealth, proxies, CAPTCHA solving and a live view.
  • Also ships a CLI and a local MCP server, so Claude Code, Cursor and other agents can use it as a browser tool.

Limits

  • Every live step is a model call, so long tasks cost more and can take a different path on each run.
  • The open-source library is Python only. The browser-use package on npm is an unofficial port, not from Browser Use.
  • The agent's own done and success flags are self-reported; verify anything important (a payment, a submitted form) yourself.

Skip it if the steps are known and must run the same way every time (script them with Stagehand or plain Playwright) or you only need to read pages (use a reader such as Firecrawl or Jina Reader).

Minimal browser agent (python)

import asyncio

from browser_use import Agent, ChatOpenAI
from dotenv import load_dotenv

load_dotenv()

async def main():
    agent = Agent(
        task="Find the number of stars of the browser-use repo",
        llm=ChatOpenAI(model="gpt-5.6-luna"),
    )
    history = await agent.run()
    print(history.final_result())

if __name__ == "__main__":
    asyncio.run(main())

Shortened from the official README (uv add browser-use, Python 3.11+, OPENAI_API_KEY in .env). Source: browser-use README quickstart (opens in new tab)

Stagehand

BrowserbaseBrowser SDK with A.I. stepsMIT

Browserbase's SDK for browser agents. It gives you ordinary page APIs (goto, click, locator, screenshot) plus three A.I. steps: act performs one instruction, observe finds elements and returns their selectors, and extract returns data validated against your schema. Version 4 removed the built-in agent() loop: your code, or an agent framework you already use, decides what happens next.

Pick it if you know most of the steps and want repeatable, typed automations in TypeScript, Python or Go, with A.I. only where the page is unpredictable.

Best for: Production flows you want repeatable and debuggable: scheduled scraping behind a login, back-office automations, end-to-end checks on sites that change their markup.

Standout features

  • Mix deterministic page calls and A.I. steps in the same script, so you only pay for inference where the page needs judgement.
  • extract() returns typed data checked against a Zod (TypeScript) or Pydantic (Python) schema.
  • The same API in TypeScript, Python and Go.
  • On Browserbase, caching is on by default and identical calls come back without a model call.
  • Ready-made integrations give Claude Code, Codex, Cursor, Mastra, CrewAI and the Vercel AI SDK persistent Stagehand browser tools.

Limits

  • No autonomous loop since v4: you write the control flow, or wire Stagehand's tools into an agent framework.
  • The managed cache needs a Browserbase browser; local runs call the model each time.
  • Cached results key on the page URL and content, so dynamic URLs or changed pages fall back to inference.

Skip it if you want to hand over a goal and let the agent find the path (browser-use) or you only need a browser inside an existing coding agent (Playwright MCP).

Sign in and extract (typescript)

import { localBrowser, Stagehand } from "@browserbasehq/stagehand";
import { z } from "zod/v4";

const browser = await localBrowser.launch({ userDataDir: "./browser-data" });
const stagehand = await Stagehand.create({
  browser,
  model: { modelName: "openai/gpt-5.4-mini", apiKey: process.env.OPENAI_API_KEY },
});

const [page] = await browser.context.pages();
await page.goto("https://app.example.com/login");

// observe() returns real selectors, so credentials never reach the model
const { data: email } = await stagehand.observe("find the email input");
await page.locator(email[0].selector).fill(process.env.APP_EMAIL!);

await stagehand.act("click the sign in button");
const { data } = await stagehand.extract(
  "extract every invoice in the table",
  z.object({ invoices: z.array(z.object({ number: z.string(), amount: z.number() })) }),
);
console.log(data.invoices);
await stagehand.close();
await browser.close();

Shortened from the official README (npm install @browserbasehq/stagehand zod; Chrome installed for local runs). Source: Stagehand README (opens in new tab)

Playwright MCP

MicrosoftMCP tool serverApache-2.0

Microsoft's Model Context Protocol server for Playwright. It doesn't plan anything itself: it gives the agent you already use tools such as browser_navigate, browser_snapshot and browser_click, and returns a structured accessibility snapshot after each action so the model can pick the next element by ref.

Pick it if you want Claude Code, Cursor or another MCP client to open pages, click through and check its own work.

Best for: Giving a coding or chat agent a real browser: checking its own UI work on localhost, reproducing a bug, clicking through a flow before writing a test.

Standout features

  • One line to install in Claude Code, Cursor, VS Code, Codex, Gemini CLI, Goose and most other MCP clients.
  • Works from structured accessibility data, so any tool-calling model can use it without screenshots.
  • Flags for headless runs, isolated profiles, saved storage state, device emulation and connecting to your open Chrome or Edge through an extension.
  • Pairs naturally with Playwright tests: the agent explores, then writes the deterministic test.

Limits

  • Snapshots and tool schemas use a lot of context. Microsoft itself suggests its Playwright CLI with skills for coding agents that need to save tokens.
  • No cloud browsers, stealth or proxies: it is a local tool layer, not browser infrastructure.
  • Still on 0.0.x versions, so flags and tool names can change between releases.

Skip it if you're building your own product's agent rather than equipping a coding assistant (browser-use or Stagehand fit better) or the same job must run unattended on a schedule.

Add it to your MCP client (json)

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}

Standard config from the official README (Claude Code: claude mcp add playwright npx @playwright/mcp@latest). Source: Playwright MCP README (opens in new tab)

Workflow Record

Nous Research (Hermes Labs)Record-and-replay pluginMIT

A Nous Research labs plugin for Hermes Agent. Instead of describing a browser chore in a prompt, you do it once in Chrome while hermes record watches, then /learn writes a skill that repeats it with fresh details. Recordings stay on your machine as JSON until you choose to learn from one.

Pick it if you use Hermes Agent and would rather show a browser chore once than describe or script it.

Best for: Hermes Agent users with a repeat browser chore (a weekly form, a portal login and status check, a reorder) who would rather show it once than write a prompt or a script.

Standout features

  • Teach by demonstration: no prompt engineering and no code.
  • Secrets are masked inside the page before anything is saved, then filled at replay time.
  • A --manual mode lets you type the steps when CDP isn't available (Firefox, Safari) or the flow is sensitive.

Limits

  • A labs plugin: Nous Research says it works but doesn't support or maintain it, so a Hermes update can break it.
  • Records one tab only, and misses scrolling, hovering, drag and drop, file uploads and canvas content.
  • Only password-like fields are masked; an API key in a plain text field or a token in a URL is recorded as typed, so review the JSON.

Skip it if you don't use Hermes Agent, or the task changes shape every time (a demonstration only captures one path).

Record, review, learn (bash)

hermes plugins install workflow-record

# Start a browser Hermes can reach over CDP (or /browser connect in a chat)
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/hermes-rec

# Open the start page, then do the task once and press Ctrl-C
hermes record --slug shop-login

hermes record --list   # review the JSON before learning from it
# In a Hermes chat: /learn the browser workflow recorded in <file>.json

From the official README (Hermes Agent installed; a Chromium-family browser with remote debugging on port 9222). Source: Workflow Record README (opens in new tab)

When you don't need a browser agent

A browser agent is the slowest and most expensive way to touch the web. If a site has a documented API, use it. If you only need the content of a page, a reader or crawler is faster, cheaper and easier to keep within a site's terms:

  • Firecrawl if you only need to read or crawl pages as clean Markdown or JSON, not click through them.
  • Jina Reader if you need one URL turned into LLM-ready text with no setup.
  • Crawl4AI if you want an open-source crawler you run yourself for LLM-ready page data.
  • agent-desktop if the app your agent must operate is a native desktop app, not a web page.

How to choose a browser agent

  • Start with who should plan the steps. The agent (browser-use), your code (Stagehand), the coding assistant you already use (Playwright MCP), or you, once, by demonstration (Workflow Record).
  • Then how often it runs. A one-off task suits an autonomous agent. A job that runs every day should become a script or a cached flow, so you aren't paying a model to rediscover the same clicks.
  • Then your language. Python: browser-use or Stagehand. TypeScript or Go: Stagehand. Any language, inside an MCP client: Playwright MCP.
  • Decide where the browser runs. Local is free and private. Cloud browsers (Browser Use Cloud, Browserbase) add stealth, proxies, saved logins and recordings for unattended jobs.
  • Make it check itself. Have the agent verify the result, then turn the flow into a test. See agent UI testing with Playwright MCP for the pattern.

Run browser agents safely

Browser agents read untrusted pages, and any page can carry hidden instructions. Whatever you pick:

  • Use a separate browser profile or a cloud browser with only the logins the task needs, never your everyday signed-in browser.
  • Keep secrets out of prompts with each tool's own mechanism (see the Secrets row in the table), and review saved runs or recordings before sharing them.
  • Keep a human approval step for payments, sending messages and anything you can't undo.
  • Prefer an API where one exists, and respect each site's terms and rate limits.

Browser agent FAQ

What is a browser agent?

An A.I. agent that operates a real web browser: it looks at the page, decides the next step, clicks or types, then looks again until the task is done. The tools on this page split that loop differently. browser-use runs the whole loop for you, Stagehand gives your code A.I. steps to call, Playwright MCP gives an existing agent browser tools, and Workflow Record learns the steps from a demonstration.

browser-use or Stagehand: which should I use?

Pick browser-use when the path isn't known in advance and you want the agent to work it out, in Python. Pick Stagehand when your code should own the steps and you want them repeatable and cheap to rerun, in TypeScript, Python or Go. Many teams explore a task with browser-use, then script the stable version with Stagehand.

Does Stagehand still have agent()?

No. Stagehand v4 removed the built-in agent() loop and its migration guide says nothing replaces it one-for-one. Use code mode (deterministic page calls plus act, observe and extract) or connect Stagehand's tools to an agent framework you already use, such as Mastra, CrewAI, the Vercel AI SDK or Claude Code.

Playwright MCP or browser-use for Claude Code and Cursor?

Playwright MCP is the simpler fit: it adds browser tools to the agent you already run, and that agent's model does the planning. browser-use also offers a local MCP server and a CLI for coding agents, but it brings its own agent loop, which suits handing off a whole web task rather than individual clicks.

Is Playwright MCP the same as Playwright?

No. Playwright is Microsoft's browser testing library that you script yourself. Playwright MCP is a separate server that exposes Playwright as tools an A.I. agent can call. Microsoft also offers a Playwright CLI with skills, which it suggests for coding agents that need to save tokens.

Are these browser agents free?

All four are free and open source: browser-use, Stagehand and Workflow Record are MIT-licensed, and Playwright MCP is Apache-2.0. You pay for the model calls, and optionally for cloud browsers: Browser Use Cloud for browser-use, Browserbase for Stagehand.

How do browser agents keep passwords away from the model?

Each tool does it differently. browser-use swaps sensitive_data values for placeholders, scoped per domain. Stagehand's observe() returns real selectors so your own code fills the field. Playwright MCP can load a dotenv secrets file. Workflow Record masks password-like fields and fills them at replay time. None of them makes an agent safe on its own: use a separate browser profile and keep a human approval step for payments and anything irreversible.

Can a browser agent be tricked by a web page?

Yes. Pages, emails and reviews can carry hidden instructions (prompt injection), and an agent signed in to your accounts may follow them. Run agents in an isolated or cloud browser with only the logins the task needs, limit which sites they can visit, and verify important results yourself.

Should I use a browser agent for web scraping?

Only when you must click, sign in or fill forms. To read pages, a reader or crawler such as Firecrawl, Jina Reader or Crawl4AI is faster and cheaper, and a documented API beats both. Check each site's terms and rate limits either way.

Which browser agent is best for TypeScript?

Stagehand, which has first-class TypeScript, Python and Go SDKs. The browser-use library is Python only; the browser-use package on npm is an unofficial port. Playwright MCP works from any language because your MCP client calls it.

How we checked

Versions and dates come from PyPI, npm and GitHub. Features, licences and snippets come from each project's own docs and repositories. No benchmarks or success rates are claimed: published browser-agent scores mostly come from the vendors themselves. We only compare tools that have a MoreLime.AI entry; Skyvern, Steel, Vercel's agent-browser and the model makers' computer-use tools aren't covered yet. Need an agent for the rest of your stack? See agent SDKs compared. Last verified .

Newsletter

Get the best new A.I. picks in your inbox

The best new agent workflows and tools we’ve vetted, with a clear verdict on each. Short, occasional, useful.

Free. No spam. Unsubscribe anytime.