playwright-mcp: Playwright MCP server

playwright-mcp: Playwright MCP server

🔗 View on GitHub: microsoft/playwright-mcp

🚀 Quick Installation

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright.

Standard Config

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}

Claude Code

claude mcp add playwright npx @playwright/mcp@latest

What It Does

This MCP server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.

  • 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

Key Capabilities

Core Automation

  • browser_navigate — Navigate to URLs
  • browser_click — Click elements
  • browser_type — Type text into fields
  • browser_fill_form — Fill multiple form fields
  • browser_snapshot — Capture accessibility snapshots
  • browser_take_screenshot — Take screenshots

Advanced Features (Opt-in)

  • --caps=network — Network mocking and route management
  • --caps=storage — Cookie and storage management
  • --caps=devtools — Tracing and video recording
  • --caps=vision — Coordinate-based interactions
  • --caps=pdf — PDF generation
  • --caps=testing — Test assertions and locators

Example Usage

"Navigate to example.com and click the login button"
"Fill in the form with email [email protected] and password secret"
"Take a screenshot of the current page"
"Get the accessibility snapshot of the page"

Configuration Options

Option Description
--browser chrome, firefox, webkit, msedge
--headless Run browser in headless mode
--viewport-size Set viewport size (e.g., 1280x720)
--device Emulate device (e.g., "iPhone 15")
--isolated Keep browser profile in memory only

Requirements

  • Node.js 18 or newer
  • VS Code, Cursor, Claude Desktop, or any MCP client

📚 Playwright Docs | 🐛 Report Issues

About the author
Subin Park

Subin Park

Principal Designer | Ai-Driven UX Strategy Helping product teams deliver real impact through evidence-led design, design systems, and scalable AI workflows.

Ai for Pro

Curated AI workflows, prompts, and playbooks—for product designers who build smarter, faster, and with impact.

Ai for Pro - Curated AI workflows and Product Design guides—built for Product Designers, PMs, and design leaders.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Ai for Pro - Curated AI workflows and Product Design guides—built for Product Designers, PMs, and design leaders..

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.