Blog /

Playwright MCP vs Claude in Chrome: Which Fits Your Agent

Playwright MCP vs Claude in Chrome compared on setup, sign-in, browser control and unattended runs, with a table and guidance on which fits your agent.

Playwright MCPClaude in ChromePlaywright CLI

Use Claude in Chrome when the agent is Claude Code and the page needs the login already in your own browser: it shares your browser's login state and works in a visible Chrome window. Use Playwright MCP when you want a browser the agent controls itself, from any MCP client, across Chrome, Firefox, WebKit and Edge, with a saved or a throwaway profile. Use Playwright CLI when a coding agent should drive the browser through shell commands, headless by default and lighter on context.

The deciding trade-off is not a feature count. A browser that already holds your sign-ins removes setup, but its state changes from run to run. A browser the agent launches itself takes a little setup, but you decide what state it starts with. The rest of this guide shows where each one is the better choice, using only what the official docs say.

Three ways to give your coding agent a browser

Say you run a live web app with a small team and write most of the code with Claude Code, Cursor or Codex. The agent has just changed the billing form and needs a real browser to look at the page, read console errors or walk through signup before it says it is finished. Three setups cover that need:

  • Claude in Chrome connects Claude Code to the Claude in Chrome extension in your own browser (Claude Code docs).

  • Playwright MCP is an MCP server that launches and drives a browser for the agent (Playwright MCP docs).

  • Playwright CLI gives the agent shell commands that drive a browser (Playwright CLI docs).

If you are weighing a debugging tool instead, see our comparison of Chrome DevTools MCP and Playwright MCP.

Should I use Playwright MCP or Claude in Chrome?

Use Claude in Chrome if you work in Claude Code, you are watching the screen, and the page sits behind a login you already have in your browser. Use Playwright MCP if you use another MCP client, want Firefox or WebKit, or want the same flow to start from the same state every time.

According to the Claude Code docs, Claude "opens new tabs for browser tasks and shares your browser's login state, so it can access any site you're already signed into. Browser actions run in a visible Chrome window in real time." When it meets a login page or CAPTCHA, "it pauses and asks you to handle it manually."

Playwright MCP "operates on the page's accessibility tree, not pixels" and, by default, keeps a persistent profile: "Login state and cookies are preserved between sessions" (Playwright MCP docs).

Clients
Claude in Chrome
Claude Code (CLI and VS Code extension)
Playwright MCP
"VS Code, Cursor, Windsurf, Claude Code, Claude Desktop, and any MCP client"
Playwright CLI
Coding agents that run shell commands, such as Claude Code and GitHub Copilot
Browsers
Claude in Chrome
Google Chrome and Microsoft Edge; Claude Code also detects other Chromium browsers such as Brave, Arc, Vivaldi and Opera
Playwright MCP
Chrome (default), Firefox, WebKit, Edge
Playwright CLI
Chrome, Firefox, WebKit, Edge via --browser=
Signed-in session
Claude in Chrome
Shares your browser's login state
Playwright MCP
Persistent profile by default keeps login between sessions; --extension connects to your existing tabs
Playwright CLI
Profile in memory by default; --persistent saves it to disk; state-save / state-load reuse cookies and localStorage
Isolation
Claude in Chrome
Opens its own tabs in a tab group in your browser
Playwright MCP
--isolated keeps the profile in memory, not on disk
Playwright CLI
Named sessions with -s=name
Visible or headless
Claude in Chrome
Visible Chrome window
Playwright MCP
Headed by default; --headless to hide it
Playwright CLI
Headless by default; --headed to show it
Setup
Claude in Chrome
claude --chrome (needs the extension, /login and a direct Anthropic plan)
Playwright MCP
claude mcp add playwright npx @playwright/mcp@latest
Playwright CLI
npm install -g @playwright/cli@latest

Sources: Claude Code Chrome docs, Playwright MCP introduction, Playwright MCP getting started, Playwright MCP options, Playwright CLI getting started.

Limits worth knowing before you choose

  • Claude in Chrome needs signing in with /login. With an API key or a long-lived token from claude setup-token, Claude Code keeps Chrome integration off. It is not available through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry, not supported in WSL, and off when an organization has Zero Data Retention enabled for Claude Code (docs).

  • Playwright MCP opens a visible browser unless you pass --headless, so set it explicitly on a machine without a display (options).

  • Playwright CLI keeps the profile in memory by default, so cookies are "lost when the browser closes" unless you use --persistent or save state (CLI docs).

How each one handles an existing login

Logins separate a quick look from a check you can repeat.

