Playwright MCP with Electron Support
A Model Context Protocol (MCP) server that provides browser and Electron application automation capabilities using Playwright. This enhanced fork of the official Playwright MCP includes full support for testing and automating Electron desktop applications alongside traditional web browser automation.
Key Features
- Electron support. Test and automate Electron desktop applications with dedicated tools.
- 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.
- Main process access. Execute JavaScript in Electron's main process.
- Window management. Control and interact with multiple Electron windows.
Requirements
- Node.js 18 or newer
- VS Code, Cursor, Windsurf, Claude Desktop, Goose or any other MCP client
Getting started
First, install the Playwright Electron MCP server with your client. A typical configuration looks like this:
{
"mcpServers": {
"playwright-electron": {
"command": "npx",
"args": [
"@robertn702/playwright-mcp-electron@latest"
]
}
}
}
By default, this runs in Electron mode. To use regular browser automation, add --browser chrome or --browser firefox.
Install in VS Code
You can also install the Playwright MCP server using the VS Code CLI:
# For VS Code
code --add-mcp '{"name":"playwright-electron","command":"npx","args":["@robertn702/playwright-mcp-electron@latest"]}'
After installation, the Playwright Electron MCP server will be available for use with your GitHub Copilot agent in VS Code.
Install in Cursor
Click the button to install:
Or install manually:
Go to Cursor Settings -> MCP -> Add new MCP Server. Name to your liking, use command type with the command npx @robertn702/playwright-mcp-electron. You can also verify config or add command like arguments via clicking Edit.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@robertn702/playwright-mcp-electron@latest"
]
}
}
}
Install in Windsurf
Follow Windsurf MCP documentation. Use following configuration:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@robertn702/playwright-mcp-electron@latest"
]
}
}
}
Install in Claude Desktop
Follow the MCP install guide, use following configuration:
{
"mcpServers": {
"playwright-electron": {
"command": "npx",
"args": [
"@robertn702/playwright-mcp-electron@latest"
]
}
}
}
Install in Claude Code
Use the Claude Code CLI to add the Playwright Electron MCP server:
claude mcp add playwright-electron npx @robertn702/playwright-mcp-electron@latest