Playwright MCP
Official MCP server by Microsoft for browser automation built on Playwright.
- Skill Road
- Playwright MCP
Categories
Description
Playwright MCP is a Model Context Protocol server that provides browser automation via Playwright. It is maintained by Microsoft in the microsoft/playwright-mcp repository.
Unlike approaches that analyse screenshots, the server works on the page's accessibility tree. The model therefore receives a structured representation of the page instead of an image.
According to the documentation, its feature set includes:
Navigating, clicking, typing, hovering, drag-and-drop, file uploads, form filling, keyboard input, screenshots, snapshots and handling dialogs. Also tab management, recording and mocking network requests including an offline mode, access to cookies, localStorage and sessionStorage, video and trace recording, code generation, coordinate-based mouse actions, PDF output, and assertions for tests.
It requires Node.js 18 or newer. The server runs directly via npx without any prior installation:
npx @playwright/mcp@latest
In an MCP client, it is registered through the usual configuration file:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
The documentation covers setup for a range of clients, including Codex, Claude Code, Cursor, VS Code, Copilot, Cline, Gemini CLI, LM Studio, Warp and Windsurf.
Why the accessibility tree instead of screenshots
Many AI browser automation tools rely on screenshots: the model receives an image of the page and has to guess pixel coordinates for clicks. Per the documentation, Playwright MCP takes the opposite approach and works with the accessibility tree — the same structured representation screen readers use. The model receives named elements such as buttons, links, and form fields instead of pixels, which makes clicks and input noticeably more reliable and uses fewer tokens than an image. Screenshots remain available as an additional tool, for example for visual verification, but they are not the primary basis for control.
Operating modes: stdio, HTTP, and Docker
For most MCP clients, Playwright MCP runs as a local stdio process launched directly via npx, requiring no open network connection. For scenarios where multiple clients should share the same server or the server runs on a different machine, a standalone HTTP endpoint can be started instead, which clients address via a URL. For container use, the project provides a Docker image; the documentation explicitly notes that only headless Chromium is currently supported inside the container, while locally Chrome, Firefox, WebKit, and Edge can also run with a visible window.
Who Playwright MCP fits
The server suits anyone who wants an AI agent to operate real web interfaces: end-to-end tests driven from a description instead of fixed test code, recurring data collection from websites without an official API, filling in multi-step forms, or automatically checking whether a page still behaves as expected after a change. Thanks to the accessibility-tree approach, Playwright MCP is also well suited for accessibility checks, since it evaluates exactly the structure assistive technologies see. For plain content retrieval without interaction, a simpler fetch server is often the lighter choice since no browser process needs to start.
Frequently asked questions
Does Playwright MCP need a separate browser installation? No, the required browsers are managed by Playwright itself and downloaded automatically when needed. Does the server work without a visible screen? Yes, it also runs headless on servers without a graphical interface; for Docker, only headless operation is currently supported anyway. Does login state persist between sessions? In the default profile, yes; in isolated mode, session state is discarded on close.
Requirements
Node.js 18 or newer and an MCP client. A headed browser needs a graphical session in the runtime environment; alternatively, the server can run headless or as a standalone HTTP service.
Installation instructions
Start the server directly through npx and add the command to the client's MCP configuration. A global installation is not required.
For a standalone local HTTP endpoint, start the server with --port 8931 and configure http://localhost:8931/mcp as the client URL. For reproducible installations, pin the version shown below instead of using @latest.
npx @playwright/mcp@latest
Authentication
The local stdio server does not require its own login. Authentication to visited websites uses the browser profile, imported storage state, or browser extension. An HTTP endpoint has no built-in user login and must be protected separately when exposed over a network.
Required access permissions
Requires network access to the automated websites and permission to launch a browser process. File uploads and output are restricted to MCP roots or the current working directory by default. Additional browser permissions such as clipboard or geolocation are granted only through --grant-permissions.
Transmitted or stored data
The server processes page content as accessibility snapshots and, depending on enabled tools, screenshots, console and network data, form values, downloads, videos, and traces. The default profile keeps cookies, localStorage, sessionStorage, and login state locally; isolated mode discards session state when closed. HTTP, proxy, or CDP operation may route this data through additional systems.
Security risks
Web pages can contain malicious or misleading instructions. With an authenticated browser session, an agent can perform real actions, read confidential content, or upload data. Persistent profiles and saved traces may contain session tokens or personal data. Allow only required hosts, roots, and browser permissions; use isolated profiles for sensitive work; and never expose HTTP endpoints without protection.
License and costs
- License
- Apache-2.0
- Cost
- free
The open-source server has no license fee. Costs may arise only from your runtime environment, proxies, or paid target systems.
Alternatives
At a glance
- Provider
- Microsoft
- Status
- Official server
- Deployment
- Local and remote
- Current version
- 0.0.80
- Last reviewed
- 07.09.2026
Repository and documentation
Categories
Supported clients
Related guides
Guides and background related to this entry.
Installing Playwright MCP
Setting up Playwright MCP in an MCP client – requirements, configuration and first run.
18.09.2026
Installing Chrome DevTools MCP
Setting up Chrome DevTools MCP in an MCP client – requirements, configuration, slim mode, and privacy flags.
18.09.2026
Use ScoutQA Testing safely
Safely using ScoutQA Testing: AI-driven exploratory web app testing with clear boundaries and important risk considerations.
09.09.2026
Use Web Design Reviewer safely
The Web Design Reviewer uses browser automation to inspect layout, responsive behavior, and accessibility issues in source code.
09.09.2026