AI Navigate

Let AI Control Your Real Browser — Not a Throwaway One

Dev.to / 3/20/2026

💬 OpinionDeveloper Stack & InfrastructureTools & Practical Usage

Key Points

  • Dramaturg and the Playwright MCP integration enable AI to control your real Chrome tabs, keeping cookies, sessions, and localStorage intact rather than launching a fresh browser.
  • The architecture runs Playwright inside the browser via a Chrome extension (playwright-crx) with no Node.js relay or separate browser process.
  • The system exposes only two MCP commands for the AI—run_command and run_script—with keyword syntax (.pw) supporting actions such as snapshot, goto, click, fill, and verify-text.
  • No re-authentication for services like Gmail or Notion is required, and the AI can observe and act in real time across your actual tabs with built-in expect() assertions.

Most browser MCP servers launch a separate browser instance. Clean slate, no cookies, no auth. Want to automate something behind a login? Re-authenticate every time. Want to test your actual session state? Too bad.

What if the AI could just use the browser you already have open?

That's what Dramaturg + @playwright-repl/mcp does. The AI controls your real Chrome tabs — your cookies, your sessions, your localStorage — all intact.

How it works

Claude (or any MCP client)
  ↕ MCP (stdio)
playwright-repl MCP server
  ↕ WebSocket
Dramaturg Chrome extension
  ↕ CDP / chrome.debugger
Your real Chrome tabs

The key difference: Playwright runs inside the browser, not outside it. The extension uses playwright-crx to run the full Playwright API directly in Chrome's service worker. No Node.js relay, no separate browser process.

This means:

  • No re-authentication — Gmail, Notion, your internal tools — already logged in
  • expect() assertions — something no other browser MCP server supports
  • You see everything — the AI works in your actual tabs, in real time

Just two tools

While Playwright's official MCP server exposes ~70 tools, @playwright-repl/mcp exposes just two:

  • run_command — execute a single command (keyword or JavaScript)
  • run_script — run a multi-line script

The AI figures out what to do with them. Here's what a command looks like:

Keyword syntax (.pw)

snapshot                    → accessibility tree
goto https://example.com    → navigate
click "Sign in"             → click by text
fill "Email" "user@test.com"  → fill a form field
verify-text "Welcome"       → assert text is visible

Playwright API (JavaScript)

await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByText('Welcome')).toBeVisible();

Both work through the same run_command tool. The extension auto-detects the format.

AI Agents that actually verify their work

The MCP package includes four agents that go beyond "generate and hope":

Planner — Give it a URL and a goal. It takes snapshots, maps out the page structure, and produces a step-by-step workflow plan with the exact labels and text it found.

Generator — Takes a plan and turns it into a working script. The key word is working — it runs every command in the real browser, assembles the script, executes the full thing via run_script, and iterates until it passes.

Healer — Give it a broken script. Wrong selectors, changed page structure, timing issues. It runs the script, diagnoses failures with snapshots, fixes them, and re-runs until all lines pass.

Converter — Translates between .pw keyword syntax and JavaScript Playwright API. Produces idiomatic output — proper locator strategies, extracted variables, chained methods.

Every agent must run the script before outputting it. No "here's what should work" — it either passes or the agent keeps fixing.

Setup

1. Install

npm install -g @playwright-repl/mcp

Install Dramaturg from the Chrome Web Store.

2. Configure Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "playwright-repl": {
      "command": "playwright-repl-mcp"
    }
  }
}

Or for Claude Code:

claude mcp add playwright-repl playwright-repl-mcp

3. Install the AI agents (optional)

mkdir -p .claude/agents
cp node_modules/@playwright-repl/mcp/agents/*.agent.md .claude/agents/

4. That's it

The extension connects automatically. No side panel needed. Just make sure Chrome is running.

Example prompts

Go to https://demo.playwright.dev/todomvc, add three todos, complete one, and verify the Active filter only shows the remaining two.

@playwright-repl-planner explore https://demo.playwright.dev/todomvc and plan a test for adding and completing todos

@playwright-repl-generator create a .pw script that adds 3 todos, completes one, and verifies the Active filter

@playwright-repl-healer this script is failing on line 5 — the selector changed after a site update: [paste script]

@playwright-repl-converter convert this .pw script to JavaScript: [paste script]

Human + AI, side by side

The extension isn't just a bridge for the AI — it's a full REPL you can use alongside it:

  • Watch commands execute in real time as the AI works
  • Intervene manually — type snapshot to check state, or navigate to a different page
  • Record your own interactions — click Record, interact with the page, get .pw commands or JS code
  • Switch tabs — the toolbar dropdown lets you redirect both the AI and your commands to any open tab

vs. other browser MCP servers

playwright-repl Playwright MCP Playwriter
MCP tools 2 ~70 1
Your real session Yes No Yes
Playwright inside browser Yes No No
expect() assertions Yes No No
Full Playwright API Yes Yes Yes
Human REPL alongside AI Yes No No

Try it

> snapshot
> click "Sign in"
> fill "Email" "user@test.com"
> verify-text "Dashboard"

Your browser. Your sessions. AI that verifies its own work.