Playwright Browser Automation MCP
Let MCP clients automate browsers through structured page snapshots.
- Source repo
- microsoft/playwright-mcp
- Stars
- ★ 38k
- Last updated
- 1d ago
- License
- Apache-2.0
- Primary language
- TypeScript
- FA score
- 60/100 · Some gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformCodex · Claude Code
- Cost
- Free, no paid service needed
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- A developer uses an MCP-enabled coding client to open a local or live page and locate controls from its accessibility snapshot.
- Not a fit if
- Teams that need screenshot-only browser control with vision models
- Deployments that require MCP itself to act as a security boundary
- Source review
- 60/100 · Some gaps
What does this agent do, and when should you use it?
Playwright MCP is a Model Context Protocol server built on Playwright that lets LLMs interact with web pages through structured accessibility snapshots. Its standard setup launches @playwright/mcp with npx, and an MCP client calls the browser tools. Core tools cover navigation, snapshots, clicks, form filling, tab management, and access to console messages and network requests. The browser can use a persistent profile, an isolated session, or an extension that attaches to an existing session; the server can also run over HTTP/SSE or be created programmatically. It requires Node.js 18 or newer, and the README lists multiple MCP clients; the server is not a security boundary.
After the client starts the server, Playwright MCP operates a browser and returns the page's accessibility structure as a snapshot for subsequent tool calls. browser_navigate opens a URL, browser_snapshot captures the page structure, and browser_click, browser_fill_form, and browser_type perform interactions; browser_tabs manages tabs. It can also retrieve console messages and network requests, with optional capabilities for network routing, storage management, and DevTools tools. Results are returned as text snapshots or messages, or saved to files according to configuration; the screenshot tool can also return page images.
- A developer uses an MCP-enabled coding client to open a local or live page and locate controls from its accessibility snapshot.
- A test engineer runs a form flow in an isolated browser session and supplies initial cookies and local storage through a storage state file.
- A troubleshooter reads browser console messages or lists page network requests to investigate an interaction problem.
- An automation team enables the optional network capability to mock API responses, switch offline state, and inspect active routes.
- A user who needs an existing logged-in browser session connects to an Edge or Chrome instance through the Playwright extension.
How do you install or deploy this agent?
You need Node.js 18 or newer and an MCP client. The standard configuration launches the server with npx and requires no credentials in the shown config:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}You can also add it with the Codex CLI:
codex mcp add playwright npx "@playwright/mcp@latest"On first use, the client runs the configured server and connects to it; the browser starts with the default configuration.
How do you use this agent?
Start the server named playwright from your MCP client. Call browser_navigate with the target URL, then browser_snapshot to inspect the page structure; use a target reference from the snapshot with browser_click, browser_fill_form, or browser_type. To run a standalone HTTP service, use:
npx @playwright/mcp@latest --port 8931The client can connect to its MCP endpoint with:
{
"mcpServers": {
"playwright": {
"url": "http://localhost:8931/mcp"
}
}
}Add --isolated to the launch arguments for a temporary isolated session. Use --caps to enable additional tool capabilities.
What are this agent's strengths and limitations?
- Builds structured snapshots from Playwright's accessibility tree, so core interactions do not depend on vision models.
- Includes callable tools for navigation, forms, tabs, console messages, and network requests.
- Supports persistent profiles, isolated sessions, storage state files, and extension connections to existing browsers.
- Documents HTTP/SSE deployment and programmatic connections in addition to MCP-client launch.
- Requires Node.js 18 or newer and a compatible MCP client.
- The README says the server is not a security boundary; its file and network restrictions are also described as convenience protections.
- A persistent profile can be used by only one browser instance at a time; parallel clients need isolation or separate user data directories.
- The Docker implementation currently supports headless Chromium only.
How does this agent compare with similar options?
The README compares MCP with Playwright CLI + SKILLS: CLI uses fewer tokens and suits high-throughput coding workflows, while MCP suits automation that benefits from persistent browser state, page-structure inspection, and iterative reasoning.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Playwright Browser Automation MCP This agent | 60 · Some gaps | MCP serverFree | ★ 38k | 1d ago | TypeScript | Codex · Claude Code |
| CamoFox Browser Server | 72 · Some gaps | Self-hosted serviceFree | ★ 425 | 28d ago | JavaScript | Claude Code |
| Weaver Agent Platform | 45 · Major gaps | Self-hosted serviceFree + model costs | ★ 184 | 6mo ago | Python | OpenAI API · Claude API |
| Agent Browser: Browser automation CLI for AI agents | 54 · Major gaps | CLIFree + model costs | ★ 44k | 1d ago | Rust | — |
How does FollowAgents rate this agent?
Why each dimension lost points
Default behavior restricts file access to workspace roots, blocks file:// navigation, binds to localhost, and offers isolation, permission, and origin controls, supporting some least privilege. However, options can open file access, bind all interfaces, or share browser context, and the docs state origin restrictions do not cover redirects. The docs disclose persistent profiles, storage state, secret files, and reuse of logged-in browser state, but do not describe secret protection or cleanup policy. Browser automation can perform side-effecting actions; the supplied material shows no per-action confirmation or rollback mechanism. Playwright versions are pinned to an alpha build, with no dependency security review evidence. Repository, package metadata, and license support attribution.
The README, package metadata, and capability tests generally describe a consistent MCP browser tool. Node.js requirements and timeout options are documented. The Playwright dependency is an alpha version, and operation requires Node, browser, and client environments; no offline or dependency failure recovery guidance is shown. The supplied material contains no evidence of user-facing failure categories or diagnostics, so that criterion scores zero. CI workflows define multi-platform and Docker test jobs, but this review does not claim they were executed.
The README distinguishes MCP and CLI use cases and lists many MCP clients; configuration covers browsers, devices, snapshots, capabilities, and transport-related options. File access, origin policies, and capability switches define some boundaries, though options can explicitly relax access or sandboxing. The intended scope is browser automation through MCP, but the materials give limited guidance on unsuitable tasks or choosing by risk level.
The README organizes installation, configuration, profiles, and initial state, with examples for many clients; its option table and profile notes document some limitations. Some examples use @latest, reducing version reproducibility, and the supplied materials show no separate changelog or compatibility policy. The Apache-2.0 license file is complete. Repository and package metadata identify Microsoft, while security reporting instructions and CI/publish workflows clarify maintenance and update responsibility.
Structured accessibility snapshots and MCP tools provide a browser interaction path that does not require a vision model, with concrete utility supported by the capability tests and tool list. The docs also note that CLI may use less context for coding agents, making the tradeoff explicit. Outputs include snapshots, code, and optional images, but the materials do not establish their quality or actual cost across tasks, so full marks are not justified.
Core features, installation requirements, options, and security boundaries are traceable to the README; package metadata, license, test definitions, and CI configuration corroborate some claims. Statements about being lightweight, deterministic, or efficient remain project claims whose runtime effects cannot be confirmed statically. CI configuration does not establish successful execution. The rationale distinguishes documented facts from unverified performance inferences.
- Connecting to an existing browser or using a persistent profile retains login state and site data; choose the user data directory carefully and consider isolated mode.
- The origin allowlist is not a security boundary and does not cover redirects; binding to 0.0.0.0, opening file access, or sharing browser context expands access.
- Default install examples use @latest, while the dependency uses a Playwright alpha version; check and pin a specific release when reproducibility matters.
FAQ
Does it require an API key or paid model?
How does it identify page elements?
Does an isolated session retain login state?
--storage-state; persistent profiles retain browser data.