Playwright MCP
The Playwright MCP server enables LLMs to automate browser interactions through structured accessibility snapshots rather than vision models, providing comprehensive capabilities for web scraping, testing, and automated workflows.
Browser Management: Open, close, resize, and install browsers; manage multiple tabs (list, create, close, select); connect to existing browser sessions via extension mode
Navigation: Navigate to URLs, go back to previous pages, and wait for conditions (text appearance/disappearance or time periods)
Page Interaction: Click elements (with modifier keys, double-clicks, multi-button support), type text (with slow typing and auto-submit options), fill multi-field forms (textboxes, checkboxes, radio buttons, comboboxes, sliders), select dropdown options, hover, drag and drop, press keyboard keys, upload files, and handle browser dialogs (alerts, prompts, confirms)
Page Inspection: Capture accessibility snapshots in LLM-friendly format, take screenshots (full page or specific elements, PNG/JPEG), retrieve console messages (filtered by log level), monitor network requests (with static resource filtering), evaluate JavaScript on pages or elements, and execute custom Playwright code snippets
System Health: Perform health checks to verify server configuration and connectivity
Key Features: Uses accessibility tree references (not pixel coordinates) for deterministic automation, supports human-readable element descriptions, works with Chromium/Firefox/WebKit browsers, and offers headless mode, viewport sizing, and isolated sessions
Enables browser automation and web interaction capabilities, allowing navigation, form filling, clicking, data extraction, and testing workflows through Playwright's accessibility tree in Firefox browser.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Playwright MCP go to github.com and get the latest trending repositories"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Playwright MCP
A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. Enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.
Features
Fast and lightweight - Uses Playwright's accessibility tree, not pixel-based input
LLM-friendly - No vision models needed, operates purely on structured data
Deterministic - Avoids ambiguity common with screenshot-based approaches
Requirements
Node.js 18 or newer
Any MCP client (VS Code, Cursor, Claude Desktop, Windsurf, etc.)
Quick Start
Add to your MCP client configuration:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["playwright-mcp@latest"]
}
}
}VS Code / Cursor
Go to Settings → MCP → Add Server and configure manually using the standard config above.
Configuration
Basic Options
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"playwright-mcp@latest",
"--headless", // Run browser in headless mode
"--browser", "chromium", // Choose browser: chromium, firefox, webkit
"--viewport-size", "1280x720" // Set viewport size
]
}
}
}Browser Extension (Connect to Existing Browser)
Connect to your existing Chrome/Edge browser with logged-in sessions:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["playwright-mcp@latest", "--extension"]
}
}
}See extension/README.md for extension installation.
Isolated Sessions
Run each session in an isolated browser context:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"playwright-mcp@latest",
"--isolated",
"--storage-state", "path/to/storage.json"
]
}
}
}Common Use Cases
Web Scraping
Navigate to pages, extract data, take screenshots, and interact with forms.
Testing & Automation
Verify elements, fill forms, click buttons, and run automated workflows.
Browser Extension Integration
Connect to your existing browser to interact with pages where you're already logged in.
Available Tools
Navigation:
browser_navigate,browser_navigate_backInteraction:
browser_click,browser_type,browser_fill_form,browser_select_optionInspection:
browser_snapshot,browser_take_screenshot,browser_evaluateTab Management:
browser_tabs(list, create, close, select)Network:
browser_network_requests,browser_console_messagesAdvanced: PDF generation, coordinate-based interactions, test assertions
Run npx playwright-mcp@latest --help for full list of options.
Documentation
License
MIT
Available Tools
23 toolsbrowser_clickBDestructive
Perform click on a web page
Inputs: element (required), ref (required), doubleClick, button, +1 more.
browser_closeADestructive
Close the page
Inputs: no named parameters.
browser_console_messagesBRead-only
Returns all console messages
Inputs: level.
browser_dragBDestructive
Perform drag and drop between two elements
Inputs: startElement (required), startRef (required), endElement (required), endRef (required).
browser_evaluateADestructive
Evaluate JavaScript expression on page or element
Inputs: function (required), element, ref.
browser_file_uploadBDestructive
Upload one or multiple files
Inputs: paths.
browser_fill_formBDestructive
Fill multiple form fields
Inputs: fields (required).
browser_handle_dialogCDestructive
Handle a dialog
Inputs: accept (required), promptText.
browser_hoverBDestructive
Hover over element on page
Inputs: element (required), ref (required).
browser_installADestructive
Install the browser specified in the config. Call this if you get an error about the browser not being installed.
Inputs: no named parameters.
browser_network_requestsBRead-only
Returns all network requests since loading the page
Inputs: includeStatic.
browser_press_keyBDestructive
Press a key on the keyboard
Inputs: key (required).
browser_resizeADestructive
Resize the browser window
Inputs: width (required), height (required).
browser_run_codeADestructive
Run Playwright code snippet
Inputs: code (required).
browser_select_optionBDestructive
Select an option in a dropdown
Inputs: element (required), ref (required), values (required).
browser_snapshotARead-only
Capture accessibility snapshot of the current page, this is better than screenshot
Inputs: filename.
browser_tabsADestructive
List, create, close, or select a browser tab.
Inputs: action (required), index.
browser_take_screenshotARead-only
Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
Inputs: type, filename, element, ref, +1 more.
browser_typeADestructive
Type text into editable element
Inputs: element (required), ref (required), text (required), submit, +1 more.
browser_wait_forBRead-only
Wait for text to appear or disappear or a specified time to pass
Inputs: time, text, textGone.
health_checkA
Perform a local system health check to verify Playwright MCP server configuration and connectivity. Returns system information and configuration status.
Inputs: browserType.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes, such as browser_click for clicking, browser_fill_form for form filling, and browser_take_screenshot for screenshots. However, some overlap exists: browser_snapshot and browser_take_screenshot both capture page states, and browser_evaluate and browser_run_code both execute JavaScript, which could cause confusion. Descriptions help clarify differences, but the overlap is noticeable.
Tool names follow a highly consistent snake_case pattern with a 'browser_' prefix for most tools, such as browser_click, browser_navigate, and browser_wait_for. The only exception is health_check, which still uses snake_case and fits the overall style. This consistency makes the tool set predictable and easy to navigate.
With 23 tools, the count is on the higher side for a Playwright automation server, which typically involves many actions. It feels slightly heavy but reasonable given the domain's complexity. However, it borders on being overwhelming, as some tools might be combined or streamlined to reduce the number without losing functionality.
The tool set provides comprehensive coverage for web automation tasks, including navigation, interaction (click, type, hover), form handling, file uploads, dialog management, and debugging (console messages, network requests). It also includes utility functions like health_check and browser_install, ensuring no obvious gaps for common Playwright workflows. The surface is well-rounded and supports full automation lifecycles.
Related MCP Connectors
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.