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 集成