terminal_start
Start a terminal session. Auto-detects shell if omitted.
cwdenvcolsnamerowsshell
io.github.pungggi由 GitHub 账号 pungggi 发布v1.2.42更新于 Nov 3, 2026
MCP PTY server providing AI agents with real interactive terminal access
发布方自己的服务:Terminal Tax
为 AI 助手提供持久、可交互的 PTY 终端会话,用于执行命令、发送按键并读取输出。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
参照 仓库 中的启动说明。
[Smithery] [Official Registry]
A PTY-based MCP server with strong Windows support, giving MCP-capable AI clients and their agents persistent, interactive shell access via pseudo-terminals (node-pty).
Unlike simple exec-based approaches, this keeps PTY-backed shell sessions alive across steps, with bidirectional communication for interactive CLI tools, incremental reads, and session state that carries forward.
See the Changelog for recent updates.
Install this if you want a more consistent terminal workflow across AI clients, instead of relying on whatever built-in terminal behavior a single client happens to provide.
This MCP is most useful when you want:
terminal_wait, terminal_retry, terminal_run_paged, and terminal_get_history are easier to reuse across teams and clients, with less lock-in to one client's terminal behavior.vim, npm prompts, or interactive installers that often hang on standard piped stdin. Support full interactive sessions with REPLs, Ctrl+C, arrow keys, and dynamic prompts.If your AI client already provides a stable, stateful, interactive terminal with good output handling, you may not need this MCP for basic command execution. The main reason to add it is to make terminal-driven workflows more explicit, reusable, and portable across clients.
Think of this as a controlled keyboard + terminal for an agent running inside an MCP client. It opens a persistent PTY-backed shell session so the agent can send commands and keystrokes, read output, and continue working in the same session.
terminal_exec uses unique markers so it can tell when a command has finished.terminal_exec reports the current folder after each command.terminal_write + terminal_read support prompts, REPLs, and other interactive programs without leaving the current session.terminal_read accepts a since byte position to return only new output since the last read, avoiding re-reading the full buffer on every poll.terminal_wait can pause until specific text appears, such as server listening on port.terminal_watch waits for trigger patterns in session output, returning only on match, quiet, timeout, or exit. Eliminates poll-loop token waste.terminal_exec can return early when output goes silent (quietExitMs), instead of waiting for a hard timeout.terminal_retry can re-run flaky commands with bounded backoff and optional output matching.terminal_exec / terminal_wait calls can emit notifications/progress when the client provides a progress token.terminal_exec and terminal_read shorten very large output by returning the beginning and the end.terminal_run_paged returns large read-only output one page at a time instead of sending the full result at once.terminal_diff compares two command results and returns a unified diff.terminal_stop can capture a tail snapshot or write a full transcript to disk before stopping.terminal_run executes binaries directly with cmd + args and shell=false for more predictable automation.GIT_PAGER=cat, PAGER=cat), suppresses PowerShell progress output, and sets UTF-8 for cmd.exe on Windows.terminal_stop kills the entire process group on Unix, preventing orphan child processes.calm-reef).pwsh.exe > powershell.exe > cmd.exe. Linux/macOS: $SHELL > bash > sh.Progress notifications are not the same as full stdout streaming. They currently send periodic status updates for terminal_exec and terminal_wait, usually based on elapsed time and the latest output line. Whether you see them depends on your MCP client.
This MCP does not magically compress terminal output, but it can help agents use fewer tokens in terminal-heavy workflows by returning smaller, more targeted responses and making it easier to revisit output only when needed.
The main benefit is model-context efficiency, not guaranteed savings in the underlying command's runtime or total bytes produced.
terminal_read({ since }) to read incrementally. Each call returns only new output since the last position, instead of re-reading the full buffer. Reduces token usage by up to ~87% on repeated polling.terminal_watch instead of a manual poll loop when waiting for a specific pattern. A single call returns on match, quiet, timeout, or exit — reduces token usage by up to ~99% for log-watching workflows.terminal_exec({ quietExitMs }) for long-running commands (dev servers, watchers) that never produce a completion marker. Returns early when output stops, instead of waiting for a hard timeout. Reduces token usage by up to ~94%.terminal_run_paged for large read-only output when the agent wants one page of the returned result at a time.maxLines, pageSize, or tailLines when the agent only needs a narrow slice of the output.summary: true or parseOnly: true with terminal_run when the agent benefits more from structured results than raw text.terminal_wait({ returnMode: "match-only" }) when the agent only needs to know whether a pattern appeared.terminal_get_history when the agent needs to revisit earlier output without re-dumping the whole session into the conversation.terminal_stop({ transcriptPath }) to offload large session history to disk instead of returning it in the response.In practice, this lets agents inspect terminal state more selectively instead of repeatedly dumping large logs back into the conversation.
By default, the 8 most-used tools are registered with full schemas and 8 convenience tools are collected behind a single lightweight terminal_extra meta-tool (~30 tokens instead of ~1,700).
Default core tools: terminal_start, terminal_exec, terminal_run, terminal_read, terminal_write, terminal_wait, terminal_stop, terminal_list
Default extra tools (behind terminal_extra): terminal_run_paged, terminal_retry, terminal_diff, terminal_resize, terminal_send_key, terminal_get_history, terminal_write_file, terminal_watch
Extra tools are not hidden — the agent sees the tool names in the terminal_extra description and can:
terminal_extra({ list: true }) → returns full parameter schemasterminal_extra({ tool: "terminal_resize", args: { sessionId: "...", cols: 200, rows: 50 } })Use SMART_TERMINAL_DISABLED_TOOLS to customize which tools are extra, or set it to an empty string to register all 15 tools with full schemas:
All tools with full schemas (no meta-tool):
Minimal setup — only terminal_exec for simple command execution:
5 core tools + terminal_extra holding 9 tools on demand.
Agent-focused setup -- terminal_run instead of terminal_exec:
7 core tools + terminal_extra holding 9 tools on demand.
Recommended: run the stable release directly via npx:
Or install globally:
Or clone for development:
Set SMART_TERMINAL_SHELL to a shell name or absolute path to pin the shell used by terminal_start when its shell parameter is omitted. This keeps command syntax and startup behavior consistent across MCP clients and server restarts.
Shell selection follows this precedence:
terminal_start({ shell }) overrides environment settings.SMART_TERMINAL_SHELL applies on Windows, Linux, and macOS.PWSH_PATH remains available on Windows.An unavailable SMART_TERMINAL_SHELL value is ignored, allowing legacy or platform detection to continue.
Startup arguments match the selected shell:
pwsh / powershell): Explicit and pinned sessions start with -NoLogo -NoProfile. Windows auto-detection uses the same flags.cmd, bash, zsh, fish, and sh start without added arguments.This prevents PowerShell profiles, aliases, and prompt customization from changing automation behavior between machines.
Add to your claude_desktop_config.json:
Add to your Augment MCP settings:
If you want to pin an exact release instead of following the stable tag, replace @stable with a version such as @1.0.1.
By default, 8 core tools are registered with full schemas and 8 convenience tools are available on demand via terminal_extra (see Reducing tool definition overhead).
terminal_startStart a new interactive terminal session.
Returns: sessionId, shell, shellType, cwd, banner
terminal_execExecute a command with deterministic completion detection. Large outputs are truncated to head + tail based on maxLines. If the MCP client sends a progressToken, long-running calls may also emit best-effort notifications/progress updates.
Returns: output, exitCode, cwd, timedOut, optional quietExited, optional hint
terminal_runRun a one-shot non-interactive command using cmd + args. The default shell=false is safer than terminal_exec for predictable automation. Output is capped by maxOutputBytes rather than head + tail truncation. Shell built-ins such as dir or cd require shell=true.
With shell=true, the command runs through %ComSpec% (cmd.exe) on Windows and /bin/sh on other platforms. It does not use the session shell or SMART_TERMINAL_SHELL. This distinction prevents accidentally reusing PowerShell session syntax in a one-shot cmd.exe command.
On Windows, terminal_run resolves PATH/PATHEXT and launches .cmd / .bat wrappers via cmd.exe when needed. Prefer passing the target executable directly as cmd instead of wrapping it in powershell -Command or cmd /c, especially when Windows paths contain spaces.
For tools that always exit 0, you can require a specific exit code and/or validate a success regex against a file written by the command.
Returns: ok, cmd, args, cwd, exitCode, timedOut, durationMs, stdout.raw, stdout.parsed, optional stdout.summary, stderr.raw, optional checks, optional hint
terminal_writeWrite raw data to a terminal (for interactive programs). Follow with terminal_read.
terminal_readRead buffered output with idle detection. Large outputs are truncated to head + tail based on maxLines. Pass since to read incrementally — returns only output emitted after the given byte position.
Returns: output, timedOut, position, optional truncated
terminal_waitWait for a specific pattern in the output stream. Only output produced after the call is matched by default — the echoed command line (which contains any pattern you typed, completion markers included) never triggers a match, including an echo that is still streaming in when the wait starts (written input is remembered and masked until its echo arrives or mismatches). Pass since (a position captured earlier from terminal_read/terminal_wait/terminal_watch) to also scan retained history from that point; a since beyond the current stream end acts as a future cursor (live data before it is skipped). By default, responses return only the last tailLines; use returnMode: "full" for the full matched output or "match-only" to suppress output entirely. If the MCP client sends a progressToken, long-running waits may also emit best-effort notifications/progress updates.
Returns: output, matched, timedOut, position (output may be empty in match-only mode)
terminal_stopStop and clean up a terminal session. Optionally capture a snapshot of recent output or write the full transcript to disk before stopping. On Unix, kills the entire process group to prevent orphan child processes.
Returns: success, message, optional snapshot, optional transcript
terminal_listList all active terminal sessions.
Returns: sessions, count (verbose: false returns id, name, cwd, alive, busy only)
terminal_extra)The following tools are available by default through the terminal_extra meta-tool. The agent can discover their schemas via terminal_extra({ list: true }) and call them via terminal_extra({ tool: "<name>", args: { ... } }).
terminal_extraMeta-tool for discovering and calling extra tools.
terminal_send_keySend a named special key.
Supported keys: ctrl+c, ctrl+d, ctrl+z, ctrl+l, ctrl+a, ctrl+e, ctrl+u, ctrl+k, ctrl+w, tab, enter, escape, up, down, left, right, home, end, pageup, pagedown, backspace, delete, f1-f12
terminal_run_pagedRun a read-only one-shot command using cmd + args with shell=false and return a single page of stdout lines from the captured output. This pages the returned result instead of using head + tail truncation. Paged mode does not parse partial output, but it can return a concise summary for supported read-only commands when summary: true.
Returns: Same envelope as terminal_run, plus pageInfo.page, pageInfo.pageSize, pageInfo.totalLines, pageInfo.hasNext
terminal_get_historyRetrieve past terminal output without consuming it. Non-destructive — returns historical output from a rolling buffer (last ~10,000 lines). Useful for reviewing output that was already read or missed.
Returns: lines or text, plus totalLines, returnedFrom, returnedTo
terminal_retryRetry a command in the same terminal session until it succeeds or retries are exhausted.
Returns: success, attempts, lastResult, history
terminal_diffRun two commands in the same terminal session and return a bounded unified diff of their outputs.
Returns: resultA, resultB, diff, identical
terminal_resizeResize terminal dimensions.
terminal_write_fileWrite content directly to a file on disk. Resolves paths relative to the session's CWD. Safer and more robust than piping content through echo — handles special characters, newlines, and large files correctly.
Returns: success, path (absolute), size (bytes), append
terminal_watchWait for one or more trigger patterns in session output. Returns on first match, quiet detection, timeout, or process exit. Replaces manual poll loops — a single call blocks until an event fires.
Trigger object:
Returns: reason (trigger/quiet/timeout/exit), position, timedOut, optional triggerId, matchedLine, context
For Windows tools installed under Program Files, prefer this shape over powershell -Command:
For compilers that only report success in a log file:
terminal_run currently parses a small set of read-only command signatures:
git log --onelinegit log --oneline -n <count>git status --porcelain=v1 --branchgit status --short --branchgit status --shortgit branchgit branch --all / git branch --remotesgit branch -vvgit branch --show-currentgit rev-parse --abbrev-ref HEADgit rev-parse --show-toplevelgit rev-parse --is-inside-work-treegit diff --name-onlygit diff --name-statusgit diff --statgit diff --shortstatgit ls-filesgit remote -vtasklist /fo csv /nhwhere <name> / which <name>Set parseOnly: true to omit stdout.raw when a supported parser succeeds. Unsupported commands still return stdout.raw; stdout.parsed is null.
Set summary: true to return stdout.summary and suppress stdout.raw for supported command signatures. If no summary is available, raw stdout is preserved.
terminal_run_paged supports summary: true for read-only commands: git (branch, diff, log, ls-files, remote, rev-parse, status), tasklist, where, and which.
When parsing was requested but no parser matched, terminal_run may include a short hint for parser-worthy command signatures with larger raw output:
git plus where / whichstdout.raw is large enough to be worth suggestingStructured parser unavailable for this command signature. If you need this often, propose one.MIT
来源:README.md,提交 6345fd1
Start a terminal session. Auto-detects shell if omitted.
cwdenvcolsnamerowsshellRun a command in a session and wait for completion.
command必填timeoutmaxLinessessionId必填descriptionquietExitMsmaxOutputBytesminOutputBytesRun directly. shell=true uses OS shell, not the session shell.
cmd必填cwdargsparseshellsummarytimeoutparseOnlydescriptionsuccessFilemaxOutputBytessuccessExitCode另有 1 个Write raw data to a terminal session.
data必填sessionId必填Read new output from a terminal session.
sincetimeoutmaxLinessessionId必填idleTimeoutWait for a pattern in NEW output; echoed input never matches.
sincepattern必填timeoutsessionId必填tailLinesreturnModeStart a long-running command as a tracked background job.
cwdenvcommand必填timeoutwaitFormaxLinesRead output from, wait for, or stop a background job.
jobId必填sinceactiontimeoutmaxLinesStop a terminal session.
sessionId必填snapshotLinestranscriptPathList active terminal sessions and background jobs.
verbose8 more tools: terminal_run_paged, terminal_get_history, terminal_resize, terminal_send_key, terminal_watch, terminal_retry, terminal_diff, terminal_write_file. list=true for full schemas, or pass tool + args to call.
argslisttool已满足适用检查项的 80%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
请在仓库或注册中心条目中声明许可证。

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

