
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 程式。