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.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Electron Debug MCP
Real Chrome DevTools Protocol superpowers for AI coding agents. Give Cursor, Claude & autonomous agents eyes, hands, and deep runtime inspection inside Electron desktop applications.
π Why Electron Debug MCP?
Most AI coding agents struggle with desktop applications: they can edit source code, but they cannot see the resulting window, click buttons, read console errors, or diagnose silent main-process crashes.
Electron Debug MCP bridges your agent directly into your Electron runtime via the Chrome DevTools Protocol (CDP) and Node inspector, unlocking full visual, interactive, and diagnostic autonomy.
flowchart LR
A["π€ AI Agent (Cursor / Claude)"] <-->|"stdio JSON-RPC"| B["β‘ Electron Debug MCP"]
B <-->|"CDP (WebSocket)"| C["πΌοΈ Renderer Windows\n(DOM Β· AXTree Β· Network Β· V8)"]
B <-->|"Node Inspector / V8"| D["βοΈ Main Process\n(IPC Β· WebContents Β· Windows Β· Fuses)"]Related MCP server: Electron Native MCP Server
β¨ Key Superpowers
π‘οΈ Runtime Security Audit
electron_security_audit evaluates running windows against official Electron security guidelines. Flags nodeIntegration, missing contextIsolation, disabled sandbox, unsafe CSP, missing setWindowOpenHandler, unguarded will-navigate, and executable binary fuses.
π Zero-Leak Secret Automation
Automate logins and API forms without leaking credentials. type_text({ text: "{{secret:VAR}}" }) resolves from process.env and automatically redacts the secret from return values, console logs, network entries, and HAR exports with [REDACTED].
π§© Autonomous Composite Workflows
High-level single-turn workflows reduce round trips:
act_and_verify: Action β network idle β UI assertion β automatic failure screenshot if assertion fails.triage: Instant health overview with page state, console errors, network failures, and resolved top exception stack.network_failure_report: Aggregates failed HTTP calls with response bodies inline plus an exported HAR artifact.
π Deep IPC Observability
ipc_tap: Intercepts main-processipcMain.handleandwebContents.sendcalls.ipc_invoke: Call any registered main-process handle channel directly with custom arguments.ipc_schema_inference: Analyzes traffic patterns and automatically emits inferred TypeScript interfaces for your preload bridge.
πΊοΈ Source-Mapped Stack Traces
resolve_stack decodes inline base64 and external v3 source maps. When your bundled app throws an exception, the agent gets original .ts and .tsx file names, line numbers, and original source snippets rather than minified bundle noise.
β‘ Frictionless Agent Ergonomics
Optional
processId: Automatically defaults to the single active app session.Tool Annotations: Tools declare standard MCP hints (
readOnlyHint,destructiveHint) so clients can auto-approve safe queries.Artifacts Resource: Output files are indexed as
electron://artifact/{id}.
β‘ Quick Start
1. Configure Your MCP Client
π In Cursor (~/.cursor/mcp.json or .cursor/mcp.json)
{
"mcpServers": {
"electron-debug": {
"command": "npx",
"args": ["-y", "electron-debug-mcp@latest"]
}
}
}π¬ In Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"electron-debug": {
"command": "npx",
"args": ["-y", "electron-debug-mcp@latest"]
}
}
}Developing locally? Run npm run build and configure "command": "node" with "args": ["/path/to/electron-mcp-server/build/index.js"].
π οΈ Tool Matrix (111 Tools)
All tools accept an optional processId. When only one app is running, it automatically resolves to the active process.
π Lifecycle & Connection (8)
Tool | Description |
| Launch Electron app with remote debugging port. Set |
| Terminate launched app or detach from an attached session. |
| Connect to a running Electron app via DevTools port or WebSocket URL. |
| Detect DevTools port from an Electron OS PID's command line and attach. |
| Enumerate all running Electron processes on the host machine. |
| Scan local TCP ports (default 9222β9322) to discover live CDP debug endpoints. |
| Scan standard OS application directories for installed packaged Electron apps. |
| Enumerate all active and managed sessions with uptime, PID, and target counts. |
ποΈ See & Visual Inspection (8)
Tool | Description |
| Recommended one-shot snapshot: viewport screenshot, page URL/title, console errors, and network failures. Supports |
| Complete semantic accessibility tree ( |
| Capture viewport PNG or JPEG base64 payload. |
| Capture screenshot to disk (supports CSS selector clipping); registers an artifact. |
| Visual regression comparison against a baseline screenshot. |
| Stream live viewport frames into a bounded ring buffer. |
| Stop screencasting and optionally save the final frame to disk. |
| Visually highlight a DOM element in the viewport with border and background overlays. |
π±οΈ Act & UI Automation (13)
Tool | Description |
| Composite: Executes an action ( |
| Click the center of an element matching a CSS |
| Robust click locating an element by its accessibility name and optional role. |
| Type text into focused element, |
| Focus an element by accessibility name and type text with secret placeholder support. |
| Dispatch keypress or keyboard shortcut (Enter, Escape, Tab, Arrows, Ctrl+A, etc.). |
| Move mouse pointer over a CSS |
| Scroll page or element by delta coordinates, or scroll a |
| Drag-and-drop between two selectors or refs with native HTML5 |
| Select an option in a |
| Programmatically set files on an |
| Automatically accept or dismiss JavaScript alerts, confirms, and prompts. |
| Dispatch a custom protocol deep link (e.g. |
π Page State & Navigation (20)
Tool | Description |
| Composite: Smart multi-field form solver (text, select, checkbox, radio, file) with |
| Composite: Multi-theme ( |
| Composite: Self-contained bug repro bundle (screenshot, MHTML DOM, HAR replay, console errors, logs, health) zipped into an artifact. |
| Basic page details: URL, title, dimensions, readyState, and user agent. |
| Navigate the active page target to a URL with configurable load-state waiting. |
| Reload the active page target (supports cache busting). |
| Wait for a CSS selector, page title, URL substring, or custom JS expression. |
| Retrieve page HTML markup (supports CSS selector root and |
| Evaluate CSS query and inspect matching elements' attributes and text content. |
| Evaluate arbitrary JavaScript in the renderer page context. |
| Retrieve buffered console messages and exceptions (supports level and tail filtering). |
| Retrieve captured process stdout and stderr logs. |
| Inspect cookies for specified URLs or across all targets. |
| Set browser cookies with domain, path, and security flags. |
| Delete a specific cookie by name. |
| Read items from |
| Write items to |
| Verify page URL, title, element visibility, text matches, and absence of console errors. |
| Export cookies, |
| Restore cookies and origin storage state back into the live Electron session for instant auth bypass and state replay. |
π Network & Downloads (12)
Tool | Description |
| Composite: Network chaos and fault recovery audit (simulating offline, high latency, or HTTP 500 faults) and Resilience Grade ( |
| Composite: Gathers failed HTTP requests (status β₯ 400 or network failure), inlines response bodies, and registers an exported HAR artifact. |
| Buffered HTTP requests and responses. Supports status, failure, and URL pattern filters. |
| Fetch raw response body for a completed |
| Export buffered network traffic to an official HAR 1.2 file and register artifact. |
| Block until zero network requests are in flight and the network has been quiet. |
| Intercept and mock HTTP requests matching a pattern with custom status, headers, or body. |
| Remove all active network interception stubs. |
| Block network requests matching wildcard URL patterns. |
| Inject custom HTTP headers into all subsequent requests. |
| Emulate offline conditions, added round-trip latency, and download/upload throughput caps. |
| Arm download listeners across all sessions and capture downloaded files without save dialogs. |
π Performance, Profiling & Debugger (16)
Tool | Description |
| Composite: Coordinates CDP tracing, CPU profiling, and code coverage over an interaction or reload, returning an aggregated performance bundle and artifact URIs. |
| Composite: Memory leak detector measuring DOM node, event listener, document, and heap growth across iterations post-GC. |
| Renderer performance counters (JS heap used/total, DOM node count, layout count, etc.). |
| Lightweight performance audit analyzing LCP, CLS, paint timing, and audit issues. |
| Buffered Chromium security, mixed content, and deprecation audit issues. |
| Record and export Perfetto/DevTools JSON timeline traces. |
| Record and export V8 |
| Capture complete V8 heap snapshot file artifact. |
| Track JavaScript and CSS code coverage and report unused code percentage. |
| Resolves stack frames back to source snippets; automatically decodes v3 source maps. |
| Set or clear JavaScript breakpoints by script URL and line number. |
| Suspend or resume V8 JavaScript execution via Debugger domain. |
π‘οΈ Main Process, Native Mocks, Menus & Security (23)
Tool | Description |
| Composite: IPC security and crash hardening fuzzer probing active handlers with boundary & attack payloads ( |
| Intercept and mock any Electron native module ( |
| Inspect recorded call history, argument signatures, and timestamps for mocked Electron APIs. |
| Restore original native Electron implementations and purge mock call records. |
| Inspect the native |
| Programmatically dispatch |
| Inspect and trigger native global accelerators ( |
| Watchdog monitoring process exits, crashes ( |
| Comprehensive security audit of webPreferences, context isolation, sandboxing, window handlers, navigation guards, and binary fuses. |
| Directly invoke a main-process IPC handle channel or emit an IPC event with arguments. |
| Infer IPC channel contracts, payload types, and auto-generate TypeScript definitions. |
| Hook main-process IPC to capture traffic between renderer and main. |
| Evaluate JavaScript inside the Electron main/Node context (requires |
| Inspect Electron application state: open windows, metrics, versions, and system paths. |
| Map BrowserWindows and webContents IDs to their respective CDP targets. |
| Show and bring a specific BrowserWindow to the foreground. |
| Move or resize an Electron BrowserWindow. |
| Programmatically allow or deny permissions (notifications, media, geolocation, etc.). |
| Read or write text and image data on the OS clipboard. |
| Render the page to a PDF document artifact. |
| Save the page DOM, stylesheets, and images into an MHTML archive artifact. |
π©Ί Meta & Diagnostics (11)
Tool | Description |
| Composite: Server-side workflow engine with templating ( |
| Composite: One-shot diagnosis aggregating page state, console errors, network failures, audit issues, log tails, and resolved exception stacks. |
| Verify environment health, Node/Electron binaries, and test ephemeral port binding. |
| Health check across all active sessions, target counts, and buffer sizes. |
| Reset buffered console messages, network requests, logs, or IPC entries. |
| Enumerate all CDP targets (pages, workers, iframes, node). |
| Override viewport, user agent, geolocation, device scale factor, and color scheme. |
| Freeze or advance virtual time to test deterministic timers and animations. |
| Stream live console and log messages directly as MCP notifications. |
| Raw CDP escape hatch: execute any |
π¦ Resources & Prompts
π‘ Standard MCP Resources
Expose real-time state and exported artifacts directly via standard MCP resources:
electron://serverβ Server status, version, and host environment.electron://infoβ Active process IDs, target breakdown, and recent error counts.electron://targetsβ Live CDP targets across all connected processes.electron://artifactsβ Index of all exported screenshots, traces, heap snapshots, and HARs.electron://artifact/{id}β Fetch an exported artifact by its ID.electron://process/{id}Β·electron://logs/{id}Β·electron://console/{id}Β·electron://cdp/{proc}/{target}
π¬ Built-in MCP Prompts
Interactive debugging recipes ready for one-click invocation:
debug_blank_windowβ Systematically diagnose white/blank renderers.find_renderer_exceptionβ Isolate unhandled exceptions, inspect audits, and resolve source stacks.ui_smoke_checkβ End-to-end UI verification: wait, interact, and assert.attach_and_screenshotβ Discover local apps, attach, and capture visual status.vision_then_actβ Visual-first agent loop: see, locate semantic target, act, and verify.ax_then_assertβ Accessibility-first action loop: locate by accessible name and assert state.
π Agent Recipes
1. Vision β Act β Verify Loop
// Step 1: Look at the screen and check for errors
{ "name": "vision", "arguments": {} }
// Step 2: Act and verify in a single turn (captures failure screenshot if assertion fails)
{
"name": "act_and_verify",
"arguments": {
"action": { "type": "click_ax", "name": "Sign In" },
"assertion": { "textIncludes": "Welcome back" }
}
}2. Secret Redaction in Automation Forms
{
"name": "type_text",
"arguments": {
"selector": "#api-key",
"text": "{{secret:MY_APP_API_KEY}}"
}
}Resolvesprocess.env.MY_APP_API_KEY, inserts it via CDP, returns typed: "[REDACTED]", and automatically sanitizes the secret from all subsequent logs, console events, and HAR files.
3. Automated Security Audit
{ "name": "electron_security_audit", "arguments": {} }Returns checklist score (0β100), letter grade (AβF), and actionable remediation guidance for webPreferences and Electron binary fuses.
4. IPC Contract Inference
// 1. Arm tap -> 2. Run app interactions -> 3. Infer TypeScript contracts
{ "name": "ipc_schema_inference", "arguments": {} }Generates ready-to-use TypeScript definitions for your preload APIs directly from observed runtime communication.
5. Multi-Step Workflow Engine & Playwright Codegen (run_script)
Execute complex, multi-action automations server-side in a single MCP roundtrip with variable interpolation, conditional branching, retries, assertion checks, and code generation.
{
"name": "run_script",
"arguments": {
"vars": {
"targetWorkspace": "workspace-alpha",
"expectedItems": 3
},
"steps": [
{
"id": "authenticate",
"tool": "type_text",
"args": {
"selector": "input#token",
"text": "{{secret:APP_API_TOKEN}}"
},
"expect": { "status": "success" }
},
{
"id": "switch_workspace",
"tool": "click",
"args": { "selector": "button.workspace-switch" },
"retry": { "retries": 3, "delayMs": 250 }
},
{
"id": "check_banner",
"tool": "eval_js",
"args": { "expression": "Boolean(document.querySelector('.promo-modal'))" }
},
{
"id": "dismiss_banner",
"if": "{{steps.check_banner.result.value}} == true",
"tool": "click",
"args": { "selector": ".promo-modal .close-btn" }
},
{
"id": "verify_workspace_state",
"tool": "eval_js",
"args": {
"expression": "({ active: document.querySelector('#current-ws').textContent.trim(), count: document.querySelectorAll('.item').length })"
},
"expect": {
"js": "result.value.active === 'workspace-alpha' && result.value.count >= 3"
}
}
],
"exportAs": "playwright"
}
}Capabilities & Options
Feature | Syntax / Option | Purpose |
Variables & Context |
| Reference values from the script's |
Step Dependencies |
| Pass outputs, IDs, or tokens computed in earlier steps directly into subsequent tool arguments. |
Environment & Secrets |
| Inject process environment variables; secrets are automatically masked in logs, console events, and outputs as |
Conditional Branching |
| Skips step execution unless condition evaluates to true ( |
Expectation Assertions |
| Validates step outcome; custom |
Automatic Retries |
| Automatically retries flaky operations with exponential backoff before failing. |
Failure Diagnostics | Automated | If a step fails, captures viewport screenshot artifact ( |
Playwright Codegen |
| Generates a standalone, runnable Playwright |
import { test, expect, _electron as electron } from "@playwright/test";
test("executed script workflow", async () => {
const electronApp = await electron.launch({ args: ["."] });
const window = await electronApp.firstWindow();
// Step: authenticate
await window.locator("input#token").fill(process.env.APP_API_TOKEN || "");
// Step: switch_workspace
await window.locator("button.workspace-switch").click();
// Step: dismiss_banner
await window.locator(".promo-modal .close-btn").click();
// Step: verify_workspace_state
const evalResult = await window.evaluate("({ active: document.querySelector('#current-ws').textContent.trim(), count: document.querySelectorAll('.item').length })");
expect(evalResult).toBeDefined();
await electronApp.close();
});6. Ref Locators & Set-of-Marks Visual Prompting
Inspect accessibility targets with compact refs (e1, e2) and drive interactions without fragile CSS selectors:
// 1. Take snapshot with Set-of-Marks badges in the screenshot
{ "name": "vision", "arguments": { "markElements": true } }
// 2. Click directly by ref token
{ "name": "click", "arguments": { "ref": "e3" } }
// 3. Type text into ref
{ "name": "type_text", "arguments": { "ref": "e4", "text": "Hello Desktop!" } }7. Native Electron API Mocking (Dialogs, Shell, Clipboard)
Bypass OS file dialogs, external URL opens, or update checks during automated test runs:
// 1. Mock dialog.showOpenDialog to return test fixtures
{
"name": "mock_electron_api",
"arguments": {
"module": "dialog",
"method": "showOpenDialog",
"returns": { "canceled": false, "filePaths": ["/fixtures/document.pdf"] }
}
}
// 2. Mock shell.openExternal
{
"name": "mock_electron_api",
"arguments": {
"module": "shell",
"method": "openExternal",
"returns": true
}
}
// 3. Inspect tracked invocations
{ "name": "get_mock_calls", "arguments": { "module": "shell", "method": "openExternal" } }
// 4. Restore original implementation
{ "name": "restore_electron_mocks", "arguments": { "module": "shell", "method": "openExternal" } }8. Native Application Menu & Accelerator Trigger
Automate native OS menus and global keyboard shortcuts:
// 1. Inspect the full native menu tree
{ "name": "get_application_menu", "arguments": {} }
// 2. Click menu item by path or role
{ "name": "click_menu_item", "arguments": { "path": "File > Save" } }
// 3. Dispatch an Electron accelerator directly
{ "name": "trigger_shortcut", "arguments": { "accelerator": "CommandOrControl+Shift+P" } }9. Process Health Watchdog & Crash Diagnostics
{ "name": "get_process_health", "arguments": {} }Returns real-time status ("healthy", "unresponsive", or "crashed"), tracking OOM terminations, child process failures, window hangs, and memory metrics.
10. Storage State Snapshot & Auth Replay
Save full session state (cookies, localStorage, sessionStorage) into Playwright-compatible storage state artifacts to bypass repeated login flows across tests:
// 1. Export storage state to an artifact
{ "name": "save_storage_state", "arguments": {} }
// 2. Restore state into any new Electron session
{
"name": "load_storage_state",
"arguments": {
"state": { "cookies": [...], "origins": [...] }
}
}11. One-Shot Bug Repro Bundle & Issue Generator (repro_bundle)
Package a complete, self-contained zip archive containing viewport screenshot, full MHTML DOM archive, HAR network replay, source-mapped console errors, stderr tail, health metrics, and a GitHub-ready Markdown issue report in one turn:
{
"name": "repro_bundle",
"arguments": {
"notes": "Regression on checkout flow after OAuth upgrade"
}
}Returns artifactUri: "electron://artifact/...", destination path, and the complete markdown summary ready to paste into GitHub issues or Jira.
12. Smart Multi-Field Accessible & Secret Form Solver (fill_form)
Fill complete multi-input forms in a single tool call from either a key-value dictionary or structured field specs:
{
"name": "fill_form",
"arguments": {
"fields": {
"Username or Email": "developer@example.com",
"Password": "{{secret:APP_PASSWORD}}",
"Environment": "Staging",
"Remember Me": true
},
"submit": true,
"expect": {
"textIncludes": "Welcome back"
}
}
}Resolves fields via accessibility tree labels, ARIA attributes, placeholders, or refs (e1), resolves secrets securely, selects dropdown options, toggles checkboxes, clicks submit, and verifies post-submit UI assertions.
13. Network Chaos & Resilience Scorecard (offline_resilience_check)
Simulate real-world network failure conditions (offline, latency, or HTTP 500) during interaction, monitor app health and error bursts, restore network, and compute an executive Resilience Grade (AβF):
{
"name": "offline_resilience_check",
"arguments": {
"faultType": "offline",
"durationMs": 1500,
"action": { "type": "click", "selector": "#save-btn" }
}
}14. Responsive Theme & Viewport Matrix Sweep (responsive_theme_matrix)
Audit how layouts adapt across color schemes (light, dark) and viewport sizes, catching horizontal scrollbar leaks (scrollWidth > innerWidth):
{
"name": "responsive_theme_matrix",
"arguments": {
"themes": ["light", "dark"],
"viewports": [
{ "width": 800, "height": 600, "name": "compact" },
{ "width": 1280, "height": 800, "name": "desktop" }
]
}
}15. IPC Security & Crash Hardening Fuzzer (ipc_fuzz_and_verify)
Harden renderer-to-main IPC communication against malicious or malformed payloads (null, prototype pollution, path traversal, oversized buffers) and verify process crash resistance:
{
"name": "ipc_fuzz_and_verify",
"arguments": {
"iterations": 6
}
}π Changelog & Releases
Version | Release Highlights | Test Suite |
v1.15.0 | Composite Superpowers & Resilience Workflows: One-Shot Bug Repro Bundle ( | 140 unit Β· 111 smoke |
v1.14.0 | Ref Locators & Set-of-Marks ( | 135 unit Β· 106 smoke |
v1.13.0 | Server-Side Workflow Engine & Codegen ( | 130 unit Β· 97 smoke |
v1.12.0 | Runtime Security Audit ( | 125 unit Β· 96 smoke |
v1.11.0 | Tool Annotations ( | 120 unit Β· 88 smoke |
Complete historical release notes, API migration notes, and dependency updates are tracked inCHANGELOG.md.
π§― Troubleshooting
Symptom | Solution |
| Run |
| Omit |
Terminal hangs on | Normal: the server communicates over stdio JSON-RPC. Spawn it from your MCP client. |
Main-process tools fail | Launch the app with |
Port in use / WSAEACCES on Windows | The server dynamically probes and selects ephemeral bindable ports to avoid Hyper-V/WSL conflicts. |
π Development & Verification
npm test # Run build, 140 unit tests, and full 111-tool smoke suite
npm run doctor # Verify environment health and port binding
npm run sync:readme # Automatically synchronize badge counts with registered toolsπ License
ISC Β© Electron Debug MCP contributors
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
- AlicenseBqualityCmaintenanceA Model Context Protocol server that provides comprehensive Electron application automation, debugging, and observability capabilities through Chrome DevTools Protocol integration.41,399 npm71MIT
- AlicenseAqualityDmaintenanceEnables debugging and automation of native Electron applications on macOS through DOM inspection, UI automation, global hotkeys, and Chrome DevTools Protocol integration.23MIT
- 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 gradedqualityDmaintenanceEnables AI-powered automation, debugging, and observability of Electron applications through Chrome DevTools Protocol integration, providing real-time UI interaction and inspection capabilities.65 npm27MIT