executeautomation/mcp-playwright
A TypeScript MCP server for assistant-driven browser automation with Playwright
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
This TypeScript server sits between an MCP client and a real Playwright browser. The client sends a tool call, the server runs the browser operation, and the result goes back through MCP. The runtime depends on @modelcontextprotocol/sdk and playwright; the package also lists Chromium, Firefox, and WebKit browser packages. The npm manifest exposes playwright-mcp-server as the CLI entry point.
In stdio mode, the client launches the process and exchanges JSON-RPC over standard input and output. Logs go to ~/playwright-mcp-server.log so they do not corrupt the protocol stream. Standalone HTTP mode uses Express and exposes a unified /mcp endpoint alongside /sse and /messages, with /health for health checks. HTTP communication is session-aware; the client needs both the correct endpoint and an explicit "type": "http".
Key Capabilities & Differentiators
The server lets an MCP client interact with pages, capture screenshots, extract page data, and execute JavaScript in the browser. It can also generate Playwright test code, giving QA engineers a starting point for turning an exploratory session into a checked-in test. Generated code still needs review, stable assertions, and a repeat run under the intended test conditions.
Chromium, Firefox, and WebKit provide three browser-engine targets. playwright_resize can switch orientation and select from 143 device presets that configure viewport, user agent, touch support, and device pixel ratio. These profiles are useful for checking responsive behavior, but they do not validate performance, rendering quirks, or input behavior on physical devices. API automation appears in the project description, but the available details do not establish its tool schemas or supported methods.
Trade-offs & Limitations
The main reason to choose MCP over direct Playwright scripts is interactive use: an assistant can inspect a page, choose the next action, and draft a test without requiring every step to be scripted in advance. For CI regression coverage, direct Playwright is the better default when selectors, assertions, and data setup need to be reviewed and rerun consistently. MCP adds a process and transport boundary, and the agent's tool decisions introduce variability.
Self-hosting gives operators control over where browsers run, but leaves them responsible for browser versions, credentials, and resource limits. CPU and memory usage depend on the pages loaded and the number of active browsers or sessions, not on local model inference. Treat in-browser JavaScript and authenticated page access as privileged capabilities: use dedicated test accounts and isolated environments. HTTP session IDs and a health endpoint do not establish tenant isolation or access control.
Hardware & Deployment Guide
Run it in a Node.js environment via npx @executeautomation/playwright-mcp-server or install the package globally. Use stdio for Claude Desktop and Claude Code. For a compatible HTTP client, start the service with --port 8931 and connect to /mcp. HTTP binds to localhost; SSH tunneling is an option for remote access without exposing the port directly. A headed browser still needs a display environment on the host running it.
If a browser binary is missing, the normal launch path can download it on first use and retry. For offline deployments, stage the npm package, required browser binaries, and OS libraries before rollout. The repository includes a Dockerfile and docker-compose.yml; the Compose service keeps stdin open, enables a TTY, and sets PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1. Verify browser availability in the built image rather than assuming that setting supplies binaries. No GitHub release is listed, so there is no tagged release milestone to use as a deployment baseline.
playwright-mcp-server CLI, which MCP clients can launch via npx over stdio./mcp, separate /sse and /messages endpoints, and /health; HTTP clients must set the transport type explicitly.playwright_resize also supports orientation changes.QA and frontend teams using an MCP-capable assistant to explore authorized web environments, check responsive layouts, capture screenshots, and draft Playwright tests.
Your primary need is repeatable CI regression testing, physical-device validation, or a shared browser service with verified tenant isolation.
Quick Start & Installation
npm install -g @executeautomation/playwright-mcp-server
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| mcp-playwright ★ | 5.7k | +3 | TypeScript | MIT | A TypeScript MCP server for assistant-driven browser automation with Playwright |
| chrome-devtools-mcp | 60.4k | +760 | TypeScript | Apache-2.0 | Chrome DevTools via MCP and CLI for live browser debugging and performance analy |
| agent-browser | 55.4k | +1k | Rust | Apache-2.0 | Rust CLI and stdio MCP for agents that read and act on live web pages |
| rea | 488.8k | +7.6k | TypeScript | MIT | A local CLI and MCP server for evidence-backed app and binary analysis |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/executeautomation/mcp-playwright.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about mcp-playwright
Should I connect over stdio or HTTP?
http://localhost:8931/mcp with "type": "http"; omitting the type can cause connection or session errors.How should I size the host, and is a GPU required?
Can we self-host it for commercial use?
When should we prefer direct Playwright scripts?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy