CLI is the recommended way to use Playwriter. See CLI Usage for details.
Prerequisites
Install the Chrome extension
Basic Configuration
Add Playwriter to your MCP client settings:Claude Desktop
Edit~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows):
Cursor
Edit.cursor/mcp.json in your project root:
VS Code with Continue
Edit.continue/config.json:
Auto-Install Script
Use the installer to automatically configure your MCP client:Using the MCP Server
Enable extension on a tab
Click the Playwriter extension icon on at least one Chrome tab (icon turns green)
Available Tools
execute
Run Playwright code with access topage, context, and state variables.
Parameters:
code(string, required) - JavaScript code to executetimeout(number, optional) - Timeout in milliseconds (default: 10000)
reset
Recreate the CDP connection and reset browser/page/context. Use when:- Connection errors occur
- Page is closed
- Internal Playwright errors
- No pages available in context
state object, keeping only page, context, state (empty), and utility functions.
Verifying Installation
After configuring the MCP server:- Restart your MCP client (Claude Desktop, Cursor, etc.)
- Check that the extension icon is green on at least one tab
- Ask the AI to navigate to a website:
Troubleshooting
MCP server not responding
-
Check the relay server logs:
- Verify the extension is enabled (green icon) on at least one tab
-
Use the
resettool to recreate the connection
Extension not connecting
- Click the extension icon on a tab (should turn green)
- Reload the extension from
chrome://extensions - Restart Chrome if issues persist
Chrome shows all pages as about:blank
This is a known Chrome bug in thechrome.debugger API. Restart Chrome to fix.
Next Steps
Configuration
Set up environment variables and remote access
Remote Access
Control Chrome on remote machines over the internet