Claude in Chrome uses the sign-ins already in your browser, so the agent can open a gated dashboard with no cookie export or scripted login. The flip side: what it sees depends on whatever state your browser is in at that moment, and it stops at login pages and CAPTCHAs for you to handle.

Playwright MCP gives you four documented choices (getting started, options):

  • Persistent profile (default): login state and cookies are kept between sessions. --user-data-dir sets a custom profile directory.

  • --isolated: "Keep the browser profile in memory, do not save it to disk", so each session starts fresh.

  • --extension: "Connect to your existing browser tabs with the Playwright Extension."

  • --cdp-endpoint: connect to a browser by CDP endpoint or channel name.

For exact setup in Claude Code, see our walk-through on running Playwright MCP with Claude Code.

One tool gets an agent into a login quickly. The other gets an agent back into it on purpose.

Whichever you pick, a few habits keep the risk small: use a dedicated test account rather than your personal one, decide how expired sessions get refreshed, and keep tokens and passwords out of saved screenshots and recordings. The Claude Code docs warn that a recorded GIF "captures everything visible in the browser, including account details on logged-in pages".

How the agent sees and controls the page

Claude in Chrome lists its uses as live debugging from console errors and DOM state, design verification, web app testing, authenticated web apps, data extraction, form filling, file uploads and GIF recordings. To see every browser tool, run /mcp, select claude-in-chrome, then View tools (docs).

Playwright MCP works from accessibility-tree snapshots. Its docs list screenshots, network request listing and route mocking, console messages, and storage state save and restore. Extra capability groups are switched on with --caps, whose values are network, storage, testing, vision, pdf, devtools and config (options).

Context use differs. The Playwright MCP introduction rates MCP token cost as "Higher — tool schemas + snapshots in context" and the CLI as "Lower — concise CLI output, skills loaded on demand". Claude in Chrome has a related note: turning it on by default "increases context usage since the browser tools and their instructions are always loaded".

Core distinction: Claude in Chrome works in the browser you already use. Playwright MCP drives a browser it controls.

Which tool fits each job

Playwright's own split: MCP fits "Specialized agentic loops, exploratory automation"; the CLI fits "Coding agents (Claude Code, Copilot) working with large codebases" (introduction). For that choice alone, see Playwright CLI vs Playwright MCP.

  • Looking at a page behind your login while you watch: Claude in Chrome, from Claude Code. Start with claude --chrome.

  • Repeating the same user journey across branches: Playwright MCP with its persistent profile, so the agent signs in once and the state is the one you set up.

  • A run where leftover cookies could hide a bug: Playwright MCP with --isolated. The flow has to sign in from scratch each time.

  • Long sessions in a large codebase where context is tight: Playwright CLI, headless by default.

  • Cursor, Codex or another non-Claude client: Playwright MCP or the CLI. The Claude in Chrome docs cover Claude Code only.

  • Reproducing a tricky bug, then making it repeatable: find it in Claude in Chrome where your tabs and console are already open, then have the agent replay the steps through Playwright MCP.

Common questions

Which one fits a page behind an existing login?

Claude in Chrome, if you use Claude Code: it shares your browser's login state. Playwright MCP also keeps login between sessions in its default persistent profile, or can join your existing tabs with --extension.

Can I use these tools with Cursor or Codex?

Playwright MCP works with any MCP client, and the CLI works with any agent that can run shell commands. The Claude in Chrome docs describe Claude Code only.

Which one fits a run nobody watches?

Playwright CLI runs headless by default; Playwright MCP runs headless with --headless. Claude in Chrome runs in a visible window and pauses at login pages and CAPTCHAs for you.

Your agent says “done”. We check your app.

After each deploy and every day, we walk the journeys you choose on your live app and tell your agent what passed and what failed, with screenshots.

claude mcp add --scope user --transport http checkmyapp https://checkmyapp.dev/mcp

Free account: $3 of checks, no card · Cursor, Codex and the full install guide

Choose the tool, then check the deployed app

Pick the browser tool that matches the job in front of the agent, and write the mode and profile into its config rather than trusting defaults.

All three give your own agent a browser inside its session. None of them checks the deployed app after the session ends, and in all three the agent that wrote the change is also the one deciding it works.

That later check is what CheckMyApp is for. Your agent says "done"; CheckMyApp uses your live app as a real user and tells it what broke. Read why a separate check of the live app matters, and see what to check after a deploy.

For production debugging from the agent's side, tools like Kopai connect an agent to an app's traces, logs and metrics through MCP.

If you only need your agent to look at pages while you watch, Claude in Chrome or Playwright MCP may be all you need.

This article was prepared with the help of AI. Found a mistake? Tell us.

More articles