Playwright
A 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
What is Playwright?
Playwright is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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 ...
A 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
This server falls under the Browser Automation category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A production-ready browser automation server that enables AI
Use Cases
Maintainer
Works with
Installation
NPM
npx -y @playwright/mcpManual Installation
npx -y @playwright/mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Playwright
The Playwright MCP Server (@playwright/mcp) gives AI assistants deterministic browser automation by using Playwright's accessibility tree snapshots rather than screenshots, removing the need for vision models to interpret pages. It exposes tools for navigation, clicking, typing, tab management, network mocking, cookie/storage management, PDF generation, JavaScript evaluation, and video/trace recording. Built by Microsoft, it includes a built-in Inspector UI and robust crash recovery, making it suitable for production-grade web automation, testing, and data extraction workflows driven by LLMs.
Prerequisites
- Node.js 18 or later with npx available
- Playwright browsers installed (the server can install them automatically on first run)
- An MCP-compatible client such as Claude Desktop, Cursor, or VS Code with MCP support
- Optional: environment variables for headless mode, browser selection, or custom timeouts
Install Playwright browsers
Before running the MCP server, ensure Playwright's browser binaries are available. This only needs to be done once.
npx playwright install chromiumRun the Playwright MCP server
Start the server with npx. By default it runs in headless mode using Chromium.
npx @playwright/mcp@latestAdd the server to your MCP client configuration
Edit your claude_desktop_config.json (or equivalent config) to register the Playwright MCP server.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}Configure optional environment variables
Customize the server behavior using PLAYWRIGHT_MCP_ prefixed environment variables: headless mode, browser choice (chromium/firefox/webkit), port, timeouts, and user data directory.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"],
"env": {
"PLAYWRIGHT_MCP_HEADLESS": "false",
"PLAYWRIGHT_MCP_BROWSER": "chromium",
"PLAYWRIGHT_MCP_TIMEOUT_ACTION": "10000",
"PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION": "30000"
}
}
}
}Restart your MCP client and verify
Restart Claude Desktop or your MCP client. The Playwright tools (browser_navigate, browser_click, browser_type, etc.) should appear in the tools panel. Test by asking your AI to navigate to a URL.
Playwright Examples
Client configuration
Full claude_desktop_config.json entry for the Playwright MCP server with visible browser mode enabled.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"],
"env": {
"PLAYWRIGHT_MCP_HEADLESS": "false",
"PLAYWRIGHT_MCP_BROWSER": "chromium",
"PLAYWRIGHT_MCP_USER_DATA_DIR": "/tmp/playwright-profile"
}
}
}
}Prompts to try
Example prompts that exercise Playwright MCP server's navigation, extraction, and interaction tools.
- "Navigate to https://github.com/microsoft/playwright-mcp and take a snapshot of the page"
- "Go to https://news.ycombinator.com and list all the post titles on the front page"
- "Navigate to https://example.com, fill in the search box with 'playwright', and click the submit button"
- "Open a new browser tab, navigate to https://docs.anthropic.com, and return the table of contents"
- "Navigate to a login page, enter my credentials, and take a screenshot after logging in"
- "Mock all requests to /api/data to return an empty array, then reload the page"Troubleshooting Playwright
Error: browserType.launch: Executable doesn't exist at /path/to/chromium
Run 'npx playwright install chromium' (or 'firefox'/'webkit') to download the required browser binaries. This must be done on the machine running the MCP server, not just the client machine.
Page snapshots return empty or minimal content
Some sites block headless browsers. Set PLAYWRIGHT_MCP_HEADLESS=false to run in headed mode and add PLAYWRIGHT_MCP_USER_DATA_DIR to persist cookies/sessions. Some pages also require JavaScript rendering time — increase PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION.
The server crashes mid-session with no error message
The built-in crash recovery should auto-restart the browser context. If crashes persist, check system memory (Playwright's Chromium can use 200–500 MB) and ensure no other process is using the configured port (PLAYWRIGHT_MCP_PORT, default 3000).
Frequently Asked Questions about Playwright
What is Playwright?
Playwright is a Model Context Protocol (MCP) server that 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 It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Playwright?
Install via npm with the command: npx -y @playwright/mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Playwright?
Playwright works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Playwright free to use?
Yes, Playwright is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Playwright Alternatives — Similar Browser Automation Servers
Looking for alternatives to Playwright? 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.
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.
Browser Tools MCP
★ 7.2kThis application is a powerful browser monitoring and interaction tool that enables AI-powered applications via Anthropic's Model Context Protocol (MCP) to capture and analyze browser data through a Chrome extension.
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 Playwright 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 Playwright?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.