Playwright MCP
Browser automation with Playwright using structured accessibility tree snapshots instead of pixel-based vision models.
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.
Direct low-latency RPC protocol communication with structured JSON schemas.
Restricted capability bounds to prevent accidental modifications or leakage.
Security & Best Practices
When to Use (and When Not To)
- •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)
- •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
claude mcp add playwright npx @playwright/mcp@latestExposed Tools & Endpoints
10 toolsFunctions your AI agent can invoke via this Model Context Protocol server
Navigate the active browser instance to a specified URL or local development server address.
Perform deterministic mouse clicks targeting elements resolved from the accessibility tree, text, or selector.
Type text into input elements, search bars, and textareas with simulated keyboard events.
Extract the semantic accessibility tree and structured DOM hierarchy without requiring vision models.
Dispatch keyboard events and shortcuts such as Enter, Tab, Escape, Backspace, or composite keys.
Hover pointer over navigation menus, dropdowns, and interactive controls to trigger hover UI states.
Select one or multiple options from HTML select dropdown menus and multi-select fields.
Pause and wait for DOM elements to appear, network requests to settle, or explicit timeout intervals.
Execute custom JavaScript in the page execution context to retrieve computed properties or state.
Capture full-page or element-specific screenshots when visual verification is explicitly requested.
