Electron Debug MCP Server
Provides debugging capabilities for Electron applications, including process management, Chrome DevTools Protocol integration for inspecting targets, executing JavaScript, and controlling application execution.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Electron Debug MCP Serverlist running Electron processes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
An agent that can only read your repo cannot see an Electron window. This server is that debugger. It runs locally, speaks MCP over stdio, and drives the app through the Chrome DevTools Protocol.
You add it to Cursor or Claude and ask in normal language. The client shows the agent every tool and its arguments. This page is the map of what those tools are for.
Changelog
Full history, including 1.6 and 1.5, is in CHANGELOG.md on GitHub. The same file ships in the npm package.
Version | What landed |
1.9.3 | Transparent logo, and a See / Drive / Inspect header so the npm page is not a bare list. |
1.9.2 | Changelog section on the README, linked to this file on GitHub. |
1.9.1 | README layout fix for the npm page: no empty table rows. |
1.9.0 |
|
1.8.0 |
|
1.7.0 | Coverage, file input, emulation, screencast, breakpoints, MHTML, virtual clock, window topology. |
1.6.0 |
|
Related MCP server: Electron Native MCP Server
What you can ask it to do
Job | What happens |
Explain a blank or crashed window | Screenshot, console errors, exceptions, and the process log |
Check that a button or form works | Wait for the control, click or type, then assert the result |
See why a request failed | Network log, response body, or a stubbed URL |
Catch a visual regression | Compare the window to a PNG baseline |
Inspect main-process or IPC bugs | Window list, main-process JavaScript, IPC log, deep links |
Debug an app that is already open | Find its PID or debug port and attach, without killing it |
Investigate a slow or leaky screen | Trace, CPU profile, heap snapshot, coverage, or a short audit |
Window, clipboard, or a download | Focus a window, read or write clipboard text, report the saved path |
Scroll, drag, or a permission prompt | Scroll into view, drag between two elements, allow or deny camera, notifications, and geolocation |
Examples you can type:
“Start
D:/apps/my-appand tell me if the window is blank.”“Click Go, type Ada in the name field, and tell me if the status says saved.”
“What failed on the network, and what did the response body say?”
“Attach to the Electron app I already launched and screenshot it.”
“Profile the settings screen, then save a heap snapshot.”
Install
Cursor and Claude should spawn the process. Running it in a terminal looks idle because it is waiting on stdio.
{
"mcpServers": {
"electron-debug": {
"command": "npx",
"args": ["-y", "electron-debug-mcp"],
"env": {
"ELECTRON_MCP_NO_SANDBOX": "1"
}
}
}
}Claude Desktop config files:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
From a clone, build once and point command at node with the absolute path to build/index.js. Templates live in the repo under examples/.
npm install
npm run buildelectron is an optional dependency. Attach-only installs can use npm install --omit=optional. On Windows, if npm skips postinstall, run scripts/fix-electron.cmd. Requires Node 18 or newer.
How a session works
start_app launches your app with a DevTools port. find_apps reads Electron PIDs from the process list. discover_apps probes local ports. attach and attach_by_pid join an app that is already running.
The reply includes an id, usually electron-…. Later calls pass that id as processId.
stop_app kills a process this server started. On an attached session it only detaches. Either way the session leaves list_apps.
Pass inspectMain: true when the bug is in the main process. That opens a separate --inspect port. These tools need it: evaluate_main, main_state, ipc_tap, get_ipc_log, webcontents_topology, open_deep_link, focus_window, get_clipboard, set_clipboard, get_downloads, set_permission.
Page targets keep console, network, and audit events buffered between calls.
Start, look, act, check
{ "appPath": "/path/to/your-app", "inspectMain": true }start_app returns id. Use it as processId.
vision returns a screenshot plus the page URL, console errors, and failed requests. snapshot returns the accessibility tree when a CSS selector is the wrong handle.
{ "processId": "electron-…", "name": "Submit", "role": "button" }{ "processId": "electron-…", "textIncludes": "Saved", "maxConsoleErrors": 0 }click_ax clicks the button named Submit. assert_ui returns pass: true or pass: false with one line per check. A failed check is not a crashed tool.
get_network_log lists requests. get_response_body needs a finished requestId from that log. network_stub fulfills or fails a URL pattern. stop_app removes the session.
doctor is the first call when the environment itself is suspect: missing Electron binary, no display, sandbox flags.
Tools
Connect
Tool | What it does |
| Launch with remote debugging. |
| Join an existing |
| Resolve that port from a main-process PID. |
| Electron PIDs plus debug and inspect ports from argv. |
| Probe a local CDP port range ( |
| Packaged apps under Applications, Program Files, and |
| Sessions this server owns or has attached. |
| Kill an owned process, or detach an attached one. |
| Port, target roles, recent console errors. |
| This machine: Node, Electron binary, env flags, free port. |
See
Tool | What it does |
| Screenshot plus page, console errors, and network failures. |
| Accessibility tree (role and name). |
| PNG or JPEG. |
| Same capture, written to a file. |
| Compare a PNG baseline. Reports identical and byte similarity. |
| Scroll a selector into view and paint a DevTools overlay. |
|
|
| Tag, id, class, and text for matches. |
| URL, title, readyState, userAgent. |
| DevTools targets with role: page, worker, browser, other. |
| BrowserWindow and webContents mapped to DevTools targets. Needs |
Act
Tool | What it does |
| Go to a URL, then optionally wait for load. |
| Page targets only. Never the Node inspect target. |
| Selector, hidden, enabled, text, URL, console text, or node count. |
| Click the center of a CSS selector. |
| Move the pointer over a selector. Does not click. |
| Wheel the page or an element. A selector and no deltas scrolls it into view. |
| Press on one selector, move to another, and release. |
| Click by accessibility name and optional role. |
| Insert text. Optional focus, clear, and Enter. |
| Focus by accessibility name, then insert text. |
| Key or shortcut, with modifiers. |
| Set files on |
| Auto accept or dismiss the next alert, confirm, or prompt. |
| URL, title, text, selector, expression, console-error budget. Failed checks return |
| Emit |
| Pause JavaScript. |
Page state
Tool | What it does |
| JavaScript in a page, worker, or browser target. |
| JavaScript in the main process. Needs |
| Windows, app paths, versions, metrics. Needs |
| Buffered console, log, and exceptions. |
| Also stream non-error console lines as MCP logs. Errors always notify. |
| Process stdout and stderr. |
| Read or write cookies. |
| Remove a cookie by name. Same url or domain rules as |
| OS clipboard text. Needs |
|
|
| Drop console, network, logs, ipc, and audit buffers. |
Network
Tool | What it does |
| Buffered request and response events. |
| Body for a |
| HAR 1.2 from that buffer. No bodies. |
| Block URL patterns. |
| Extra headers on later requests. |
| Fulfill or fail URLs that match a pattern. The same pattern replaces the previous rule. |
| Turn request interception off. |
| Wait until nothing is in flight and the log has been quiet. |
| Save downloads from every webContents session and return |
Profile
Tool | What it does |
| Renderer performance counters. |
| Metrics, navigation and paint timing, recent audit issues. Not full Lighthouse. |
| Buffered audit issues: cookies, CORS, mixed content, deprecations. |
| One trace per session. Open the JSON in |
| V8 |
| V8 |
| Precise JS coverage, optional CSS. |
| Viewport, user agent, geolocation, media. |
| Pause or advance virtual time. |
| Bounded frame buffer. Stop can write the last frame. |
| Save the page as MHTML. |
| Break on a script URL and line. |
| Map stack frames to source snippets. |
Main process
Tool | What it does |
| Record IPC in the main process, then read it. Needs |
| Show and focus a window. |
| Allow or deny a permission prompt ( |
| Any DevTools |
Prompts
Prompt | When |
| White or blank window. Starts from |
| Console errors and exceptions. |
| Wait, interact, then |
| Find or attach, then |
|
|
|
|
Resources
URI | What |
| Version, uptime, platform, capability counts. |
| Managed processes. |
| DevTools targets. |
| One session, including recent errors. |
| stdout and stderr. |
| Buffered console. |
| One target. |
Configuration
Variable | Effect |
| Use this Electron binary. |
| Always pass |
|
|
| Allowlist for screenshot, trace, profile, and heap paths. The sensitive-path blocklist still applies. |
| Mirror for the Electron zip. |
| Zip cache directory. |
$env:ELECTRON_MCP_ALLOWED_ROOTS="D:\apps;D:\src"Screenshot and trace writes are rejected under credential and system roots (~/.ssh, ~/.aws, ~/.gnupg, ~/.kube, ~/.docker, /etc, /proc, /usr, /root, C:\Windows, C:\Program Files, and similar). Existing ancestors are resolved so macOS /tmp → /private/tmp still matches.
Security
This is a local debugger. It can start binaries, evaluate JavaScript, and read page content, cookies, storage, and network bodies. Set ELECTRON_MCP_ALLOWED_ROOTS on a shared machine. Attach only to apps you trust. Do not expose stdio on an open network. Buffers and exported traces can contain secrets from the app under test.
Troubleshooting
Symptom | What to do |
|
|
| Expected on newer npm. Run the ensure script. |
Terminal hangs on | The process is waiting for an MCP client. Configure Cursor or Claude to spawn it. |
Main-process tools fail | Restart with |
Screenshot fails after | Call |
| Pass an |
| Wait for it, then screenshot. |
| Use a |
| The path is outside |
Output path rejected | Avoid home credential dirs and system dirs, or set |
| The app must have been started with |
| Expected. Stopped sessions are removed. |
Linux headless |
|
Empty trace | Call |
Develop
npm testThat builds, runs unit tests, and runs the MCP smoke test against fixtures/minimal-electron-app. CI runs the same suite on Ubuntu (Xvfb), Windows, and macOS.
Script | What it does |
| Download or repair the Electron binary. |
| Compile TypeScript to |
| Run the server on stdio. |
| Build, then call |
|
|
src/index.ts registers tools, prompts, and resources. src/process-manager.ts owns sessions and DevTools. src/power-tools.ts holds the higher-level helpers. Logs go to stderr so stdout stays clean for JSON-RPC.
The npm package contains build/, assets/, this README, LICENSE, and CHANGELOG.md.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Live browser debugging for AI assistants — DOM, console, network via MCP.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
remote debug iOS/Android/Unity/Godot/Flutter/RN/Web on real-device.ui-tree/screenshots/taps,tests.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol server that provides comprehensive Electron application automation, debugging, and observability capabilities through Chrome DevTools Protocol integration.41,309 npm70MIT
- FlicenseAqualityDmaintenanceEnables debugging and automation of native Electron applications on macOS through DOM inspection, UI automation, global hotkeys, and Chrome DevTools Protocol integration.23-
- AlicenseNot gradedqualityBmaintenanceEnables Electron app automation via Chrome DevTools Protocol (CDP), allowing MCP clients like Cursor or Claude Desktop to interact with Electron apps.4MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI-powered automation, debugging, and observability of Electron applications through Chrome DevTools Protocol integration, providing real-time UI interaction and inspection capabilities.172 npm23MIT