MCP/Playwright MCP
Playwright MCP logo

Playwright MCP

Verified Golden (1000+ GitHub stars)

Browser automation with Playwright using structured accessibility tree snapshots instead of pixel-based vision models.

frontend•Browser Automation & End-to-End Testing
GitHub13.3k
License:Apache-2.0
VERIFIED

About this Server

Playwright MCP is an official Model Context Protocol server that provides robust browser automation capabilities using Microsoft Playwright. Instead of relying on vision-tuned models or screenshots, it exposes web pages through structured accessibility trees, enabling LLMs to navigate, click, fill forms, and test modern web applications deterministically with zero network ambiguity.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

Local Execution Sandbox: Runs locally with file access restricted to your workspace root directory by default.
Isolated Profiles Option: Use --isolated flag so browser sessions and storage states are wiped immediately upon closing.
Domain Restriction Flags: Configure --allowed-origins or --blocked-origins to define trusted domain boundaries for browser requests.
Headless and Headed Control: Choose --headless for lightweight background automation or headed mode for full visual observability.

When to Use (and When Not To)

Best For
  • •Automated end-to-end testing, frontend verification, and regression test suites across Chromium, Firefox, and WebKit
  • •Operating on complex web applications using structured accessibility tree snapshots without needing vision models
  • •Deterministic form filling, button clicks, and flow validation where screenshot-based guessing can be ambiguous
  • •Running automated tests and QA checks against local development servers (e.g. localhost:3000)
Not For / Limitations
  • •Interactions that strictly require physical hardware biometric authentication
  • •Concurrent parallel MCP clients sharing the same workspace root with persistent profiles without using --isolated mode
  • •Environments where running local browser engine binaries is blocked by operating system sandbox policies

Install & Setup

terminal command
$claude mcp add playwright npx @playwright/mcp@latest

Exposed Tools & Endpoints

10 tools

Functions your AI agent can invoke via this Model Context Protocol server

browser_navigate

Navigate the active browser instance to a specified URL or local development server address.

browser_click

Perform deterministic mouse clicks targeting elements resolved from the accessibility tree, text, or selector.

browser_type

Type text into input elements, search bars, and textareas with simulated keyboard events.

browser_snapshot

Extract the semantic accessibility tree and structured DOM hierarchy without requiring vision models.

browser_press_key

Dispatch keyboard events and shortcuts such as Enter, Tab, Escape, Backspace, or composite keys.

browser_hover

Hover pointer over navigation menus, dropdowns, and interactive controls to trigger hover UI states.

browser_select_option

Select one or multiple options from HTML select dropdown menus and multi-select fields.

browser_wait

Pause and wait for DOM elements to appear, network requests to settle, or explicit timeout intervals.

browser_evaluate

Execute custom JavaScript in the page execution context to retrieve computed properties or state.

browser_take_screenshot

Capture full-page or element-specific screenshots when visual verification is explicitly requested.