electron-mcp
Provides tools for debugging and controlling an Electron application, including lifecycle management, window automation, console and network log capture, IPC logging, and main-process state inspection via Chrome DevTools Protocol and Node inspector.
Click on "Install 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-mcplaunch my Electron app via npm and list its windows"
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.
@iamvinitk/electron-mcp
MCP server for interacting with and debugging an Electron app. Spawns (or attaches to) an Electron process with the Chrome DevTools Protocol on the renderer and the Node inspector on the main process, then exposes ~20 tools for driving / inspecting both sides.
Works with any Electron or Electron Forge project.
Install
Run it on demand with npx (no install needed):
npx -y @iamvinitk/electron-mcp…or install the electron-mcp binary globally:
npm i -g @iamvinitk/electron-mcp
electron-mcpRelated MCP server: mcp-electron-driver
Use it from an MCP client
The server speaks MCP over stdio — point any MCP client at it. For a
typical mcpServers config:
{
"mcpServers": {
"electron": {
"command": "npx",
"args": ["-y", "@iamvinitk/electron-mcp"]
}
}
}(To run from a local clone instead, npm install && npm run build, then
point your client's command/args at node /path/to/build/index.js.)
Tools
Lifecycle
Tool | Purpose |
| Spawn via |
| Spawn the |
| Register an already-running Electron instance. |
| Close CDP clients, kill spawned process, drop the session. |
| Snapshot every active session (pid, ports, status, uptime). |
| Zero-cost sanity check that the Node inspector is reachable. |
Window automation
Tool | Purpose |
| Enumerate renderer CDP targets. Skips |
| Run JS in the renderer via |
| Page-navigate the renderer. |
| Capture a PNG/JPEG via |
Logs & network
Tool | Purpose |
| Read captured stdout/stderr from the spawned process. |
| Read renderer |
| Read renderer fetch/XHR activity (e.g. the app's API calls). |
| Wipe one or more ring buffers — useful before recording. |
IPC
Tool | Purpose |
|
|
| Call any preload-exposed IPC method directly. |
| Inject a proxy that captures every IPC call the renderer makes. |
| Drain + read the captured IPC events. |
Main-process state
Tool | Purpose |
|
|
| Path-traversal-guarded read under |
Resources
URI | Purpose |
| JSON list of every tracked session. |
| Detailed snapshot of one session (windows, recent logs, buffer sizes). |
Typical debug flow
1. launch_via_npm → id=electron-abcd1234
2. list_windows id=... → pick the target id
3. evaluate id=... expr=… → probe renderer state
4. invoke_electron_api → test an IPC handler
5. get_main_logs / get_console_messages / get_network_requests
6. stop_app → tear downHow it works
Launch modes.
launch_appinvokes theelectronbinary with--remote-debugging-port=<N> --inspect=<N+?> <appPath>.launch_via_npmwrapsnpm run <script>and smuggles--inspect-electronthrough forge's flag plumbing (double--separators), because forge only exposes main-process inspection that way.Two debug channels. Electron renderers are Chromium pages, so they speak CDP on
--remote-debugging-port. The main process is Node, which speaks the (near-identical) Node inspector protocol on--inspect. Both usechrome-remote-interface; we keep per-session client caches so repeated tool calls don't reconnect.Log capture. Main-process stdout/stderr flow into a ring buffer on spawn. Renderer console, exceptions, and network events flow into separate ring buffers via CDP event subscribers set up the first time each target's client opens.
enable_ipc_logginginstalls aProxyoverwindow.electronAPIso every IPC call the renderer makes (regardless of origin) is observable; re-injected onPage.frameNavigated.Stdin stays open. Electron-forge's
startcommand interprets an EOF on its stdin as "the user left the interactive REPL" and shuts down the child Electron. We hold stdin open (never write to it) so forge keeps running as long as we want.
Limitations
Packaged builds. If the app's Electron Forge config disables the
EnableNodeCliInspectArgumentsfuse, that blocks--inspectat the fuse layer in packaged builds. Window automation and renderer-side tools still work against a packaged build if you pass--remote-debugging-port, but main-process tools (get_app_paths,read_user_data_file) need a non-fused dev build.Single-process model. One MCP server → any number of tracked sessions. Sessions don't persist across MCP restarts; restart the MCP server to refresh.
macOS stdin quirk. Some terminal emulators (rare) block SIGINT delivery through
npm's stdin pipe. Ifstop_appleaves a zombie forge process,pkill -f electron-forgeis the backup.
Development
npm run watch # tsc --watch
npm run typecheck # tsc --noEmitThere are no unit tests in this package. Verification is end-to-end against a running Electron app.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/iamvinitk/electron-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server