Skip to content

Playwright MCP

Category: Classic browser automation (MCP server)

Cost: Free and open source (Apache 2.0)

Official docs: playwright.dev/docs/getting-started-mcp

GitHub: github.com/microsoft/playwright-mcp


What it is

Playwright MCP is an official MCP (Model Context Protocol) server from Microsoft that exposes a Chromium, Firefox, or WebKit browser to any MCP-compatible AI agent. Instead of sending raw screenshots, it communicates via accessibility snapshots: structured, text-based page representations that LLMs can read and reason about without vision models.

The server wraps the full Playwright automation surface: clicking, typing, navigation, tab management, cookie/storage operations, network inspection, PDF generation, screenshots, and tracing. An optional browser_run_code_unsafe tool allows arbitrary JavaScript execution in the server process (see Safety below).

Key capabilities

AreaDetails
BrowsersChromium (default), Firefox, WebKit, MS Edge
Transportstdio (default) or HTTP/SSE via --port
Page readingAccessibility snapshots (no vision required)
ActionsClick, type, navigate, drag, select, file upload
TabsList, create, close, switch
StorageCookies, localStorage, sessionStorage
NetworkList requests, mock routes, set offline mode
Opt-in extrasTracing, video recording, coordinate-based mouse, PDF, DevTools highlight

Safety

browser_run_code_unsafe

The browser_run_code_unsafe tool executes arbitrary JavaScript inside the server process (not just the browser page). This is RCE-equivalent. Only enable it when the MCP client is fully trusted. It is disabled by default.

Playwright MCP also supports --allowed-hosts for DNS-rebinding protection when running in HTTP/SSE mode.