SM

sichang824/mcp-terminal

Developer tools

This page was translated automatically. Technical details may differ from the original. View the original

26 stars 13 forks Quality 63 Trend 0MIT

MCP Terminal is a terminal control server based on MCP (Model Context Protocol), designed specifically for integration with large language models (LLMs) and AI assistants. It provides a standardized interface that allows AI to execute terminal commands and obtain output results.

Overview

MCP Terminal is a terminal control server based on MCP (Model Context Protocol), designed specifically for integration with large language models (LLMs) and AI assistants. It provides a standardized interface that allows AI to execute terminal commands and obtain output results. - Implemented using the official MCP SDK - Supports multiple terminal controllers: - Provides advanced control on macOS using iTerm2's Python API - : Controls Terminal applications on macOS using AppleScript - Universal terminal control methods across all platforms - Supports multiple server modes: - Communicates with clients via standard input/output - Offers HTTP API via Server-Sent Events - Offers multiple tools: - Executes commands and retrieves output - Performs file operations (read/write, add, insert) - Automatically detects the optimal terminal controller - Seamless integration with Claude Desktop - Supports Docker deployment Open iTerm2, go to Preferences → General → Magic, and check the options, as shown below: We provide Docker support for rapid deployment of MCP Terminal servers: Running the MCP Terminal server with Docker (default uses SSE mode and Subprocess controller): - Server mode: SSE - Host: 0.0.0.0 (allows remote connection) - Port: 8000 - Controller: subprocess (suitable for container environments) You can customize the configuration by modifying the Dockerfile or docker-compose.yml file. You can configure Docker containers as MCP services, allowing Claude or other MCP-enabled AIs to directly use containerized tools. Here is an example of using Docker containers as MCP services in a Claude configuration file:

Overview (machine translated)

MCP Terminal is a terminal control server based on MCP (Model Context Protocol), designed specifically for integration with large language models (LLMs) and AI assistants. It provides a standardized interface that allows AI to execute terminal commands and obtain output results.

English | Chinese

Demo Video

Features

  • Implemented using the official MCP SDK
  • Supports multiple terminal controllers:
  • iTerm2 Controller: Provides advanced control on macOS using iTerm2’s Python API
  • AppleScript Controller: Use AppleScript to control the Terminal app on macOS
  • Subprocess Controller: A terminal control method universal across all platforms
  • Supports multiple server modes:
  • STDIO Mode: Communicates with the client via standard input/output
  • SSE Mode: Provides HTTP API via Server-Sent Events
  • Provides a variety of tools:
  • Terminal Tools: Execute commands and retrieve outputs
  • File Tools: Perform file operations (read/write, add, insert)
  • Automatically detects the optimal terminal controller
  • Seamless integration with Claude Desktop
  • Supports Docker deployment

Installation

Prerequisites

  • Python 3.8+
  • UV package management tools

If you haven’t installed UV yet, you can install it using the following command:

Clone the repository and install dependencies using UV:

**Note: To use the iTerm2 controller, you must enable the Python API in the iTerm2 settings. **

Open iTerm2, then go to Preferences → General → Magic, and check the Enable Python API option, as shown below:

Install using Makefile

We provide Makefiles to simplify common operations:

Install using Docker

We provide Docker support for rapid deployment of MCP Terminal servers:

Or use docker-compose:

How to use

Running the MCP Terminal Server

There are several ways to start the server:

Run with Docker

Running the MCP Terminal server with Docker (default uses SSE mode and Subprocess controller):

Default configuration:

  • Server mode: SSE
  • Host: 0.0.0.0 (allows remote connection)
  • Ports: 8000
  • Controller: Subprocess (suitable for container environments)

You can customize the configuration by modifying the Dockerfile or docker-compose.yml file.

This page was translated automatically. Technical details may differ from the original.

Install

docker run --rm -i --mount type=bind src=${workspaceFolder} dst=/workspace mcp-terminal mcp-terminal --mode sse --host 0.0.0.0 --port 8000
New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "terminal": { "command": "/Users/ann/Workspace/mcp-terminal/.venv/bin/python", "args": [ "/Users/ann/Workspace/mcp-terminal/mcp_terminal.py", "--controller", "subprocess" ] } } }