Playwriter
Chrome extension & CLI to let agents control your browser. Runs Playwright snippets in a stateful sandbox. Available as CLI or MCP
What is Playwriter?
Playwriter is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to chrome extension & cli to let agents control your browser. runs playwright snippets in a stateful sandbox. available as cli or mcp
Chrome extension & CLI to let agents control your browser. Runs Playwright snippets in a stateful sandbox. Available as CLI or MCP
This server falls under the Browser Automation category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Chrome extension & CLI to let agents control your browser. R
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx playwriterConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Playwriter
Playwriter is a Chrome extension and CLI tool that lets AI agents control a real browser by executing Playwright JavaScript snippets in a stateful sandbox. Unlike headless Playwright, it runs inside your actual Chrome browser so agents can interact with authenticated sessions, extensions, and pages that require real browser state. It is available both as a standalone CLI and as an MCP server, and supports remote browser control over network tunnels for use in cloud agent workflows.
Prerequisites
- Node.js 18 or later installed
- Google Chrome browser installed
- Playwriter Chrome extension installed from the Chrome Web Store
- An MCP client such as Claude Desktop, or use the CLI directly
- Optional: a tunnel service (e.g. traforo) for remote browser access
Install the Playwriter CLI globally
Install the playwriter package globally via npm so the CLI is available on your PATH.
npm i -g playwriterInstall the Chrome extension
Install the Playwriter extension from the Chrome Web Store. The extension is what allows the CLI and MCP server to communicate with your real Chrome browser. Search for 'Playwriter MCP' in the Chrome Web Store or use the direct link from the repository.
Start Chrome with the bundled extension
Use the CLI to launch Chrome with the Playwriter extension loaded and ready for agent control.
playwriter browser startCreate an isolated browser session
Create a new isolated session to keep agent interactions separate from your regular browsing. Sessions maintain state (cookies, localStorage) across multiple agent commands.
playwriter session newAdd to Claude Desktop as an MCP server
Register Playwriter as an MCP server in Claude Desktop so Claude can call the execute tool to run Playwright snippets in your browser.
{
"mcpServers": {
"playwriter": {
"command": "npx",
"args": ["-y", "playwriter"],
"env": {}
}
}
}Configure remote access (optional)
To control a browser on a remote machine over a network tunnel, set the PLAYWRITER_HOST and PLAYWRITER_TOKEN environment variables.
export PLAYWRITER_HOST=https://my-machine-tunnel.traforo.dev
export PLAYWRITER_TOKEN=your-secret-tokenPlaywriter Examples
Claude Desktop configuration
Register Playwriter as an MCP server. The execute tool becomes available for Claude to run Playwright JavaScript snippets in your browser.
{
"mcpServers": {
"playwriter": {
"command": "npx",
"args": ["-y", "playwriter"],
"env": {
"PLAYWRITER_HOST": "",
"PLAYWRITER_TOKEN": ""
}
}
}
}Prompts to try
After connecting Playwriter to Claude Desktop, use these prompts to control your browser with AI assistance.
- "Navigate to github.com and take a screenshot with accessibility labels so I can see what's clickable."
- "Go to my app's login page and fill in the form using the stored credentials, then submit."
- "Monitor all network requests made when I click the checkout button on this page."
- "Run this Playwright snippet to extract all product prices from the current page."
- "Set a breakpoint on this function and step through its execution while I interact with the page."Troubleshooting Playwriter
CLI cannot connect to the Chrome browser
Ensure the Playwriter Chrome extension is installed and enabled, and that Chrome was started using playwriter browser start rather than launched manually. The extension must be active for the CLI to establish a connection.
Playwright snippets fail with 'page is not defined'
The execute tool provides page, context, state, and require in scope automatically. Do not import or require Playwright — just use page directly in your snippet. Example: await page.goto('https://example.com')
Remote access setup fails authentication
Verify that both PLAYWRITER_HOST and PLAYWRITER_TOKEN are set and match the values configured on the remote machine. The host must be the full tunnel URL including https://, and the token must be identical on both ends.
Frequently Asked Questions about Playwriter
What is Playwriter?
Playwriter is a Model Context Protocol (MCP) server that chrome extension & cli to let agents control your browser. runs playwright snippets in a stateful sandbox. available as cli or mcp It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Playwriter?
Follow the installation instructions on the Playwriter GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Playwriter?
Playwriter works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Playwriter free to use?
Yes, Playwriter is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Playwriter Alternatives — Similar Browser Automation Servers
Looking for alternatives to Playwriter? Here are other popular browser automation servers you can use with Claude, Cursor, and VS Code.
Chrome DevTools MCP
★ 40.6kAI-powered Chrome automation server with natural language element detection. Control Chrome browser through MCP protocol for testing, debugging, and performance analysis. Features 91% accuracy in element location, works with free AI models, and suppo
UI TARS Desktop
★ 34.9k📇 🏠 - Browser automation capabilities using Puppeteer, both support local and remote browser connection.
Playwright
★ 32.8kA production-ready browser automation server that enables AI assistants to interact with web pages using tools for navigation, element interaction, and data extraction. It features a built-in Inspector UI and robust crash recovery for reliable automa
Page Agent
★ 18.0kJavaScript in-page GUI agent. Control web interfaces with natural language.
Chrome
★ 11.7kAn extension-based MCP server that enables AI assistants to control your browser, leveraging existing sessions and login states for automation and content analysis. It provides over 20 tools for semantic tab search, interactive element manipulation,
LAMDA
★ 7.8kThe most powerful Android RPA agent framework, next generation mobile automation.
Browse More Browser Automation MCP Servers
Explore all browser automation servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Playwriter in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Playwriter?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.