
Interactive Terminal
io.github.amol21p由 GitHub 账号 amol21p 发布v1.0.7更新于 Oct 27, 2026
MCP server for real interactive terminal sessions — REPLs, SSH, databases, Docker
发布方自己的服务:Terminal Tax
概览
本地 MCP 服务器,为助手提供真正的交互式终端会话(REPL、SSH、数据库客户端、Docker),并返回干净的文本输出。
- 可以做什么
- 创建、列出和关闭交互式终端会话,可运行 bash、python3、psql、ssh、docker exec 等任意命令
- 向会话发送输入并取回输出,自动判断命令是否执行完毕
- 只读地查看当前终端屏幕内容
- 发送 ctrl+c、ctrl+d、tab、escape、方向键等控制字符
- 在给出理由后确认并执行被判定为危险的命令
- 适用场景
- 适合助手需要驱动依赖实时终端的程序时使用,例如 REPL、数据库客户端、SSH 会话、容器内 shell 或无法用一次性命令工具处理的长时 CLI。它属于本地开发工具,适用于开发者机器上的编码助手,而非远程或共享部署。
- 运行要求
- 以 stdio 方式在本地运行,通常通过 npx 启动,需要 Node.js 18 或更高版本。完整终端模拟依赖原生模块 node-pty 和构建工具,缺失时会退回到较简单的管道模式。可选环境变量用于配置会话上限、命令允许/阻止列表、允许路径、敏感信息脱敏、空闲超时、审计日志和沙箱。
安装
在 SourceWeft 中
- 打开 控制台中的 Interactive Terminal,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-interactive-terminal
[npm version] [License: MIT] [Node.js >= 18]
MCP server that gives AI agents (Claude Code, Cursor, Windsurf, etc.) real interactive terminal sessions. Run REPLs, SSH, database clients, and any interactive CLI — with clean text output, smart completion detection, and 7-layer security.
Why This Exists
AI coding agents can't handle interactive commands. There's no PTY, no stdin streaming. You can't run rails console, python, psql, ssh, or any REPL through them. This MCP server fixes that.
Install
Claude Code
That's it. The server is now available. Ask Claude to "open a python REPL and calculate 2**100".
Cursor
Go to Settings > MCP Servers, click Add Server, and enter:
Windsurf
Add to your MCP configuration:
VS Code (GitHub Copilot)
Add to your .vscode/mcp.json:
Any MCP Client
The server communicates over stdio using the Model Context Protocol. Any MCP-compatible client can use it with the same npx -y mcp-interactive-terminal command.
Real-World Examples
Rails Console
Python REPL
Database Client
SSH
Docker
Node.js REPL
Tools
The server exposes 7 MCP tools:
create_session — Spawn an interactive process
send_command — Send input and get output
Dangerous commands (rm -rf, DROP TABLE, curl|bash, etc.) are blocked — the agent must use confirm_dangerous_command first.
read_output — Read terminal screen (read-only)
Safe to auto-approve — this only reads, never sends input.
list_sessions — List active sessions (read-only)
Safe to auto-approve.
close_session — Kill a session
send_control — Send control characters
Supported: ctrl+c, ctrl+d, ctrl+z, ctrl+l, ctrl+r, tab, escape, up, down, left, right, enter, backspace, delete, home, end, and more.
confirm_dangerous_command — Two-step safety confirmation
Required when send_command detects a dangerous pattern. The agent must explain why the command is necessary. This is a separate tool — even if send_command is auto-approved, this requires its own permission.
How It Works
Two Terminal Modes
PTY mode (default) — uses node-pty + @xterm/headless (the same terminal emulator as VS Code):
- Clean output — the AI sees exactly what a human would see on screen
- Cursor positioning, progress bars,
\roverwrites all render correctly - Full keyboard: arrow keys, tab completion, ctrl+c/d/z, home/end
- Terminal resize, TUI apps (vim, htop, top), 256-color, 1000-line scrollback
Pipe mode (automatic fallback) — activates when node-pty can't load (e.g., in sandboxed environments):
- Interactive sessions still work via
child_process.spawnwith auto-injected flags (python -u -i,bash -i, etc.) - ANSI codes stripped, control keys still work
- No terminal emulation, but covers the basics
The mode is selected automatically — PTY is tried first, pipe mode kicks in if it fails.
What the AI sees: PTY vs Pipe
Smart "Command Done" Detection
Instead of blindly waiting a fixed time, the server uses a layered strategy:
- Process exit — if the process died, command is done
- Prompt detection — auto-detects the session's prompt at startup (bash
$, python>>>, psql#, etc.), watches for it to reappear - Output settling — no new output for 300ms = probably done
- Timeout — always returns after
timeout_mswithis_complete: false
Security
Seven-layer defense-in-depth:
Recommended Permissions
Only auto-approve the read-only tools:
This way send_command, create_session, and especially confirm_dangerous_command always require human approval.
Configuration
All settings via environment variables. Pass them in your MCP config:
Troubleshooting
"Tools not showing up" / Server fails silently
MCP servers that fail to start often show no error in the client. Check:
Node.js version too old
The server requires Node.js >= 18. If you see errors about unsupported syntax or missing APIs:
For nvm/volta/fnm users: npx may use a different Node version than your shell. Use an absolute path:
Find your path with: which npx
node-pty compilation errors
node-pty is a native module that requires build tools. If it fails to compile, the server automatically falls back to pipe mode — interactive sessions still work, just without terminal emulation.
If you want full PTY support:
Session dies immediately
Some commands need to be run inside a shell rather than directly:
This is because create_session runs the command directly (like exec), not through a shell. Spawning bash first gives you a full shell environment.
Output looks garbled
If output contains escape codes or looks wrong, you're likely in pipe mode (node-pty failed to load). Check the server logs for "falling back to pipe mode". Install build tools (see above) to enable PTY mode.
Timeout too short for long-running commands
Increase the timeout per-command:
Or globally via environment variable:
Comparison with Alternatives
Development
Test with MCP Inspector:
License
MIT
来源:README.md,提交 6f2e6aa
工具
0版本历史
1- v1.0.7最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Terminal 集成

Terminal Tax
tax.terminal官方发布者
托管式报税服务器:让助手提交美国联邦 2025 年个人报税表的事实,由服务计算并校验,再返回私人签署链接。
Terminal
mn.dta官方发布者
面向蒙古国宏观与市场数据档案的远程 MCP 服务器,让助手搜索序列、获取面板并核验带签名的观测数据。
SCRIPTMASTERLABS — Quant Terminal
com.scriptmasterlabs
远程 MCP 端点,提供基于真实数据的股票代码价位与“squeeze-mirror”预测,用于量化交易分析。

Terminal 7
由 GitHub 账号 LinkMarine777 发布
Solana 上 stonkfun 币的信号、评分和支付数据,供机器人和 AI 代理使用。AI 翻译
terminal-use
由 GitHub 账号 computer-agent-labs 发布
让 AI 助手操作本机真实终端会话:输入文字、按键、点击、读取屏幕并截图,包括全屏 TUI 程序。