Get the FREE Ultimate OpenClaw Setup Guide →

electron

MCP server from halilural/electron-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio halilural-electron-mcp-server npx -y electron-mcp-server \
  --env SECURITY_LEVEL="balanced" \
  --env SCREENSHOT_ENCRYPTION_KEY="your-32-byte-hex-string"

How to use

This MCP server provides AI-powered automation, debugging, and observability for Electron applications. It exposes commands that let you interact with Electron UIs, capture screenshots, inspect DOM-like structures, and monitor application state through a DevTools Protocol integration. Typical workflows involve inspecting the app, selecting elements via secure commands, and performing interactions such as clicking, typing, or navigating, all while respecting the configured security level. Use the included commands like click_by_selector, click_by_text, fill_input, send_keyboard_shortcut, navigate_to_hash, and evaluation commands to automate repetitive tasks, gather runtime metrics, and diagnose issues without modifying the target Electron app.

To operate, configure your MCP client to connect to the electron server and send properly structured command payloads. The server emphasizes secure, structured commands to prevent unsafe executions, and it supports taking screenshots, extracting element data, and collecting performance metrics in real time. By adjusting the SECURITY_LEVEL in your environment, you control UI interactions, DOM queries, property access, and function calls to balance automation power with safety for your Electron projects.

How to install

Prerequisites:

  • Node.js and npm or pnpm installed on your machine
  • Access to a terminal/command prompt

Installation steps:

  1. Install Node.js/npm from https://nodejs.org/ or ensure they are installed
  2. Install the Electron MCP Server package globally or run via npx (as shown in the config):

Option A: Run via npx (no local install required)

  • Ensure you have internet access
  • The MCP server can be started implicitly by your MCP client using the provided mcp_config

Option B: Local installation (optional)

  • Create a project directory
  • Run: npm init -y
  • Run: npm install electron-mcp-server
  • Start the server by running a Node.js script that imports and starts the server if needed (refer to the package's documentation)

Configuration:

  • Create or update your MCP client configuration to include the electron server settings from mcp_config (see section in README for examples)
  • Set environment variables as needed, for example SECURITY_LEVEL and SCREENSHOT_ENCRYPTION_KEY

Verification:

  • Run your MCP client and connect to the electron server using the configured command and arguments
  • Send a simple get_title or get_page_structure command to verify connectivity

Additional notes

Tips and considerations:

  • Always set SECURITY_LEVEL to an appropriate value for your environment. Balanced is recommended for typical development workflows.
  • The SCREENSHOT_ENCRYPTION_KEY should be a 32-byte hex string if you intend to encrypt screenshots; replace the placeholder with a real key in production.
  • When debugging, use commands like get_page_structure and get_title first to understand the page/app context before interacting with elements.
  • Ensure your Electron app permits the DevTools Protocol integration used by the MCP server; some apps may restrict certain operations.
  • If you encounter selector-related errors, verify selectors with get_page_structure or DOM inspection tools and ensure you’re sending argument objects in the required { "selector": "..." } format.
  • Review the Security Features documentation (SECURITY_CONFIG.md) for details on allowed actions per security level.

Related MCP Servers

Sponsor this space

Reach thousands of developers