Playwright MCP Server
Automate browser interaction via structured accessibility snapshots for LLM agents.
Data last scanned today · Reviewed yesterday
Overview
The Playwright MCP Server provides a direct interface for AI agents to interact with web pages using structured accessibility snapshots. By focusing on the DOM structure rather than pixels or screenshots, it enables deterministic browser automation without requiring vision-capable models, making it ideal for persistent, iterative reasoning tasks or autonomous workflows. Designed to integrate with platforms like VS Code, Claude Desktop, and Cursor, this server maintains a continuous browser context. While efficient for deep, multi-step explorations, users should distinguish this from the Playwright CLI+SKILLS approach, which is often preferred for high-throughput coding agents requiring lower token consumption.
Our verdict
This server carries a high-risk profile with a security score of 56/100, primarily due to the lack of built-in authentication and a total absence of read-only operating modes. Because any configured agent gains full write access to the browser environment, it should only be used in trusted, local development environments by experienced users who can mitigate the risks of unauthenticated execution.
- Maintained by official Playwright vendor
- Uses accessibility trees for deterministic LLM input
- Minimal dependency chain with only two direct requirements
- High community adoption with 35,000+ GitHub stars
- No authentication method allows unauthorized local access
- Lacks a read-only mode for restricted operations
- Full write access granted by default upon installation
Setup
{
"mcpServers": {
"playwright-mcp": {
"args": [
"-y",
"@playwright/mcp"
],
"command": "npx"
}
}
}Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then restart Claude Desktop. Some servers require API keys or tokens as environment variables — check the project's README and add an "env" object if needed.
- No read-only mode — running this grants full read/write access.
- No built-in authentication — anyone with access to this config can invoke every tool it exposes.
Tools
| Tool | Description | Risk |
|---|---|---|
| browser_click | Perform click on a web page | medium |
| browser_close | Close the page | medium |
| browser_console_messages | Returns all console messages | low |
| browser_drag | Perform drag and drop between two elements | medium |
| browser_drop | Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided. | medium |
| browser_evaluate | Evaluate JavaScript expression on page or element | high |
| browser_file_upload | Upload one or multiple files | medium |
| browser_fill_form | Fill multiple form fields | medium |
| browser_find | Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you only need to locate an element and its ref. | low |
| browser_handle_dialog | Handle a dialog | medium |
| browser_hover | Hover over element on page | medium |
| browser_navigate | Navigate to a URL | medium |
| browser_navigate_back | Go back to the previous page in the history | medium |
| browser_network_request | Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests. | low |
| browser_network_requests | Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details. | low |
| browser_press_key | Press a key on the keyboard | medium |
| browser_resize | Resize the browser window | medium |
| browser_run_code_unsafe | Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent. | high |
| browser_select_option | Select an option in a dropdown | medium |
| browser_snapshot | Capture accessibility snapshot of the current page, this is better than screenshot | low |
| browser_take_screenshot | Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions. | low |
| browser_type | Type text into editable element | medium |
| browser_wait_for | Wait for text to appear or disappear or a specified time to pass | medium |
| browser_tabs | List, create, close, or select a browser tab. | medium |
| browser_get_config | Get the final resolved config after merging CLI options, environment variables and config file. | low |
Compatibility
| Client | Local | Docker | Remote | Read-only |
|---|---|---|---|---|
| ChatGPT | ||||
| Claude Desktop | ||||
| Cursor | ||||
| VS Code | ||||
| Windsurf |
Alternatives
Badge
Maintain this server? Add the live badge to your README.