debugtron-mcp
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., "@debugtron-mcp launch Slack and get console logs"
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.
debugtron-mcp
An MCP server that lets AI agents debug installed Electron apps end-to-end: discover apps, launch them with debug ports, evaluate JavaScript in the main process and renderer pages, capture console/IPC/network traffic, take screenshots, simulate input, profile CPU and heap, set breakpoints, read script sources, and inspect workers.
App discovery and launch adapters are vendored from debugtron (MIT); the debugging surface (Chrome DevTools Protocol + Node inspector) is exposed as 40+ MCP tools.
Requirements
Node.js >= 22
macOS / Windows / Linux (remote Android debugging via
adbis supported by the underlying adapters but currently limited to page-level CDP)
Related MCP server: @nebula-agents/electron-mcp
Build
yarn install
yarn build # outputs dist/index.js (single-file ESM bundle)
yarn typecheck # optionalUsage
Register with your MCP client over stdio. For Claude Code:
claude mcp add debugtron -- node /path/to/debugtron-mcp/dist/index.jsOr explore interactively with the MCP inspector:
npx @modelcontextprotocol/inspector node dist/index.jsTypical agent session
list_apps— discover installed Electron appslaunch_app— launch one (byappIdor directexePath), get asessionIdlist_pages— find renderer windows/webviews/workers (retry until they appear)evaluate_in_main/evaluate_in_renderer— run JS in either processget_console_logs/get_network_log/get_process_logs— observe behaviorget_response_body/get_cookies/get_local_storage— inspect network/statescreenshot/click/type/navigate— drive the UImonitor_ipc+get_ipc_log— capture IPC trafficmonitor_events+get_event_log— capture lifecycle/navigation/crash eventslist_scripts+get_script_source— read app bundles for static analysisset_breakpoint/evaluate_on_call_frame/step_over— debug at source levelget_heap_snapshot/start_cpu_profile— deep performance diagnosticslist_workers/evaluate_in_worker— debug service/shared/dedicated workersstop_session— terminate the app and clean up
Tools
Sessions & discovery
Tool | Description |
| Discover installed Electron apps ( |
| Launch an app with |
| Close CDP connections and terminate the app (idempotent) |
| List active sessions with status and ports |
| List renderer targets: pages, webviews, workers |
| App process stdout/stderr (works after exit) |
Execution & observation
Tool | Description |
| Run JS in the Electron main process (Node inspector) |
| Run JS in a renderer page (CDP |
| Console messages + uncaught exceptions from main and pages |
| Network requests captured per page (includes |
| Get the response body of a captured request by |
| Read all cookies from the browser network stack (incl HttpOnly) |
| Read localStorage or sessionStorage entries |
| Electron/Chromium/Node versions, app paths, BrowserWindow list |
| Per-process CPU% and memory (app.getAppMetrics) |
Page control & DOM
Tool | Description |
| Page navigation (waits for load event, non-fatal) |
| PNG/JPEG screenshot returned as MCP image content |
| outerHTML of the document or a selector (truncatable) |
| Element tag/text/attributes/bounding rect by CSS selector |
| Input simulation by selector or coordinates (unicode-safe) |
| Renderer metrics: JS heap, DOM nodes, layout counts |
Electron-specific
Tool | Description |
| Capture IPC traffic (ipcMain send/invoke, webContents.send) |
| Capture lifecycle events (crashes, unresponsive, navigation, window creation) |
Debugging & profiling
Tool | Description |
| List parsed scripts (filter by URL substring) |
| Read script source by scriptId (for static analysis of app.asar bundles) |
| Breakpoints by script URL or regex, main or renderer |
| Execution control and paused call-stack inspection |
| Evaluate in a paused frame context (access local variables) |
| Single-step execution |
| V8 heap snapshot written to a |
| CPU profile to |
Workers
Tool | Description |
| List service workers, shared workers, dedicated workers (Target domain) |
| Run JS in a worker target via the flatten protocol |
Heap snapshots and CPU profiles are written to files (default: system temp
dir, override with filePath) and can be opened in Chrome DevTools.
Notes & limitations
Single-instance lock: apps using
requestSingleInstanceLock(e.g. VS Code) must be fully closed beforelaunch_app; otherwise the second instance forwards to the running one and the debug flags are dropped. The tool error message tells you when this happens.Pages appear asynchronously: retry
list_pagesfor a few seconds after launch.monitor_ipccapturessendmessages onipcMainat any time, butinvokehandlers only if they were registered after monitoring started (Electron dispatcheshandle()internally, not through the emitter).Breakpoints on inline scripts (e.g. inside
data:URLs) don't bind; use them on real script files (file://.../app.asar/...,http(s)://...).Workers are discovered via the browser-level Target domain (separate from
/json). Some older Electron versions may not expose all worker types.Diagnostics are written to stderr; stdout is reserved for the MCP protocol.
Acknowledgements
Target discovery/launch adapters (
src/targets/) and theAppInfotype are vendored from debugtron by Rongjian Zhang (MIT License).
License
MIT
Available Tools
44 toolsclickA
Click in a renderer page, either by CSS selector (scrolled into view, clicked at its center) or by raw CSS-pixel coordinates.
Inputs: pageId (required), sessionId (required), x, y, +1 more.
evaluate_in_mainA
Evaluate a JavaScript expression in the app's main (Node/Electron) process via the inspector protocol. Electron APIs like require('electron').app or BrowserWindow are available.
Inputs: sessionId (required), expression (required), awaitPromise.
evaluate_in_rendererA
Evaluate a JavaScript expression in a renderer page via CDP. Use list_pages to find page ids.
Inputs: pageId (required), sessionId (required), expression (required), awaitPromise.
evaluate_in_workerA
Evaluate a JavaScript expression in a worker target (service worker, shared worker, dedicated worker) using the flatten protocol. Get workerTargetId from list_workers.
Inputs: sessionId (required), expression (required), workerTargetId (required), awaitPromise.
evaluate_on_call_frameA
Evaluate an expression in the context of a paused call frame (access local variables). Requires the target to be paused — get callFrameId from get_paused_state.
Inputs: sessionId (required), expression (required), callFrameId (required), pageId.
get_app_infoA
Get Electron app details from the main process: Electron/Chromium/Node versions, app name/version, standard paths (userData etc.), and the list of BrowserWindows with title, URL and bounds.
Inputs: sessionId (required).
get_console_logsB
Get console messages and uncaught exceptions captured from the main process and renderer pages (console.* calls, CDP log entries).
Inputs: sessionId (required), tail, level, pageId.
get_cookiesA
Get cookies from the browser network stack visible to a page (Network.getAllCookies). Includes HttpOnly cookies that document.cookie cannot see.
Inputs: pageId (required), sessionId (required), urlFilter.
get_dom_snapshotA
Get the outerHTML of a renderer page (or of a specific element via selector). Truncated to maxLength characters.
Inputs: pageId (required), sessionId (required), selector, maxLength.
get_event_logA
Read Electron lifecycle events captured by monitor_events (crashes, hangs, navigation, window/webContents lifecycle). Optionally clears the buffer after reading.
Inputs: sessionId (required), tail, clear.
get_heap_snapshotA
Take a V8 heap snapshot of the main process or a renderer page. The snapshot can be large, so it is written to a .heapsnapshot file (loadable in Chrome DevTools Memory panel); the file path is returned.
Inputs: sessionId (required), pageId, filePath.
get_ipc_logA
Read IPC traffic captured by monitor_ipc. Optionally clears the buffer after reading.
Inputs: sessionId (required), tail, clear.
get_local_storageB
Read localStorage or sessionStorage entries of a renderer page.
Inputs: pageId (required), sessionId (required), storageType.
get_network_logA
Get network requests captured from renderer pages (Network domain). A page's requests are recorded once any page tool has attached to it. Entries include requestId for get_response_body.
Inputs: sessionId (required), tail, pageId, urlFilter.
get_paused_stateA
Get the current paused state (reason + call stack with callFrameIds) of the main process or a renderer page, if it is paused on a breakpoint or Debugger.pause.
Inputs: sessionId (required), pageId.
get_performance_metricsB
Get renderer performance metrics (Performance.getMetrics): JS heap size, DOM node count, layout/recalc counts, timestamps, etc.
Inputs: pageId (required), sessionId (required).
get_process_logsC
Get the app process stdout/stderr output captured since launch. Works even after the process has exited.
Inputs: sessionId (required), tail.
get_process_metricsA
Get per-process CPU and memory metrics of the app (app.getAppMetrics): Browser (main), renderer, GPU and utility processes with pid, CPU % and working set size.
Inputs: sessionId (required).
get_response_bodyA
Get the response body of a captured network request. Use get_network_log to find requestIds. Only works for requests whose loading has finished while a page client was attached.
Inputs: pageId (required), requestId (required), sessionId (required).
get_script_sourceB
Get the source code of a script by scriptId (from list_scripts). Useful for static analysis of app.asar bundles.
Inputs: scriptId (required), sessionId (required), pageId, maxLength.
launch_appA
Launch an Electron app with debug ports (--inspect for the main process, --remote-debugging-port for renderers) and create a debug session. Provide either appId (from list_apps) or a direct exePath. Returns the sessionId and debug ports.
Inputs: cwd, env, appId, exePath, +1 more.
list_appsA
List installed Electron apps discovered on a target (local machine by default). Returns app id, name and executable path. Use the app id with launch_app.
Inputs: refresh, targetId.
list_breakpointsA
List breakpoints set via this server on the main process or a renderer page.
Inputs: sessionId (required), pageId.
list_pagesA
Refresh and list the debuggable targets of a session: renderer pages, webviews, workers, service workers. Pages can take a few seconds to appear after launch — retry if empty. Page-only tools (screenshot, DOM, input) do not work on worker targets.
Inputs: sessionId (required).
list_scriptsA
List scripts known to the Debugger domain (collected via scriptParsed). Use urlFilter to narrow down, then get_script_source to read source code.
Inputs: sessionId (required), pageId, urlFilter.
list_sessionsA
List active debug sessions with their app, status and debug ports.
Inputs: no named parameters.
list_workersA
List worker targets (service workers, shared workers, dedicated workers) discovered via the browser-level Target domain. Use evaluate_in_worker to run JS in them.
Inputs: sessionId (required).
monitor_eventsA
Start or stop capturing Electron lifecycle events in the main process: render-process-gone (crashes), unresponsive, navigation (did/will-navigate, redirects), window and webContents creation, child-process-gone. Read with get_event_log.
Inputs: action (required), sessionId (required).
monitor_ipcA
Start or stop IPC monitoring in the main process. Captures ipcMain messages (send/invoke) and webContents.send traffic into a buffer; read it with get_ipc_log. Note: invoke handlers registered before monitoring started are not captured (Electron dispatches them internally); 'send' messages are always captured.
Inputs: action (required), sessionId (required).
pauseA
Pause execution at the next statement in the main process or a renderer page.
Inputs: sessionId (required), pageId.
query_selectorA
Query a single element by CSS selector in a renderer page. Returns tag name, text, attributes and bounding rect.
Inputs: pageId (required), selector (required), sessionId (required).
reloadC
Reload a renderer page.
Inputs: pageId (required), sessionId (required), ignoreCache.
remove_breakpointA
Remove a breakpoint previously set with set_breakpoint.
Inputs: sessionId (required), breakpointId (required), pageId.
resumeA
Resume execution after a pause or breakpoint hit.
Inputs: sessionId (required), pageId.
screenshotB
Capture a screenshot of a renderer page. Returns a PNG (default) or JPEG image.
Inputs: pageId (required), sessionId (required), format, quality.
set_breakpointA
Set a breakpoint by script URL or URL regex in the main process or a renderer page. Works on bundled scripts too — use urlRegex to match a distinctive part of the script path (e.g. "app.asar.*main"). Use get_paused_state to observe hits.
Inputs: sessionId (required), lineNumber (required), url, pageId, +3 more.
start_cpu_profileA
Start CPU profiling on the main process or a renderer page. Call stop_cpu_profile to collect the result.
Inputs: sessionId (required), pageId.
step_intoB
Step into the current function call while paused. Use get_paused_state to observe the new location.
Inputs: sessionId (required), pageId.
step_outA
Step out of the current function while paused. Use get_paused_state to observe the new location.
Inputs: sessionId (required), pageId.
step_overA
Step over the current statement while paused. Use get_paused_state to observe the new location.
Inputs: sessionId (required), pageId.
stop_cpu_profileA
Stop CPU profiling and collect the profile. The full profile is written to a .cpuprofile file (loadable in Chrome DevTools Performance panel); a summary of the hottest functions is returned inline.
Inputs: sessionId (required), top, pageId, filePath.
stop_sessionA
Stop a debug session: close CDP connections and terminate the app process. Safe to call twice.
Inputs: sessionId (required).
typeA
Type text into a renderer page. If a selector is given, the element is clicked first to focus it. Uses Input.insertText, which is unicode-safe (CJK, emoji).
Inputs: text (required), pageId (required), sessionId (required), selector.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 44 tools
Each tool targets a specific context or action (e.g., evaluate_in_main vs evaluate_in_renderer, monitor_events vs monitor_ipc), with clear boundaries between DOM, network, debugging, and profiling tools. No two tools overlap in purpose.
All tools follow a consistent verb_noun pattern using underscores, such as get_dom_snapshot, list_pages, set_breakpoint, and stop_cpu_profile. There are no deviations or mixed conventions.
44 tools is high but justified by the broad scope of Electron debugging (main process, renderer, workers, profiling, IPC, network). The count is appropriate for a comprehensive debugger, though a few utilities might be consolidated.
The tool set covers the full lifecycle of debugging: launch, navigation, DOM inspection, network, console, process logs, breakpoints, stepping, profiling, heap snapshots, and IPC monitoring. There are no obvious gaps for the domain.
Maintenance
Related MCP Connectors
MCP server to assist with JxBrowser development.
MCP server for understanding Javascript internals from ECMAScript specification.
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Related MCP Servers
- AlicenseBqualityCmaintenanceA Model Context Protocol server that provides comprehensive Electron application automation, debugging, and observability capabilities through Chrome DevTools Protocol integration.41,981 npm71MIT
- AlicenseNot gradedqualityCmaintenanceEmbedded MCP server for Electron apps that exposes BrowserWindow surfaces and lets MCP clients drive renderers through Chrome DevTools Protocol.8 npmMIT
- FlicenseNot gradedqualityDmaintenanceMCP server that connects to your browser to capture screenshots, inspect console logs, network requests, and more via Chrome DevTools Protocol.2-
- AlicenseAqualityDmaintenanceMCP server for interacting with and debugging Electron apps, providing tools for window automation, IPC, logs, and main-process state via CDP and Node inspector.201MIT