Getting Started with Playwriter
Control your browser via Playwright API. Uses extension + CLI. No context bloat.
Installation
Add the Playwriter extension from the Chrome Web Store.
Click the extension icon on a tab. It turns green when connected.
Install the CLI and start automating the browser:
npm i -g playwriter
playwriter -s 1 -e "await page.goto('https://example.com')"
Install the Playwriter skill so your agent can call the CLI:
npx -y skills add remorses/playwriter
Quick Start (CLI)
playwriter session new # creates stateful sandbox, outputs session id (e.g. 1)
playwriter -s 1 -e "await page.goto('https://example.com')"
playwriter -s 1 -e "console.log(await accessibilitySnapshot({ page }))"
playwriter -s 1 -e "await page.locator('aria-ref=e5').click()"
How It Works
- No new Chrome instances: Works with your current browser session
- No CDP mode required: No need to restart Chrome with special flags
- Full CDP access: Complete Chrome DevTools Protocol capabilities
- Visual feedback: Extension icon changes color to indicate connection status
Icon States
- Gray: Not connected to any tab
- Green: Successfully connected and ready
- Orange badge (...): Connecting to relay server
- Red badge (!): Error occurred
Privacy & Security
Playwriter MCP runs locally in your browser and does not send any data to external servers. All browser control happens through the standard Chrome DevTools Protocol on your machine.
MCP Setup (Optional)
The CLI is the recommended way to use Playwriter. If you need MCP server setup, auto-configure it with:
npx -y @playwriter/install-mcp playwriter@latest
For full MCP instructions, see MCP.md.
Need Help?
For issues, feature requests, or contributions, visit the GitHub repository .