console-terminal-mcp-server

console-terminal-mcp-server

3

The Electron Terminal MCP server allows for seamless interaction with a system terminal within an Electron app through a defined MCP interface. It integrates with Node.js and Express to handle terminal command execution, session management, and output retrieval effectively, providing a versatile tool for remote development.

Electron Terminal MCP Server

This project provides a Model Context Protocol (MCP) Server using Electron to facilitate client interaction with a system terminal within an Electron app. Features include command execution, session management, and output retrieval programmatically.

Features

  • MCP Server: A Node.js script that listens for MCP requests and serves as a bridge to the Electron backend. It starts the Electron backend automatically if required.
  • Electron Backend: Hosts an Express HTTP server for communication and manages terminal processes with node-pty.

Installation

  1. Ensure Node.js and npm are installed.
  2. Clone the repository.
  3. Install dependencies using npm.
  4. Rebuild native modules for Electron.

Usage

  1. Start the MCP Server by running the index.js script.
  2. Clients connect to the process via stdio using use_mcp_tool commands.

Tools

  • terminal_start: Start a new terminal session.
  • terminal_execute: Execute commands in a session.
  • terminal_get_output: Get session outputs.
  • terminal_stop: Stop a session.
  • terminal_get_sessions: List active sessions.

Requirements

  • Node.js (v20 or later)
  • npm
  • Compatible OS with Electron (Windows, macOS, Linux)

Synergy

Works effectively with the Filesystem MCP Server for a comprehensive development experience.