GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者提供的说明(英文原文)
MCP server for interactive terminal sessions — SSH, REPLs, database CLIs, TUI apps
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
TERMINAL_MCP_MAX_SESSIONS, TERMINAL_MCP_IDLE_TIMEOUT你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"terminal": {
"command": "uvx",
"args": [
"terminal-mcp"
],
"env": {
"TERMINAL_MCP_MAX_SESSIONS": "your-value",
"TERMINAL_MCP_IDLE_TIMEOUT": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add terminal --env TERMINAL_MCP_MAX_SESSIONS=your-value --env TERMINAL_MCP_IDLE_TIMEOUT=your-value -- uvx terminal-mcp运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"terminal": {
"command": "uvx",
"args": [
"terminal-mcp"
],
"env": {
"TERMINAL_MCP_MAX_SESSIONS": "your-value",
"TERMINAL_MCP_IDLE_TIMEOUT": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"terminal": {
"type": "stdio",
"command": "uvx",
"args": [
"terminal-mcp"
],
"env": {
"TERMINAL_MCP_MAX_SESSIONS": "your-value",
"TERMINAL_MCP_IDLE_TIMEOUT": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
TERMINAL_MCP_MAX_SESSIONS envTERMINAL_MCP_IDLE_TIMEOUT env这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日
注册名称已通过 GitHub 账户 mkpvishnu 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.3.1)于8个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
同一分类中有:GitHub, Desktop Commander, Cloudflare MCP
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Give your AI a real terminal. Persistent sessions. Interactive programs. Zero limitations.
Every AI coding tool hits the same wall: no real terminal access.
Claude Code's Bash tool, GitHub Copilot, and Codex all run commands in isolated subprocesses. Each command starts fresh. No state carries over. That means:
terminal-mcp gives AI agents a real terminal. Persistent PTY sessions that survive across tool calls. Send commands, read output, press keys, navigate TUIs - exactly like a human at a terminal.
uvx terminal-mcp
One command. Works with Claude Code, Claude Desktop, VS Code, Cursor, and Windsurf.
# No install needed - run directly
uvx terminal-mcp
pip install terminal-mcp
Claude Code
Add to ~/.claude.json or project .mcp.json:
{
"mcpServers": { "terminal": { "command": "uvx", "args": ["terminal-mcp"] } } }
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": { "terminal": { "command": "uvx", "args": ["terminal-mcp"] } } }
VS Code / Cursor
Click the one-click install badge above, or add to .vscode/mcp.json:
{
"servers": { "terminal-mcp": { "command": "uvx", "args": ["terminal-mcp"] } } }
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": { "terminal": { "command": "uvx", "args": ["terminal-mcp"] } } }
session_exec exec="echo hello from terminal-mcp"
session_create command="ssh user@prod-server.com" label="prod"
session_interact session_id="a1b2c3d4" input="df -h" wait_for="\$" session_interact session_id="a1b2c3d4" input="docker ps" wait_for="\$" session_close session_id="a1b2c3d4"
session_create command="python3" label="python"
session_interact session_id="e5f6g7h8" input="import pandas as pd" wait_for=">>>" session_interact session_id="e5f6g7h8" input="df = pd.read_csv('data.csv')" wait_for=">>>" session_interact session_id="e5f6g7h8" input="df.describe()" wait_for=">>>" session_close session_id="e5f6g7h8"
session_create command="psql -U admin mydb" label="db"
session_interact session_id="x1y2z3w4" input="SELECT count(*) FROM users;" wait_for="row" session_interact session_id="x1y2z3w4" input="\dt" wait_for="#" session_close session_id="x1y2z3w4"
session_create command="htop" label="monitor"
session_read session_id="a1b2c3d4"
session_send session_id="a1b2c3d4" key="F6" session_read session_id="a1b2c3d4" mode="diff"
session_send session_id="a1b2c3d4" key="F10" session_close session_id="a1b2c3d4"
session_create command="bash" label="build"
session_send session_id="a1b2c3d4" input="npm run build" session_wait_for session_id="a1b2c3d4" pattern="Build complete|ERROR" timeout=120
session_exec exec="git log --oneline -10"
session_exec exec="docker compose ps" timeout=10
| Feature | What It Does | |
|---|---|---|
| Persistent Sessions | Real PTY sessions that survive across tool calls | |
| Send + Read in One Call | session_interact halves LLM round trips | |
| Pattern-Based Reads | wait_for blocks until regex matches - no guessing timeouts | |
| Auto TUI Detection | Detects htop, vim, etc. and auto-switches to screen snapshot mode | |
| Output Diff Mode | Returns only changed screen lines - minimizes tokens | |
| Special Keys | Arrow keys, Tab, F1-F12, Home/End, Page Up/Down | |
| Control Characters | Ctrl-C, Ctrl-D, Ctrl-Z, Ctrl-L, telnet escape | |
| Dangerous Command Gate | Blocks rm -rf, DROP TABLE, `curl\ | sh` - requires confirmation |
| OSC 133 Shell Integration | Auto-detects command boundaries and exit codes | |
| Smart Truncation | Four strategies to prevent context overflow | |
| Secret Input | Send passwords without logging | |
| Dynamic Resize | Resize terminal on the fly with SIGWINCH | |
| Idle Cleanup | Auto-closes idle sessions | |
| Cross-Platform | Linux, macOS, and Windows support |
terminal-mcp exposes 9 MCP tools. Full details in docs/tools.md.
| Tool | Purpose |
|---|---|
session_create | Spawn a persistent terminal session |
session_send | Send text, keys, or control characters |
session_read | Read output (stream, snapshot, auto, diff modes) |
session_interact | Send + read in one call |
session_wait_for | Wait for regex pattern in output |
session_exec | One-shot command execution |
session_close | Close a session gracefully |
session_resize | Resize terminal dimensions |
session_list | List active sessions |
flowchart LR
Client[AI Client] -->|MCP JSON-RPC| Server[terminal-mcp] Server --> SM[Session Manager] SM --> S1[PTY 1: bash] SM --> S2[PTY 2: python3] SM --> S3[PTY 3: ssh user@host] S1 & S2 & S3 -.->|PTY output| Reader[Reader Thread] Reader -.->|buffer| Server
Each session is backed by a real PTY via pexpect.spawn (or PopenSpawn on Windows). For full architecture details, see docs/architecture.md.
All settings configurable via TERMINAL_MCP_* environment variables. Full reference in docs/configuration.md.
| Setting | Env Var | Default |
|---|---|---|
| Max sessions | TERMINAL_MCP_MAX_SESSIONS | 10 |
| Idle timeout | TERMINAL_MCP_IDLE_TIMEOUT | 1800 (30 min) |
| Safety gate | TERMINAL_MCP_SAFETY_GATE | on |
| Buffer cap | TERMINAL_MCP_MAX_BUFFER_BYTES | 1000000 (1MB) |
| Truncation | TERMINAL_MCP_TRUNCATION_MODE | tail |
Example with custom settings:
{
"mcpServers": { "terminal": { "command": "uvx", "args": ["terminal-mcp"], "env": { "TERMINAL_MCP_MAX_SESSIONS": "20", "TERMINAL_MCP_IDLE_TIMEOUT": "3600", "TERMINAL_MCP_TRUNCATION_MODE": "head_tail" } } } }
| Document | Description |
|---|---|
| Tools Reference | Complete API for all 9 MCP tools |
| Architecture | How terminal-mcp works under the hood |
| Configuration | All settings and environment variables |
| Safety & Security | Dangerous command detection and safety gate |
| Use Cases & Examples | Real-world recipes and patterns |
| Changelog | Version history and release notes |
| Contributing | How to contribute |
| Client | Status | Install |
|---|---|---|
| Claude Code (CLI) | Supported | ~/.claude.json or .mcp.json |
| Claude Desktop | Supported | One-click install |
| VS Code (Copilot Chat) | Supported | One-click install or .vscode/mcp.json |
| Cursor | Supported | One-click install or Settings |
| Windsurf | Supported | ~/.codeium/windsurf/mcp_config.json |
pip install -e ".[dev]"
pytest tests/ -v
Contributions welcome! See docs/contributing.md for guidelines.
MIT