Sponsored by Deepsite.site

🚀 Electron Debug MCP Server

Created By
amafjarkasi8 months ago
🚀 A powerful MCP server for debugging Electron applications with deep Chrome DevTools Protocol integration. Control, monitor, and debug Electron apps through a standardized API.
Content

🚀 Electron Debug MCP Server

TypeScript Electron Chrome DevTools Protocol Model Context Protocol

A powerful Model Context Protocol (MCP) server for debugging Electron applications with deep Chrome DevTools Protocol integration.

📋 Table of Contents

🔍 Overview

Electron Debug MCP Server provides a bridge between the Model Context Protocol (MCP) and Electron applications, enabling advanced debugging capabilities through a standardized API. It allows you to start, monitor, debug, and control Electron applications programmatically, with deep integration with Chrome DevTools Protocol for advanced debugging features.

✨ Features

🔄 Core Functionality

  • Process Management
    • 🚀 Start Electron applications with debugging enabled
    • 🛑 Stop running Electron processes
    • 📋 List all active Electron processes
    • 📊 Monitor process status and logs

🔍 Debugging Capabilities

  • Chrome DevTools Protocol Integration
    • 🎯 Discover and connect to debugging targets
    • 🧩 Execute CDP commands across domains
    • 📝 Evaluate JavaScript in the context of pages
    • 🔄 Reload pages or entire applications
    • ⏯️ Pause and resume JavaScript execution

📡 Resource Access

  • Structured Resource Endpoints
    • 📊 Overview of all running Electron processes
    • 📝 Detailed debug information for specific processes
    • 📜 Access to process logs
    • 🎯 List of available debugging targets
    • 🔍 Direct CDP access for specific targets

📥 Installation

# Clone the repository
git clone https://github.com/yourusername/electron-mcp-server.git

# Navigate to the project directory
cd electron-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

🚀 Usage

Starting the Server

npm run start

This will start the MCP server using stdio for communication.

Connecting to the Server

The MCP server uses stdio for communication, so clients need to connect using the Model Context Protocol. You can:

  • Use an MCP client library
  • Connect directly via stdin/stdout
  • Use a tool that supports MCP

📡 Resource Endpoints

The server exposes the following resource endpoints:

ResourceDescription
electron://infoOverview of all running Electron processes
electron://process/{id}Detailed debug info for a specific process
electron://logs/{id}Access to logs for a specific process
electron://targetsList of all available debug targets
electron://cdp/{processId}/{targetId}CDP access for a specific target
electron://operation/{operation}Operations to control Electron apps

Available Operations

OperationDescription
startStart an Electron application
stopStop a running Electron process
listList all running Electron processes
reloadReload a specific page or application
evaluateExecute JavaScript in a page context
pausePause JavaScript execution
resumeResume JavaScript execution

🔍 Chrome DevTools Protocol Integration

The server integrates with Chrome DevTools Protocol to provide deep debugging capabilities:

Listing Available Targets

GET electron://targets

Returns all available debugging targets across all running Electron processes.

Inspecting a Specific Target

GET electron://cdp/{processId}/{targetId}

Provides information about the target and available CDP domains.

Executing CDP Commands

GET electron://cdp/{processId}/{targetId}/{domain}/{command}

Examples:

  • electron://cdp/electron-123456/page-1/Page/reload - Reload the page
  • electron://cdp/electron-123456/page-1/Runtime/evaluate - Evaluate JavaScript
  • electron://cdp/electron-123456/page-1/Debugger/pause - Pause execution

📝 Examples

Starting an Electron App

// Example request (using an MCP client)
const response = await mcpClient.readResource({
  uri: "electron://operation/start",
  content: JSON.stringify({
    appPath: "C:\\path\\to\\your\\electron\\app",
    debugPort: 9222  // Optional debugging port
  })
});

Getting Debug Information

// Get detailed info about a specific app
const processId = "electron-1234567890";
const infoResponse = await mcpClient.readResource({
  uri: `electron://process/${processId}`
});

Executing JavaScript in a Page

// Execute JavaScript in a page
const evalResponse = await mcpClient.readResource({
  uri: `electron://cdp/electron-123456/page-1/Runtime/evaluate`,
  content: JSON.stringify({
    expression: "document.title",
    returnByValue: true
  })
});

🛠️ Development

Project Structure

electron-mcp-server/
├── src/
│   ├── index.ts         # Main server implementation
│   └── types/           # TypeScript type definitions
├── build/               # Compiled JavaScript output
├── package.json         # Project dependencies and scripts
└── tsconfig.json        # TypeScript configuration

Building the Project

npm run build

Running in Development Mode

npm run dev

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the ISC License - see the LICENSE file for details.


Built with ❤️ using TypeScript, Electron, and Chrome DevTools Protocol.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp
Amap Maps高德地图官方 MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
CursorThe AI Code Editor
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server