Electron MCP Server
Launches, automates and closes Electron desktop applications via WebdriverIO, with UI element snapshots (refs), clicks, typing, screenshots, action recording, test code generation, and Chrome DevTools Protocol access for network mocking, console capture, performance metrics, and JavaScript evaluation inside the running app.
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 MCP Server launch my Electron app, click the login button, and screenshot the result"
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.
Electron MCP Server
An MCP (Model Context Protocol) server for testing Electron desktop applications using WebdriverIO. This server enables AI agents to interact with, test, and automate Electron apps.
Features
App Lifecycle Management: Launch and close Electron applications
Element Discovery: Capture UI snapshots with element references for interactions
Element Interactions: Click, type, and interact with UI elements
Screenshots: Capture visual state of the application
Action Recording: Record interactions for test generation
Test Generation: Generate WebdriverIO or Playwright test code
CDP Integration: Network monitoring, console capture, performance metrics, JS evaluation
Related MCP server: electron-test-mcp
Installation
cd electron-mcp-server
npm install
npm run buildUsage
As an MCP Server
Add to your MCP client configuration:
{
"mcpServers": {
"electron": {
"command": "node",
"args": ["/path/to/electron-mcp-server/dist/bin/cli.js"]
}
}
}Programmatic Usage
import { createServer, runServer } from 'electron-mcp-server';
// Run as stdio server
await runServer();
// Or create server instance
const server = await createServer();Available Tools
App Lifecycle (2)
Tool | Description |
| Launch an Electron app with WebdriverIO |
| Close the Electron app session |
Element Interactions (3)
Tool | Description |
| Discover UI elements with references |
| Click element by reference |
| Type text into element |
Page (1)
Tool | Description |
| Take a screenshot |
Recording (3)
Tool | Description |
| Start action recording |
| Stop recording |
| Get recording status |
Generator (1)
Tool | Description |
| Generate test code (WebdriverIO/Playwright) |
CDP Tools (4)
Tool | Description |
| Network interception/mocking |
| Console log capture |
| Performance metrics |
| Execute JS in app context |
Example Workflow
1. electron_launch(binaryPath: "/path/to/your-electron-app")
2. electron_snapshot() -> Returns element list with refs (e1, e2, e3...)
3. electron_click(ref: "e1") -> Click first element
4. electron_type(ref: "e2", text: "Hello") -> Type into input
5. electron_screenshot() -> Capture current state
6. electron_close()Recording and Test Generation
1. electron_launch(binaryPath: "/path/to/app")
2. electron_start_recording()
3. electron_snapshot()
4. electron_click(ref: "e1")
5. electron_type(ref: "e2", text: "test")
6. electron_stop_recording()
7. electron_generate_test(format: "webdriverio_ts", testName: "my_test")Supported Test Formats
webdriverio_js- WebdriverIO JavaScriptwebdriverio_ts- WebdriverIO TypeScriptplaywright_js- Playwright JavaScriptplaywright_ts- Playwright TypeScript
CDP Tools Usage
Network Monitoring
electron_cdp_network(action: "get") // Get captured requests
electron_cdp_network(action: "clear") // Clear history
electron_cdp_network(action: "mock", mock: {...}) // Set up mock responseConsole Capture
electron_cdp_console(action: "start") // Start monitoring
electron_cdp_console(action: "get") // Get logs
electron_cdp_console(action: "get", level: "error") // Get only errors
electron_cdp_console(action: "stop") // Stop and retrievePerformance Metrics
electron_cdp_performance(action: "get") // General metrics
electron_cdp_performance(action: "timing") // Navigation timing
electron_cdp_performance(action: "memory") // Memory usageJavaScript Evaluation
electron_cdp_evaluate(script: "return document.title")
electron_cdp_evaluate(script: "localStorage.getItem('key')")Requirements
Node.js >= 18.0.0
Electron app built for testing
ChromeDriver (handled by wdio-electron-service)
Dependencies
@modelcontextprotocol/sdk- MCP protocol implementationwebdriverio- WebDriver clientwdio-electron-service- Electron testing servicezod- Schema validation
License
MIT
Available Tools
28 toolselectron_cdp_consoleC
Capture and retrieve console logs from the Electron app
Inputs: action (required), level.
electron_cdp_evaluateC
Execute JavaScript code in the Electron app context and return the result
Inputs: script (required), returnValue (required), args.
electron_cdp_networkB
Interact with network requests via CDP: get captured requests, clear history, or set up mocks
Inputs: action (required), mock, filter.
electron_cdp_performanceC
Get performance metrics from the Electron app including timing and memory
Inputs: action (required).
electron_clickB
Click on an element using its reference from the snapshot
Inputs: ref (required).
electron_closeA
Close the Electron application and end the WebdriverIO session
Inputs: no named parameters.
electron_generate_locatorC
Generate a robust locator strategy for an element based on description.
Inputs: description (required).
electron_generate_testB
Generate executable test code from recorded actions for WebdriverIO or Playwright
Inputs: format (required), testName (required), appPath, filename.
electron_generator_read_logC
Read the action log from the current generation session. Shows all recorded actions.
Inputs: format (required).
electron_generator_setupC
Initialize a test generation session. Provide a test plan and target framework.
Inputs: testPlan (required), framework (required), outputDir.
electron_generator_write_testC
Save generated test code to a file in the output directory.
Inputs: filename (required), testCode (required), overwrite (required).
electron_healer_debug_testC
Run a specific test in debug mode with enhanced logging to diagnose failures.
Inputs: verbose (required), testName (required), testPath (required), framework (required), +1 more.
electron_healer_fix_testB
Apply fixes to a test file. Creates a backup and saves the corrected code.
Inputs: testPath (required), fixedCode (required), createBackup (required), fixDescription (required).
electron_healer_run_testsC
Execute test suite and collect failure information for debugging.
Inputs: timeout (required), testPath (required), framework (required), configPath.
electron_launchC
Launch an Electron application for testing. Connects via WebdriverIO with the Electron service.
Inputs: binaryPath (required), waitTimeout (required), windowWidth (required), windowHeight (required), +3 more.
electron_planner_exploreC
Document a screen or feature during test planning. Captures the current state and adds it to the planning session.
Inputs: screenName (required), notes, features, description.
electron_planner_saveB
Generate and save the test plan document based on the planning session.
Inputs: includeScreenshots (required), filename, additionalNotes.
electron_planner_setupC
Initialize a test planning session for an Electron application. Call this before exploring the app.
Inputs: appName (required), appPath (required), scope, outputDir.
electron_recording_statusA
Get the current recording status and action count
Inputs: no named parameters.
electron_resize_windowC
Resize the Electron app window to specified dimensions using JavaScript. Also supports setting window position.
Inputs: width (required), height (required), x, y.
electron_screenshotB
Take a screenshot of the current Electron app window. Returns the screenshot as base64 image.
Inputs: filename.
electron_snapshotA
Capture the current UI state including all interactive elements. Returns element references (e1, e2, etc.) that can be used for interactions.
Inputs: no named parameters.
electron_start_recordingB
Start recording user actions to generate test scripts later
Inputs: no named parameters.
electron_stop_recordingB
Stop recording actions and return the recorded action list
Inputs: no named parameters.
electron_typeC
Type text into an input field or textarea
Inputs: ref (required), text (required), clear (required).
electron_verify_element_visibleC
Verify that an element is visible on the screen.
Inputs: ref (required), timeout (required).
electron_verify_text_visibleC
Verify that specific text is visible on the page.
Inputs: text (required), exact (required), timeout (required).
electron_verify_valueB
Verify that an input element has the expected value.
Inputs: ref (required), timeout (required), expectedValue (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 28 tools
Most tools target distinct operations, but several phase-specific tools overlap conceptually: snapshot/screenshot/planner_explore all capture UI state, while start_recording/generator_setup/generate_test/generator_write_test require understanding of the recording-to-generation workflow. Descriptions generally clarify the boundaries, but an agent can still misselect without knowing the intended workflow phase.
All tools use the electron_ prefix and snake_case, which is highly predictable. There are minor internal pattern deviations: core tools tend to be verb_object while subsystem tools use group_action, and a few names are noun-only (snapshot, screenshot, cdp_network).
At 28 tools, the surface is heavy for an agent and exceeds the typical well-scoped range. The tools span many separate workflows (recording, generation, CDP, planning, healing, verification), and some could likely be consolidated or hidden behind higher-level entry points.
The server covers a broad Electron testing lifecycle: launch/close, snapshot-based interaction, screenshots, recording, test generation, CDP inspection/evaluation, verification, planning, and healing. Minor gaps exist in common UI actions such as hover, scroll, select, keyboard shortcuts, and richer element attribute retrieval, though cdp_evaluate provides a workaround.
Maintenance
Related MCP Connectors
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Build, run, debug, test and ship Chrome, Firefox, Edge and Safari extensions from your AI agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered automation, debugging, and observability of Electron applications through Chrome DevTools Protocol integration, providing real-time UI interaction and inspection capabilities.27MIT
- AlicenseCqualityDmaintenanceEnables AI models to test and interact with Electron applications using Playwright, supporting CDP connection and app launch modes.2882 npmMIT
- AlicenseCqualityDmaintenanceEnables AI coding tools to interact with Electron applications for automated testing, including app lifecycle, element interaction, and visual testing.481MIT
- AlicenseNot gradedqualityBmaintenanceLets an AI agent launch or attach to a running Electron app and control it directly over the Chrome DevTools Protocol: capture screenshots (optionally with the native window frame), click, drag, hover, scroll, type, press keys, resize and reload. It also exposes JavaScript execution in both the renderer and main process, an accessibility tree with click-ready coordinates, and console logs, so an agent can inspect and operate the app without adding any code to it.96 npmMIT