opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Playwriter lets your MCP agents drive your own Chrome with all logins intact
GitHub RepoImpressions4

Project Description

View on GitHub

Stop Fighting Your Browser: Let Your Agents Use the Chrome You Already Have

You know the drill. You spin up a browser automation tool, it launches a fresh Chromium instance, and suddenly you're staring at a login page. No cookies, no extensions, no saved sessions. Every single time. It's like your agent is a new hire who shows up on day one with zero context—except it also gets flagged by bot detectors and eats twice the memory.

That's the problem Playwriter sets out to solve. Instead of spawning a brand-new browser, it connects your agents to the Chrome you're already running. Your logins, extensions, and cookies are just... there. No setup dance required.

What It Does

Playwriter is a CLI and MCP (Model Context Protocol) server that lets AI agents control your actual Chrome browser through the full Playwright API. The architecture is refreshingly simple: you install a Chrome extension, start the CLI, and your agents can execute JavaScript directly against your live browser.

The core pieces are straightforward:

  • A Chrome Web Store extension that bridges your running browser to Playwriter
  • A CLI (playwriter) for executing commands and managing sessions
  • A skill installer so your AI agent knows how to use the tool

Under the hood, it's Playwright's automation power, but pointed at your real browser instead of a throwaway instance. You get the full API—page.goto(), page.click(), page.locator(), network interception, even CDP session access for debugging—without losing your browser state.

Sessions are stateful and isolated. Each session gets its own sandbox with persistent state, while browser tabs are shared across sessions. That means multiple agents can work in parallel without stepping on each other's toes, but they're all operating in the same browser context.

Why It's Cool

The core insight here is obvious in hindsight: why duplicate what you already have? Other browser MCPs create fresh Chrome instances, which means:

  • No logins, so every automation starts with an authentication hurdle
  • No extensions, so anything relying on installed tools breaks
  • Bot detectors flag you instantly (fresh browser fingerprint, no history, no cookies)
  • Double the memory usage, because you're running two browsers

Playwriter sidesteps all of that by connecting to your existing browser. It's a small architectural choice with big practical consequences.

The session model is genuinely thoughtful. State persists between calls, so you can accumulate data across commands:

playwriter -e "state.users = await page.$$eval('.user', els => els.map(e => e.textContent))"
playwriter -e "console.log(state.users)"

That state object is a persistent sandbox that lives across executions. You can stash network requests, store references to pages, or build up complex automation step by step.

The debugging story is interesting too. Playwriter exposes CDP sessions and a debugger interface, so you can set breakpoints in your page's JavaScript and inspect scripts live:

playwriter -e "state.cdp = await getCDPSession({ page }); state.dbg = createDebugger({ cdp: state.cdp }); await state.dbg.enable()"

That's real debugging capability, not just "click this button and hope."

There's also a practical touch in the CLI design: the tip about using single quotes for -e commands to prevent bash from eating your dollar signs and backticks. It's the kind of detail that tells you the author actually uses this tool.

How to Try It

Getting started takes about two minutes. First, install the Chrome extension and click its icon on a tab—it turns green when connected.

Then install the CLI and run your first command:

npm i -g playwriter
playwriter -s 1 -e 'await page.goto("https://example.com")'

If you want your agent to know how to use Playwriter, add the skill:

npx -y skills add remorses/playwriter

For a more controlled setup, you can start a dedicated browser with the extension pre-bundled:

playwriter browser start
playwriter session new
playwriter -s 1 -e 'await page.goto("https://example.com")'

Each session gets its own sandbox, so you can create a new one whenever you want clean state. The full README with all the examples is over at the GitHub repository.

Final Thoughts

Playwriter is one of those tools that makes you wonder why nobody built it sooner. It's not flashy—it just removes a dumb obstacle that every browser automation workflow hits. If you're building agents that need to interact with authenticated pages, or if you're tired of maintaining separate browser instances just for automation, this is worth a look.

The approach is pragmatic: meet developers where they already are, in their real browser, with their real state. It won't replace headless testing setups, but for agent-driven automation that needs to feel human, it's a solid option. Give it a spin and see how much friction disappears when your agents finally get to use your browser instead of their own.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 7ebb179b-7ab3-4c3b-9aa9-0aef5c2652e5Last updated: August 22, 2026 at 02:47 AM