Provides comprehensive Electron application automation, debugging, and observability capabilities through Chrome DevTools Protocol integration. Enables UI automation, screenshot capture, DOM inspection, real-time logs, and application control without requiring code modifications to target applications.
Provides integration with GitHub for repository access, licensing information, and contribution workflows.
Offers support integration through Ko-fi for project funding and maintenance contributions.
Enables installation and distribution through the npm package registry, with version tracking and package management.
Includes a demo video hosted on Vimeo that showcases the MCP server's capabilities for Electron application automation.
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 MCP Servertake a screenshot of the main window and show me the DOM structure"
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
A powerful Model Context Protocol (MCP) server that provides comprehensive Electron application automation, debugging, and observability capabilities. Supercharge your Electron development workflow with AI-powered automation through Chrome DevTools Protocol integration.
Demo
See the Electron MCP Server in action:

Watch how easy it is to automate Electron applications with AI-powered MCP commands.
Related MCP server: Electron Terminal MCP Server
🎯 What Makes This Special
Transform your Electron development experience with AI-powered automation:
🔄 Real-time UI Automation: Click buttons, fill forms, and interact with any Electron app programmatically
📸 Visual Debugging: Take screenshots and capture application state without interrupting development
🔍 Deep Inspection: Extract DOM elements, application data, and performance metrics in real-time
⚡ DevTools Protocol Integration: Universal compatibility with any Electron app - no modifications required
🚀 Development Observability: Monitor logs, system info, and application behavior seamlessly
🔒 Security & Configuration
Configurable security levels to balance safety with functionality:
Security Levels
🔒 STRICT: Maximum security for production environments
⚖️ BALANCED: Default security with safe UI interactions (recommended)
🔓 PERMISSIVE: More functionality for trusted environments
🛠️ DEVELOPMENT: Minimal restrictions for development/testing
Environment Configuration
Configure the security level and other settings through your MCP client configuration:
VS Code MCP Settings:
Claude Desktop Configuration:
Alternative: Local .env file (for development):
Security Level Behaviors:
Level | UI Interactions | DOM Queries | Property Access | Assignments | Function Calls | Risk Threshold |
| ❌ Blocked | ❌ Blocked | ✅ Allowed | ❌ Blocked | ❌ None allowed | Low |
| ✅ Allowed | ✅ Allowed | ✅ Allowed | ❌ Blocked | ✅ Safe UI functions | Medium |
| ✅ Allowed | ✅ Allowed | ✅ Allowed | ✅ Allowed | ✅ Extended UI functions | High |
| ✅ Allowed | ✅ Allowed | ✅ Allowed | ✅ Allowed | ✅ All functions | Critical |
Environment Setup:
Copy
.env.exampleto.envSet
SECURITY_LEVELto your desired levelConfigure other security settings as needed
Secure UI Interaction Commands
Instead of raw JavaScript eval, use these secure commands:
See SECURITY_CONFIG.md for detailed security documentation.
🎯 Proper MCP Usage Guide
⚠️ Critical: Argument Structure
The most common mistake when using this MCP server is incorrect argument structure for the send_command_to_electron tool.
❌ Wrong (causes "selector is empty" errors):
✅ Correct:
📋 Command Argument Reference
Command | Required Args | Example |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| No args needed |
|
🔄 Recommended Workflow
Inspect: Start with
get_page_structureordebug_elementsTarget: Use specific selectors or text-based targeting
Interact: Use the appropriate command with correct argument structure
Verify: Take screenshots or check page state
🐛 Troubleshooting Common Issues
Error | Cause | Solution |
"The provided selector is empty" | Passing string instead of object | Use |
"Element not found" | Wrong selector | Use |
"Command blocked" | Security restriction | Check security level settings |
"Click prevented - too soon" | Rapid consecutive clicks | Wait before retrying |
🛠️ Security Features
Enterprise-grade security built for safe AI-powered automation:
🔒 Sandboxed Execution: All code runs in isolated environments with strict resource limits
🔍 Input Validation: Advanced static analysis detects and blocks dangerous code patterns
📝 Comprehensive Auditing: Encrypted logs track all operations with full traceability
🖼️ Secure Screenshots: Encrypted screenshot data with clear user notifications
⚠️ Risk Assessment: Automatic threat detection with configurable security thresholds
🚫 Zero Trust: Dangerous functions like
eval, file system access, and network requests are blocked by default
Safety First: Every command is analyzed, validated, and executed in a secure sandbox before reaching your application.
�🚀 Key Features
🎮 Application Control & Automation
Launch & Manage: Start, stop, and monitor Electron applications with full lifecycle control
Interactive Automation: Execute JavaScript code directly in running applications via WebSocket
UI Testing: Automate button clicks, form interactions, and user workflows
Process Management: Track PIDs, monitor resource usage, and handle graceful shutdowns
📊 Advanced Observability
Screenshot Capture: Non-intrusive visual snapshots using Playwright and Chrome DevTools Protocol
Real-time Logs: Stream application logs (main process, renderer, console) with filtering
Window Information: Get detailed window metadata, titles, URLs, and target information
System Monitoring: Track memory usage, uptime, and performance metrics
🛠️ Development Productivity
Universal Compatibility: Works with any Electron app without requiring code modifications
DevTools Integration: Leverage Chrome DevTools Protocol for powerful debugging capabilities
Build Automation: Cross-platform building for Windows, macOS, and Linux
Environment Management: Clean environment handling and debugging port configuration
📦 Installation
VS Code Integration (Recommended)
Add to your VS Code MCP settings:
Claude Desktop Integration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Global Installation
🔧 Available Tools
launch_electron_app
Launch an Electron application with debugging capabilities.
Returns: Process ID and launch confirmation
get_electron_window_info
Get comprehensive window and target information via Chrome DevTools Protocol.
Returns:
Window IDs, titles, URLs, and types
DevTools Protocol target information
Platform details and process information
take_screenshot
Capture high-quality screenshots using Playwright and Chrome DevTools Protocol.
Features:
Non-intrusive capture (doesn't bring window to front)
Works with any Electron app
Fallback to platform-specific tools if needed
send_command_to_electron
Execute JavaScript commands in the running Electron application via WebSocket.
Enhanced UI Interaction Commands:
find_elements: Analyze all interactive UI elements with their properties and positionsclick_by_text: Click elements by their visible text, aria-label, or title (more reliable than selectors)fill_input: Fill input fields by selector, placeholder text, or associated label textselect_option: Select dropdown options by value or visible textget_page_structure: Get organized overview of all page elements (buttons, inputs, selects, links)get_title: Get document titleget_url: Get current URLget_body_text: Extract visible text contentclick_button: Click buttons by CSS selector (basic method)console_log: Send console messageseval: Execute custom JavaScript code
Recommended workflow: Use get_page_structure first to understand available elements, then use specific interaction commands like click_by_text or fill_input.
read_electron_logs
Stream application logs from main process, renderer, and console.
close_electron_app
Gracefully close the Electron application.
build_electron_app
Build Electron applications for distribution.
💡 Usage Examples
Smart UI Interaction Workflow
Advanced Element Detection
Automated UI Testing
Development Debugging
Performance Monitoring
🏗️ Architecture
Chrome DevTools Protocol Integration
Universal Compatibility: Works with any Electron app that has remote debugging enabled
Real-time Communication: WebSocket-based command execution with the renderer process
No App Modifications: Zero changes required to target applications
Process Management
Clean Environment: Handles
ELECTRON_RUN_AS_NODEand other environment variablesResource Tracking: Monitors PIDs, memory usage, and application lifecycle
Graceful Shutdown: Proper cleanup and process termination
Cross-Platform Support
macOS: Uses Playwright CDP with screencapture fallback
Windows: PowerShell-based window detection and capture
Linux: X11 window management (planned)
🧪 Development
Prerequisites
Node.js 18+
TypeScript 4.5+
Electron - Required for running and testing Electron applications
# Install Electron globally (recommended) npm install -g electron # Or install locally in your project npm install electron --save-dev
Target Application Setup
For the MCP server to work with your Electron application, you need to enable remote debugging. Add this code to your Electron app's main process:
Alternative approaches:
Note: The MCP server automatically scans ports 9222-9225 to detect running Electron applications with remote debugging enabled.
Setup
Testing
The project includes comprehensive test files for React compatibility:
See tests/integration/react-compatibility/README.md for detailed testing instructions and scenarios.
React Compatibility
This MCP server has been thoroughly tested with React applications and handles common React patterns correctly:
✅ React Event Handling: Properly handles
preventDefault()in click handlers✅ Form Input Detection: Advanced scoring algorithm works with React-rendered inputs
✅ Component Interaction: Compatible with React components, hooks, and state management
Project Structure
🔐 Security & Best Practices
Sandboxed Execution: All JavaScript execution is contained within the target Electron app
Path Validation: Only operates on explicitly provided application paths
Process Isolation: Each launched app runs in its own process space
No Persistent Access: No permanent modifications to target applications
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Before reporting issues: Please use the standardized ISSUE_TEMPLATE.md for proper bug reporting format. For React compatibility problems or similar technical issues, also review REACT_COMPATIBILITY_ISSUES.md for detailed debugging examples, including proper command examples, error outputs, and reproduction steps.
Fork the repository
Create a feature branch (
git checkout -b feature/awesome-feature)Commit your changes (
git commit -m 'Add awesome feature')Push to the branch (
git push origin feature/awesome-feature)Open a Pull Request
📄 License
MIT License - see LICENSE file for details.
☕ Support
If this project helped you, consider buying me a coffee! ☕
Your support helps me maintain and improve this project. Thank you! 🙏
🙏 Acknowledgments
Model Context Protocol - Standardized AI-application interface
Chrome DevTools Protocol - Universal debugging interface
Playwright - Reliable browser automation
Electron - Cross-platform desktop applications
🔗 Links
Issue Template - Standardized bug reporting format
React Compatibility Issues Documentation - Technical debugging guide for React applications
Ready to supercharge your Electron development with AI-powered automation? Install the MCP server and start building smarter workflows today! 🚀