Terminal MCP Server

io.github.aybelatchane由 GitHub 帳號 aybelatchane 發布v1.0.3更新於 Oct 24, 2026

MCP server for AI agents to interact with terminal applications. Think Playwright for terminals.

發布方自己的服務:Terminal Tax

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 AI 助理操作終端機應用程式:建立工作階段、擷取終端機狀態、輸入文字、按鍵、點選介面元素並讀取輸出。

可以做什麼
管理工作階段:建立、列出、關閉和調整執行 htop 或 shell 指令等終端機程式的工作階段尺寸。檢視終端機狀態:擷取含辨識介面元素的快照,或讀取原始輸出。送出輸入:輸入文字、按下方向鍵、功能鍵和 Ctrl 組合鍵等按鍵,並點選辨識到的介面元素。等待條件:等待指定文字、元素或閒置狀態出現。
適用情境
適合讓助理操作沒有 API 的互動式終端機程式,例如 TUI 工具、選單或全螢幕主控台,並以按鍵層級撰寫互動腳本。它僅限桌面環境,適合本機開發機而非託管環境。
執行需求
以本機程序執行,通常透過 npx mcp-server-terminal 或預先建置的執行檔啟動;從原始碼建置需要 Rust 工具鏈。視覺模式會開啟可見終端機視窗,在 Linux/WSL 上需要 X11 並設定 DISPLAY 環境變數;可用參數啟用無頭模式。Windows 原生僅支援無頭模式,建議使用 WSL 以獲得完整功能。選用 RUST_LOG 設定日誌等級。
安裝前請注意
助理可在真實終端機工作階段中輸入任意文字並按鍵,指令可能以使用者權限執行並修改或刪除資料,應審查其執行內容。視覺模式會在桌面開啟視窗。日誌輸出至 stderr,可透過 RUST_LOG 提高詳細程度。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Terminal MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Terminal MCP Server

[npm version] [npm downloads] [License: MIT]

MCP server enabling AI agents to interact with terminal applications through structured Terminal State Tree representation. Works with any AI assistant that supports the Model Context Protocol.

Installation

Via npm (Recommended)

bash
npx mcp-server-terminal

Via GitHub Releases

Download pre-built binaries from Releases.

Build from Source

bash
git clone https://github.com/aybelatchane/mcp-server-terminal.gitcd mcp-server-terminalcargo build --release# Binary: ./target/release/terminal-mcp

Configuration

Claude

Claude Code (CLI)
bash
claude mcp add terminal -- npx mcp-server-terminal
Claude Desktop

Add to ~/.claude.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"]    }  }}

OpenAI Codex

Codex CLI
bash
codex mcp add terminal -- npx mcp-server-terminal
Codex Configuration File

Add to ~/.codex/config.toml:

toml
[mcp_servers.terminal]command = "npx"args = ["mcp-server-terminal"]

Google Gemini

Gemini CLI
bash
gemini mcp add terminal npx mcp-server-terminal

VS Code / GitHub Copilot

VS Code 1.101+ supports MCP. Add to your VS Code settings (settings.json):

json
{  "mcp.servers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"]    }  }}

Cursor

Add to ~/.cursor/mcp.json or .cursor/mcp.json in your project:

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"]    }  }}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"]    }  }}

Zed

Add to your Zed settings (Preferences → Settings):

json
{  "context_servers": {    "terminal": {      "command": {        "path": "npx",        "args": ["mcp-server-terminal"]      }    }  }}

Cline (VS Code Extension)

Click MCP Servers icon → Configure → Advanced MCP Settings, then add:

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"]    }  }}

AWS Bedrock

Add to your Bedrock agent MCP configuration:

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"]    }  }}

Other MCP Clients

For any MCP-compatible client, configure the server with:

  • Command: npx
  • Args: ["mcp-server-terminal"]

Or if using the binary directly:

  • Command: terminal-mcp

Usage

Ask your AI agent:

  • "Create a terminal session running htop"
  • "Take a snapshot of the terminal"
  • "Press the down arrow key"
  • "Type 'ls -la' and press Enter"

MCP Tools

ToolDescription
terminal_session_createStart a terminal session
terminal_session_listList active sessions
terminal_session_closeClose a session
terminal_session_resizeResize terminal dimensions
terminal_snapshotCapture terminal state with UI elements
terminal_typeType text into terminal
terminal_press_keyPress keys (arrows, F-keys, Ctrl+X)
terminal_clickClick on detected UI element
terminal_wait_forWait for text, element, or idle state
terminal_read_outputRead raw terminal output

Visual Mode

By default, sessions spawn a visible terminal window (xterm). For headless operation:

bash
npx mcp-server-terminal --headless

Or in your MCP config:

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal", "--headless"]    }  }}

X11 Setup (Linux/WSL)

Visual mode requires X11. Add the DISPLAY environment variable to your MCP config:

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"],      "env": {        "DISPLAY": ":0"      }    }  }}

Logging

Set the RUST_LOG environment variable:

json
{  "mcpServers": {    "terminal": {      "command": "npx",      "args": ["mcp-server-terminal"],      "env": {        "RUST_LOG": "info"      }    }  }}

Log levels: error, warn, info, debug, trace

Logs go to stderr (stdout is reserved for MCP protocol).

Platform Support

PlatformArchitectureStatusVisual Mode
Linuxx64, arm64✅ Full supportxterm + tmux
macOSx64, arm64✅ Full supportTerminal.app / iTerm2
Windows (WSL)x64, arm64✅ Full supportxterm + tmux (via X11)
Windows (native)x64⚠️ Headless onlyNot supported

Windows users: Use WSL for full functionality including visual mode.

License

MIT

來源:README.md,提交 c532381

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Terminal 整合