Electron Driver
@mesomya
MCP server that lets AI agents drive Electron apps — click, type, drag, screenshot, eval JS in the renderer or main process, capture console logs. 38 tools, Playwright-powered, works with any Electron app.
Overview
What is Electron Driver?
Electron Driver is an MCP (Model Context Protocol) server that lets AI agents automate Electron desktop apps. It provides tools for clicking, typing, dragging, taking screenshots, evaluating JavaScript in both renderer and main processes, reading console logs, managing multi-window apps, and capturing accessibility snapshots. Built on Playwright’s experimental _electron API, it works with any Electron app—React, Vue, Svelte, or vanilla—as long as you can point it at a compiled main-process entry. It is designed for agent hosts like Claude Code, Claude Desktop, and Cursor.
How to use Electron Driver?
Install the package via npm (npm install electron-driver), then register the MCP server with your agent host. For Claude Code, create a .mcp.json file or use claude mcp add. For other hosts, add the server configuration pointing at npx electron-driver or the absolute path to the module. Once configured, launch your Electron app with the start_app tool, interact using any of the 38 tools, and close the session with stop_app. All tool calls are logged to <project>/.electron-driver/driver.log during a session.
Key features of Electron Driver
- 38 tools covering lifecycle, interaction, capturing, and evaluation.
- Full Playwright selector engine (CSS,
text=,role=, and more). - Evaluate JavaScript in renderer or main process.
- Multi-window support: list and switch between windows.
- Accessibility snapshot capture (ARIA tree).
- Drag with real Chromium input events and React fallback.
Use cases of Electron Driver
- An agent verifies a feature by running the app and checking the visible result.
- Visual regression testing during a refactor.
- Accessibility audits via ARIA tree snapshots.
- Reproducing bugs from a natural-language description.
- Teaching a subagent to iterate on UI until a spec passes.
FAQ from Electron Driver
What dependencies are required to run Electron Driver?
Node 18+ and an already-built Electron app. You do not need to install Playwright browsers separately—the _electron API drives the Electron binary directly.
How does the server handle multiple sessions?
The server owns exactly one Electron session at a time. start_app launches it, stop_app closes it. Calling start_app while a session exists returns an ALREADY_RUNNING error.