amafjarkasi/electron-mcp-server

View on GitHub ↗

MCP server for debugging Electron apps via Chrome DevTools Protocol. Start/attach processes, capture screenshots, read console errors & network logs, inspect DOM, evaluate JS, and automate UI — built for Cursor and other MCP clients.

82 ★22 forksJavaScriptUpdated 1mo ago

What you need to know

Local MCP server that gives AI coding agents eyes, hands, and Chrome DevTools inside Electron apps via CDP, enabling start/attach, screenshots, console, DOM, UI automation, and tracing.

Install

git clone https://github.com/amafjarkasi/electron-mcp-server.git
cd electron-mcp-server && npm install
npm run ensure-electron
npm run build

Usage

  • Add {"command":"node","args":["/Users/you/code/electron-mcp-server/build/index.js"]} to Cursor/Claude Desktop mcpServers
  • "Start D:/apps/my-app on port 9222 and tell me if the renderer threw on boot"
  • "Find my running Electron app, attach by PID, screenshot #sidebar, and dump localStorage"

Key features

  • 36 tools bridging MCP (stdio) to Chrome DevTools Protocol (Runtime, Page, Network, Debugger, Input, Log, Tracing)
  • Launch Electron, attach by port or PID, and discover running apps
  • Screenshots (full page or element clip), DOM inspection, evaluate in renderer and main
  • Console/network/exception buffering with live streaming
  • UI automation: wait_for, click, type_text, press_key, navigate, reload, pause/resume
  • Cookies, web storage, CDP tracing, and a raw cdp_command escape hatch
  • Path allowlist and output allowlist security via environment variables

Best for

Cursor/Claude users and maintainers debugging Electron desktop apps where the agent needs live UI visibility and DevTools control

Caveats

  • Powerful local debugger: can launch binaries, evaluate JS, and read page content — use ELECTRON_MCP_ALLOWED_ROOTS on shared machines
  • Don't expose stdio over an open network without auth
  • Requires Node >= 18 and a one-time Electron binary download
  • evaluate_main needs a node target (start with inspectMain: true)
  • In-memory buffers and exported traces may contain secrets from the app under test
Platforms: macOS · Linux · WindowsClients: Claude Desktop · Cursor
Documentation ↗

Reviewed 2026-08-11

Topics

ai-agentsautomationcdpchrome-devtools-protocolcursordebuggingdesktop-appsdevtoolselectronmcpmodel-context-protocoltypescript
Stars
82★
Forks
22
Language
JavaScript
License
ISC
Created
2025-04-06
Last push
2026-07-26