Provides comprehensive tools for debugging and automating native Electron applications, including DOM inspection via Chrome DevTools Protocol, JavaScript execution, element querying, and screenshot capture of Electron windows and webviews.
Enables UI automation and control of macOS system features through accessibility APIs, including mouse and keyboard control, native UI screenshots, global hotkey triggering (Spotlight, Mission Control, etc.), and system permission management.
Electron Native MCP Server
A powerful Model Context Protocol (MCP) server for debugging and automating native Electron applications on macOS. This server provides comprehensive tools for DOM inspection, UI automation, and global hotkey triggering.
Features
š DOM Inspection (7 tools)
Connect to Electron apps via Chrome DevTools Protocol (CDP)
List all debuggable targets (windows, webviews)
Query and inspect DOM elements
Execute JavaScript in Electron windows
Take screenshots of Electron content
š±ļø UI Automation (9 tools)
Control mouse (move, click, double-click, drag)
Keyboard input (type text, press keys)
Take screenshots of native UI
Get screen dimensions and mouse position
Full macOS accessibility API integration
āØļø Global Hotkeys (4 tools)
Trigger custom keyboard shortcuts
Activate common macOS hotkeys (Spotlight, Mission Control, etc.)
Simulate application-specific shortcuts
Send complex key sequences
š Permission Management (4 tools)
Check permission status
Request system permissions
Get setup instructions
Verify all required permissions
Requirements
macOS 12.0 or later
Node.js 18.0 or later
Electron app running with
--inspectflag (for DOM inspection)
Required macOS Permissions
This server requires the following system permissions:
Accessibility - For UI automation and keyboard/mouse control
Screen Recording - For taking screenshots
Input Monitoring - For keyboard and mouse input
Installation
Quick Setup (Recommended)
This will:
Check system requirements
Install dependencies
Build the project
Provide configuration instructions
Optionally install the example app
Manual Setup
Usage
Running the Server
Configuring with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
Configuring with Other MCP Clients
The server uses stdio transport and can be integrated with any MCP-compatible client.
Tool Reference
DOM Inspection Tools
list_electron_targets
List all available Electron windows and webviews.
connect_to_electron_target
Connect to a specific Electron target for debugging.
get_dom_tree
Get the complete DOM tree of a connected target.
query_selector
Find a DOM element using CSS selector.
execute_javascript
Execute JavaScript in an Electron window.
UI Automation Tools
click
Click at coordinates or current position.
type_text
Type text at the current cursor position.
press_key
Press a key with optional modifiers.
take_screenshot
Capture a screenshot of the screen or region.
Hotkey Tools
trigger_hotkey
Trigger a custom keyboard shortcut.
trigger_common_macos_hotkey
Trigger a common macOS system hotkey.
Permission Tools
check_all_permissions
Check the status of all required permissions.
Debugging Electron Apps
To debug an Electron app with this server:
Launch your Electron app with the inspect flag:
/path/to/your/app.app/Contents/MacOS/YourApp --inspect=9222List available targets: Use the
list_electron_targetstool to see all debuggable windows.Connect to a target: Use
connect_to_electron_targetwith the target ID.Inspect and interact: Use DOM tools to query elements, execute JavaScript, etc.
Examples
Example 1: Click a Button in Electron App
Example 2: Automate Native UI
Example 3: Trigger Spotlight
Development
Architecture
Troubleshooting
Permission Denied Errors
If you get permission errors, use the permission tools to check status:
Then grant the required permissions in System Settings.
Cannot Connect to Electron App
Make sure your Electron app is running with the --inspect flag:
Screenshots Not Working
Ensure Screen Recording permission is granted for your terminal app (Terminal, iTerm2, VS Code, etc.).
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Credits
Built with:
@modelcontextprotocol/sdk - MCP TypeScript SDK
chrome-remote-interface - Chrome DevTools Protocol client
@nut-tree/nut-js - Desktop automation
node-mac-permissions - macOS permissions
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables debugging and automation of native Electron applications on macOS through DOM inspection, UI automation, global hotkeys, and Chrome DevTools Protocol integration.