Playwright Electron MCP Server

Automate web browsers and Electron desktop applications with Playwright

README.md

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
Install in Goose
Click the button to install:

[Install in Goose](https://block.github.io/goose/extension?cmd=npx&arg=%40robertn702%2Fplaywright-mcp-electron%40latest&id=playwright-electron&name=Playwright%20Electron&description=Interact%20with%20web%20pages%20and%20Electron%20apps%20through%20stru

Try it

Launch the Electron application at the specified path and navigate to the settings window.
Extract the accessibility tree from the current browser page to identify all interactive buttons.
Execute a script in the Electron main process to retrieve the current window state.
Automate the login process on the web application by interacting with the accessibility tree elements.

Frequently Asked Questions

What are the key features of Playwright Electron?

Full support for testing and automating Electron desktop applications. Uses Playwright's accessibility tree for fast and lightweight automation. Operates on structured data without requiring vision models. Allows execution of JavaScript in Electron's main process. Provides tools for managing and interacting with multiple Electron windows.

What can I use Playwright Electron for?

Automating regression testing for Electron-based desktop applications. Interacting with web-based interfaces using structured accessibility data. Managing complex window workflows in Electron apps via LLM commands. Performing deterministic UI automation without pixel-based ambiguity.

How do I install Playwright Electron?

Install Playwright Electron by running: npx @robertn702/playwright-mcp-electron@latest

What MCP clients work with Playwright Electron?

Playwright Electron works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Playwright Electron docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare