Best AI repos for browser automation in 2026: Playwright MCP vs Browser Use vs agent-browser
Letting an AI agent use a browser used to mean screenshots, a vision model and a lot of misclicks. That changed. The open-source tools that lead this space in 2026 read the page as structured data (an accessibility tree with element references), so the model clicks "@e3" instead of guessing pixel c

Posted on Oct 29 • Originally published at dedupedai.com
Letting an AI agent use a browser used to mean screenshots, a vision model and a lot of misclicks. That changed. The open-source tools that lead this space in 2026 read the page as structured data (an accessibility tree with element references), so the model clicks "@e3" instead of guessing pixel coordinates.
There are three repos most people end up choosing between, and they solve different problems:
Below is how to set up each one with real commands from their READMEs, and when to pick which. If you want the full ranked list with more options, including computer-use sandboxes, it lives on our best AI repos for browser automation page.
Playwright MCP exposes Playwright as MCP tools. The README sums up why it works well with LLMs: it "operates purely on structured data" and needs no vision model, because the agent reads accessibility snapshots instead of screenshots.
claude mcp add playwright npx @playwright/mcp@latest Enter fullscreen mode Exit fullscreen mode For Codex:
codex mcp add playwright npx "@playwright/mcp@latest" Enter fullscreen mode Exit fullscreen mode For VS Code:
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}' Enter fullscreen mode Exit fullscreen mode Cursor, Windsurf, Claude Desktop and most other clients take the standard JSON block:
{ "mcpServers": { "playwright": { "command": "npx", "args": [ "@playwright/mcp@latest" ] } } } Enter fullscreen mode Exit fullscreen mode Then ask your agent something concrete, like "open localhost:3000, sign up with a test email and tell me which step fails." It will call tools such as browser_snapshot (the README describes it as "better than screenshot") and click by element reference.
A few flags worth knowing, all from the README's options table:
One honest note from Microsoft itself: the README says coding agents may get better token efficiency from Playwright CLI with skills, because a CLI avoids loading large tool schemas and full accessibility trees into context. MCP still wins for long, stateful loops such as exploratory testing or self-healing tests.
Browser Use is different in kind. Instead of your coding agent driving a browser step by step, you write a short Python program, give it a task in plain English, and the library's agent loop does the rest with whatever model you choose.
Install it with uv (the README asks for Python 3.11 or newer; run uv init --python 3.12 first in a new project):
uv add browser-use Enter fullscreen mode Exit fullscreen mode Put your model key in.env:
OPENAI_API_KEY = your-key Enter fullscreen mode Exit fullscreen mode Then the core of the README's quickstart is this:
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 ()) asyncio. run ( main ()) Enter fullscreen mode Exit fullscreen mode Run it:
uv run agent.py Enter fullscreen mode Exit fullscreen mode What makes it worth choosing over a hand-written Playwright script:
There is also a path for coding agents: the README gives a prompt you paste into Claude Code or Codex that installs Browser Use with uv and runs browser-use skill install to register it as a skill.
We keep a step-by-step card for this on our automate a web task with a Python agent page.
agent-browser is a native Rust CLI built for agents. Every action is a short shell command, which keeps the model's context small. Install it globally and download Chrome for Testing once:
npm install -g agent-browser agent-browser install Enter fullscreen mode Exit fullscreen mode Homebrew ( brew install agent-browser ) and Cargo ( cargo install agent-browser ) work too.
agent-browser open example.com agent-browser snapshot # accessibility tree with refs agent-browser click @e2 # click by ref agent-browser fill @e3 "test@example.com" # fill by ref agent-browser get text @e1 agent-browser screenshot page.png agent-browser close Enter fullscreen mode Exit fullscreen mode You can also find elements semantically, which is handy when refs change between pages:
agent-browser find role button click --name "Submit" agent-browser find label "Email" fill "test@test.com" Enter fullscreen mode Exit fullscreen mode To make Claude Code use it, install the skill:
npx skills add vercel-labs/agent-browser Enter fullscreen mode Exit fullscreen mode The README explains this adds a small stub at.claude/skills/agent-browser/SKILL.md that tells the agent to load current instructions with agent-browser skills get core, so the instructions never go stale between releases. The same command works for Codex, Cursor, Gemini CLI, GitHub Copilot, Goose, OpenCode and Windsurf. If your setup needs MCP instead, agent-browser mcp exposes it as a server.
There is a walkthrough on our let your agent browse with short CLI commands page.
They also combine. A common setup is Playwright MCP for interactive debugging and Browser Use in production scripts.
Get one email every Monday with the week's hottest AI repos and exactly how to use them: subscribe free at dedupedai.com