由 GitHub 账号 LinkMarine777 发布
Solana 上 stonkfun 币的信号、评分和支付数据,供机器人和 AI 代理使用。AI 翻译
由 GitHub 账号 computer-agent-labs 发布
让 AI 助手操作本机真实终端会话:输入文字、按键、点击、读取屏幕并截图,包括全屏 TUI 程序。
{ "mcpServers": { "smart-terminal": { "command": "npx", "args": ["-y", "smart-terminal-mcp@stable"], "env": { "SMART_TERMINAL_DISABLED_TOOLS": "" } } }}"env": { "SMART_TERMINAL_DISABLED_TOOLS": "terminal_run,terminal_run_paged,terminal_retry,terminal_diff,terminal_write_file,terminal_resize,terminal_send_key,terminal_get_history,terminal_watch"}"env": { "SMART_TERMINAL_DISABLED_TOOLS": "terminal_exec,terminal_diff,terminal_retry,terminal_resize,terminal_send_key,terminal_write,terminal_read,terminal_get_history,terminal_watch"}npx smart-terminal-mcp@stablenpm install -g smart-terminal-mcpgit clone <repo-url>cd smart-terminal-mcpnpm install"env": { "SMART_TERMINAL_SHELL": "pwsh"}{ "mcpServers": { "smart-terminal": { "command": "npx", "args": ["-y", "smart-terminal-mcp@stable"] } }}claude mcp add smart-terminal -- npx -y smart-terminal-mcp@stable{ "mcpServers": { "Smart Terminal": { "command": "npx", "args": [ "smart-terminal-mcp@stable" ] } }}terminal_start() -> { sessionId: "calm-reef" }terminal_exec({ sessionId, command: "ls -la" }) -> { output: "...", exitCode: 0, cwd: "/home/user" }terminal_run({ cmd: "git", args: ["status", "--porcelain=v1", "--branch"] })-> { ok: true, stdout: { raw: "...", parsed: { branch: {...}, staged: [], modified: [], untracked: [] } } }terminal_run({ cmd: "C:\\Program Files\\Vendor\\Tool.exe", args: ["/flag:value", "/other"] })terminal_run({ cmd: "C:\\Program Files\\Vendor\\Tool.exe", args: ["/compile:script.mq5", "/log:build.log"], successFile: "build.log", successFilePattern: "0 error"})terminal_run_paged({ cmd: "git", args: ["log", "--oneline"], page: 0, pageSize: 100 })-> { ok: true, stdout: { raw: "...", parsed: null }, pageInfo: { totalLines: 120, hasNext: true } }terminal_start({ name: "python" })terminal_write({ sessionId, data: "python3\r" })terminal_read({ sessionId }) -> Python bannerterminal_write({ sessionId, data: "2 + 2\r" })terminal_read({ sessionId }) -> "4"terminal_send_key({ sessionId, key: "ctrl+d" }) -> exit Pythonterminal_start({ name: "dev-server" })terminal_write({ sessionId, data: "npm run dev\r" })terminal_wait({ sessionId, pattern: "listening on port", timeout: 60000 })terminal_wait({ sessionId, pattern: "listening on port", returnMode: "full" })terminal_extra({ tool: "terminal_watch", args: { sessionId, triggers: [ { id: "success", pattern: "webpack: Compiled successfully" }, { id: "error", pattern: "ERROR in" } ], timeout: 120000, quietExitMs: 10000}})-> { reason: "trigger", triggerId: "success", matchedLine: "webpack: Compiled successfully", context: [...], position: 184320 }const r1 = terminal_read({ sessionId }) -> { output: "Building...", position: 5000 }const r2 = terminal_read({ sessionId, since: 5000 }) -> { output: "Done.", position: 5200 }terminal_exec({ sessionId, command: "npm run dev", quietExitMs: 3000, minOutputBytes: 50 })-> { output: "webpack: Compiled successfully", quietExited: true, hint: "Command is still running..." }terminal_stop({ sessionId, snapshotLines: 20, transcriptPath: "/tmp/session.log" })-> { success: true, snapshot: { text: "...", lineCount: 20, totalLines: 500 }, transcript: { path: "/tmp/session.log", bytes: 12345 } }terminal_retry({ sessionId, command: "npm test", maxRetries: 2, backoff: "fixed", delayMs: 1000 })-> { success: true, attempts: 2, lastResult: { output: "...", exitCode: 0, cwd: "...", timedOut: false } }terminal_diff({ sessionId, commandA: "git show HEAD~1:README.md", commandB: "type README.md" })-> { identical: false, diff: "--- git show HEAD~1:README.md\n+++ type README.md\n@@ @@\n..." }src/ index.js Entry point, server bootstrap, graceful shutdown tools.js MCP tool registrations with Zod schemas command-runner.js One-shot non-interactive command execution (shell=false) command-parsers.js Structured parsers for supported read-only commands pager.js Line-based pagination helper for large stdout pty-session.js PTY session: marker injection, idle read, buffer mgmt smart-tools.js Retry and diff helpers for higher-level terminal tools regex-utils.js Shared user-regex validation and compilation session-id.js Human-readable session ID generation session-manager.js Session lifecycle, TTL cleanup, concurrency limits shell-detector.js Cross-platform shell auto-detection ansi.js ANSI escape code stripping