Enables web browser control for navigating websites, capturing page snapshots, interacting with elements, and taking scr...
Created bySep 22, 2025
Playwright MCP
A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.
Key Features
Fast and lightweight: Uses Playwright's accessibility tree, not pixel-based input.
LLM-friendly: No vision models needed, operates purely on structured data.
Deterministic tool application: Avoids ambiguity common with screenshot-based approaches.
Use Cases
Web navigation and form-filling
Data extraction from structured content
Automated testing driven by LLMs
General-purpose browser interaction for agents
Example config
NPX
Installation in VS Code
Install the Playwright MCP server in VS Code using one of these buttons:
Alternatively, you can install the Playwright MCP server using the VS Code CLI:
After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
CLI Options
The Playwright MCP server supports the following command-line options:
--browser <browser>: Browser or chrome channel to use. Possible values:
--caps <caps>: Comma-separated list of capabilities to enable, possible values: tabs, pdf, history, wait, files, install. Default is all.
--cdp-endpoint <endpoint>: CDP endpoint to connect to
--executable-path <path>: Path to the browser executable
--headless: Run browser in headless mode (headed by default)
--port <port>: Port to listen on for SSE transport
--user-data-dir <path>: Path to the user data directory
--vision: Run server that uses screenshots (Aria snapshots are used by default)
User data directory
Playwright MCP will launch the browser with the new profile, located at
All the logged in information will be stored in that profile, you can delete it between sessions if you'd like to clear the offline state.
Running headless browser (Browser without GUI).
This mode is useful for background or batch operations.
Running headed browser on Linux w/o DISPLAY
When running headed browser on system w/o display or from worker processes of the IDEs,
run the MCP server from environment with the DISPLAY and pass the --port flag to enable SSE transport.
And then in MCP client config, set the url to the SSE endpoint:
Docker
NOTE: The Docker implementation only supports headless chromium at the moment.
Tool Modes
The tools are available in two modes:
Snapshot Mode (default): Uses accessibility snapshots for better performance and reliability
Vision Mode: Uses screenshots for visual-based interactions
To use Vision Mode, add the --vision flag when starting the server:
Vision Mode works best with the computer use models that are able to interact with elements using
X Y coordinate space, based on the provided screenshot.