Get the FREE Ultimate OpenClaw Setup Guide →

console-terminal

An MCP server that can manage terminal sessions

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nexon33-console-terminal-mcp-server node index.js

How to use

This MCP server bridges an Electron-based terminal inside an Electron application to the MCP ecosystem. It exposes tools that let clients create terminal sessions, run commands, and retrieve output as if you were interacting with a real terminal, but all within the Electron backend. The available tools include terminal_start to spawn a new session and run an initial command, terminal_execute to run additional commands in an existing session, terminal_get_output to fetch accumulated output for a session, terminal_stop to terminate a session, and terminal_get_sessions to list current sessions. Clients connect to the Electron Terminal server via the MCP protocol and issue these tools through the standard use_mcp_tool flow, receiving structured outputs such as session IDs and command output.

To use it effectively, start the MCP server with node index.js, which will automatically launch and reuse the Electron backend as needed. Then, using your MCP client, issue terminal_start to begin a session (for example, to run ls -l) and use terminal_execute for subsequent commands. You can poll with terminal_get_output or cleanly terminate sessions with terminal_stop. This setup is designed to let external MCP clients manage terminal interactions without embedding Electron logic in client code.

How to install

Prerequisites

  • Node.js (v14+ recommended; Node v20+ supported by the project) and npm
  • Git

Installation steps

  1. Clone the repository
git clone <your-repository-url>
c d command-terminal-electron # Or your repository directory name
  1. Install dependencies for both the MCP server and the Electron app
npm install
  1. Rebuild native modules for Electron (e.g., node-pty)
node rebuild.js
  1. Run the MCP server
node index.js

Note: The MCP server will automatically start and manage the Electron backend behind the scenes.

Additional notes

Tips and considerations:

  • The server name exposed to clients is defined in index.js as 'Electron Terminal'. Use this exact name when addressing tools.
  • The Electron backend runs privately and is reused when possible; if it crashes, the MCP server attempts to restart it.
  • Ensure the Electron app can bind to its HTTP backend (default port 3000) and that any required environment dependencies for Electron are installed on the host.
  • If you modify paths, ensure index.js and main.js locations are correctly referenced when starting the MCP server.
  • This server relies on the mcp-package.json having { "type": "module" } to enable ES module imports.

Related MCP Servers

Sponsor this space

Reach thousands of developers