Skip to main content
Glama
mkpvishnu

terminal-mcp

by mkpvishnu

问题所在

每个 AI 编码工具都会遇到同一个瓶颈:没有真正的终端访问权限。

Claude Code 的 Bash 工具、GitHub Copilot 和 Codex 都在隔离的子进程中运行命令。每个命令都是全新启动。没有状态可以延续。这意味着:

  • 无法使用 SSH 会话 - 无法连接到远程服务器并运行多个命令

  • 无法使用 REPL - 无法交互式地使用 Python、Node 或 Ruby 解释器

  • 无法使用数据库 CLI - 无法维持 psql、mysql 或 redis-cli 连接

  • 无法使用 TUI 应用 - 无法使用方向键导航 htop、vim 或 fzf

  • 无法运行长时间进程 - 无法监控构建、查看日志或运行开发服务器

Related MCP server: Interactive Terminal MCP Server

解决方案

terminal-mcp 为 AI 代理提供了一个真正的终端。持久化的 PTY 会话可以在工具调用之间保持存活。发送命令、读取输出、按下按键、导航 TUI——就像人类在终端前操作一样。

uvx terminal-mcp

一条命令。适用于 Claude Code、Claude Desktop、VS Code、Cursor 和 Windsurf。


快速开始

1. 安装(30 秒)

# No install needed - run directly
uvx terminal-mcp

# Or install globally
pip install terminal-mcp

2. 连接到你的 AI 客户端

添加到 ~/.claude.json 或项目 .mcp.json:

{
  "mcpServers": {
    "terminal": {
      "command": "uvx",
      "args": ["terminal-mcp"]
    }
  }
}

添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "terminal": {
      "command": "uvx",
      "args": ["terminal-mcp"]
    }
  }
}

点击上方的一键安装徽章,或添加到 .vscode/mcp.json:

{
  "servers": {
    "terminal-mcp": {
      "command": "uvx",
      "args": ["terminal-mcp"]
    }
  }
}

添加到 ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "terminal": {
      "command": "uvx",
      "args": ["terminal-mcp"]
    }
  }
}

3. 验证

session_exec  exec="echo hello from terminal-mcp"

你能用它做什么?

SSH 连接到远程服务器

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"

运行交互式 REPL

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"

导航 TUI 应用

session_create   command="htop"  label="monitor"
session_read     session_id="a1b2c3d4"
# Auto-detects TUI, returns screen snapshot

session_send     session_id="a1b2c3d4"  key="F6"
session_read     session_id="a1b2c3d4"  mode="diff"
# Returns only changed lines - saves tokens

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

功能一览

功能

作用

持久化会话

真正的 PTY 会话,可在工具调用之间保持存活

一次调用完成发送 + 读取

session_interact 将 LLM 往返次数减半

基于模式的读取

wait_for 会阻塞直到正则匹配 - 无需猜测超时时间

自动 TUI 检测

检测 htop、vim 等,并自动切换到屏幕快照模式

输出差异模式

仅返回变化的屏幕行 - 最小化 token 消耗

特殊按键

方向键、Tab、F1-F12、Home/End、Page Up/Down

控制字符

Ctrl-C、Ctrl-D、Ctrl-Z、Ctrl-L、telnet 转义

危险命令防护

阻止 rm -rf、DROP TABLE、curl|sh - 需要确认

OSC 133 Shell 集成

自动检测命令边界和退出码

智能截断

四种策略防止上下文溢出

秘密输入

发送密码而不记录日志

动态调整大小

通过 SIGWINCH 动态调整终端大小

空闲清理

自动关闭空闲会话

跨平台

支持 Linux、macOS 和 Windows


工具参考

terminal-mcp 暴露了 9 个 MCP 工具。完整详情见 docs/tools.md。

工具

用途

session_create

生成一个持久化终端会话

session_send

发送文本、按键或控制字符

session_read

读取输出(流、快照、自动、差异模式)

session_interact

一次调用完成发送 + 读取

session_wait_for

等待输出中出现正则模式

session_exec

一次性命令执行

session_close

优雅关闭会话

session_resize

调整终端尺寸

session_list

列出活动会话


架构

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

每个会话都由一个通过 pexpect.spawn(Windows 上为 PopenSpawn)实现的真实 PTY 支持。有关完整架构详情,请参阅 docs/architecture.md。


配置

所有设置均可通过 TERMINAL_MCP_* 环境变量配置。完整参考见 docs/configuration.md。

设置

环境变量

默认值

最大会话数

TERMINAL_MCP_MAX_SESSIONS

10

空闲超时

TERMINAL_MCP_IDLE_TIMEOUT

1800(30 分钟)

安全防护

TERMINAL_MCP_SAFETY_GATE

on

缓冲区上限

TERMINAL_MCP_MAX_BUFFER_BYTES

1000000(1MB)

截断模式

TERMINAL_MCP_TRUNCATION_MODE

tail

自定义设置示例:

{
  "mcpServers": {
    "terminal": {
      "command": "uvx",
      "args": ["terminal-mcp"],
      "env": {
        "TERMINAL_MCP_MAX_SESSIONS": "20",
        "TERMINAL_MCP_IDLE_TIMEOUT": "3600",
        "TERMINAL_MCP_TRUNCATION_MODE": "head_tail"
      }
    }
  }
}

文档

文档

描述

工具参考

所有 9 个 MCP 工具的完整 API

架构

terminal-mcp 的工作原理

配置

所有设置和环境变量

安全与防护

危险命令检测和安全防护

用例与示例

实际应用场景和模式

更新日志

版本历史和发布说明

贡献指南

如何贡献


支持的客户端

客户端

状态

安装

Claude Code(CLI)

支持

~/.claude.json 或 .mcp.json

Claude Desktop

支持

一键安装

VS Code(Copilot Chat)

支持

一键安装 或 .vscode/mcp.json

Cursor

支持

一键安装 或设置

Windsurf

支持

~/.codeium/windsurf/mcp_config.json


运行测试

pip install -e ".[dev]"
pytest tests/ -v

贡献

欢迎贡献!请参阅 docs/contributing.md 了解指南。

许可证

MIT

Available Tools

9 tools
session_closeA

Terminate a session gracefully. Sends EOF, then SIGHUP, then SIGKILL.

ParametersJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID to close

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It explicitly discloses the escalation strategy (sends EOF, then SIGHUP, then SIGKILL), which goes beyond a simple 'terminate' and informs the agent about potential forceful behavior. This is valuable context for an AI agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—two sentences, no filler. Every word serves a purpose, and the critical behavioral detail is front-loaded. It achieves maximum clarity with minimal text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one required parameter and no output schema, the description adequately covers the core behavior. A minor gap is the lack of information about the return value or error states, but given the tool's simplicity, it is substantially complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%; the schema already describes the only parameter ('Session ID to close'). The description adds no additional meaning or usage constraints for this parameter, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Terminate') and the resource ('a session'). The details on the termination sequence (EOF, SIGHUP, SIGKILL) differentiate it from sibling tools like session_resize, session_list, etc., making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (e.g., session_interact, session_exec). There is no mention of prerequisites or conditions under which closing is appropriate. The description only states what it does, not when to choose it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_createA

Spawn a persistent PTY terminal session. Returns a session_id used by all other session_* tools. Supports interactive shells, SSH, REPLs, and database CLIs. Snapshot mode is always available.

ParametersJSON Schema
NameRequiredDescriptionDefault
colsNoTerminal width in columns
rowsNoTerminal height in rows
labelNoHuman-readable label for the session
commandYesShell command to run (e.g. 'bash', 'python3', 'ssh user@host')
idle_timeoutNoSeconds before auto-closing idle session
enable_snapshotNoDeprecated: snapshot is now always enabled. Kept for backward compatibility.
scrollback_linesNoNumber of scrollback history lines to keep

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the persistent nature of the session and that snapshot mode is always available, which are key behavioral traits. It could add details about resource usage or cleanup requirements, but the disclosed info is sufficient for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at two sentences, but the second sentence could be streamlined (e.g., 'Supports interactive shells, SSH, REPLs, and database CLIs.' is a bit broad). Overall, every sentence contributes meaning without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (7 parameters, no output schema) and the lack of annotations, the description provides a solid understanding of what the tool does and the returned session_id. It could be more complete by noting that the session persists until explicitly closed or the idle_timeout expires, and that commands are executed in a new terminal environment. However, the given info is mostly adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds value by explaining that 'enable_snapshot' is deprecated (though kept for backward compatibility) and clarifies that snapshot is always enabled. This extra context goes beyond what the schema provides, justifying a score above the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool spawns a persistent PTY terminal session and returns a session_id, which is the core purpose. It explicitly distinguishes itself from sibling tools by noting that the returned session_id is used by all other session_* tools, making the relationship to siblings clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage with examples (interactive shells, SSH, REPLs, database CLIs) and notes the session_id is used by sibling tools, implying this is the first tool to call. However, it does not explicitly state when NOT to use it (e.g., for non-interactive scripts) or mention alternatives beyond the sibling set.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_execB

Execute a command in a temporary session and return the output. The session is automatically cleaned up after execution.

ParametersJSON Schema
NameRequiredDescriptionDefault
colsNoTerminal width in columns
execYesCommand to execute in the session
rowsNoTerminal height in rows
commandNoShell to use (default: bash)bash
timeoutNoSeconds to wait for command output
truncationNoTruncation mode for output

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It states that the session is 'temporary' and 'automatically cleaned up after execution,' which tells the agent the session has a short lifecycle. However, it omits important behaviors: what happens on timeout (partial output vs. error), how truncation affects returned data, whether state is preserved between executions, or that cleanup means the session cannot be reused. Given zero annotations, more behavioral context is expected.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description consists of two sentences, totaling 20 words. It immediately states the core action and outcome, then adds one critical piece of lifecycle information. Every word earns its place with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters including enums, no output schema), the description is too sparse. An agent needs to know: what happens on timeout, the format of returned output, whether stderr is captured, and how truncation modes differ. Since there is no output schema, the description should compensate by summarizing return behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so each parameter already has a description in the schema. The tool description adds no additional semantic context beyond what the schema provides. The baseline of 3 is appropriate because the description does not explain how parameters interact (e.g., how truncation modes affect output, or that cols/rows are only meaningful for interactive programs).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute a command in a temporary session and return the output,' which specifies the action (execute), the resource (temporary session), and the result (return output). This differentiates it from sibling tools like session_send (which sends input without returning final output) and session_read (which reads existing output). The addition of 'temporary' and 'automatically cleaned up' adds valuable distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like session_interact, session_send, or session_read. It doesn't explain that this is a one-shot execution tool suitable for quick commands, while session_interact is for ongoing interaction. No prerequisites, when-not-to-use, or behavior for long-running commands is mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_interactA

Send input and read output in a single call. Combines session_send + session_read to halve round trips. Optionally waits for a regex pattern in the output.

ParametersJSON Schema
NameRequiredDescriptionDefault
keyNoSpecial key
inputNoText to send
timeoutNoSeconds to wait for output
passwordNoSecret input (not logged)
wait_forNoRegex pattern to wait for in output
confirmedNoSet to true to bypass dangerous command gate
read_modeNoRead mode for output: 'stream' (default), 'snapshot', 'auto', 'diff'
session_idYesSession ID
strip_ansiNoStrip ANSI sequences
truncationNoTruncation mode for output
press_enterNoAppend carriage return
control_charNoControl character

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the combined send+read behavior and optional wait_for, but omits key behavioral traits: the effect of the 'confirmed' parameter for bypassing dangerous command gates, how input/key/control_char interact, error handling, or what happens on timeout. The mention of halving round trips is a performance note, not a behavioral trait. The description is adequate but incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core purpose, no filler. Every word earns its place. The structure is efficient and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 12 parameters, 9 sibling tools, no output schema, and no annotations, the description is far too minimal. It does not explain parameter interactions, what the output looks like, how it relates to siblings like session_send, session_read, or session_exec, or how to handle the 'confirmed' gate. A tool of this complexity requires more context to be fully usable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds no new meaning to individual parameters—'Optionally waits for a regex pattern' restates the wait_for schema description. It does not explain inter-parameter relationships (e.g., input vs. key vs. control_char mutual exclusivity) or the implications of confirmed, read_mode, or truncation. No additional value over the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Send input and read output'), resource ('call' on a session), and distinguishes from siblings by noting it combines session_send and session_Read, halving round trips. This meets the 'specific verb+resource' criterion and differentiates from sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (when you need both send and read in one call to halve round trips) and mentions optional regex waiting, suggesting an alternative to using separate session_send, session_read, and session_wait_for. However, it does not explicitly state when not to use it or list exclusion cases, which keeps it from a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_listA

List all active terminal sessions with their status and idle time.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and clearly states the tool is read-only ('List all active terminal sessions') and specifies the output fields (status, idle time). This is sufficient for a simple listing operation, though it omits potential details like permissions or whether the list is real-time.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence of 10 words with no filler. Every word adds value: the verb, the resource, and the output specifics are all present. This is an example of ideal conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no output schema, and no annotations, the description adequately covers its purpose and return content. There are no missing pieces for the agent to understand its basic function.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters and 100% coverage, so the baseline is 4. The description adds no parameter information because none is needed; it simply describes what the tool returns without requiring any input.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') and resource ('active terminal sessions') along with the output details ('status and idle time'). This clearly distinguishes it from sibling tools like session_create, session_send, or session_read, which perform actions on individual sessions rather than merely listing them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While the description implies that this tool is used to obtain a list of active sessions (e.g., before acting on a session), it does not explicitly state when to use it versus alternatives, nor does it provide cues such as 'use this to get session IDs for other tools'. The guidance is purely implicit from the tool name and sibling context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_readA

Read output from a session. Mode 'auto' (default) auto-detects TUI applications and switches between stream and snapshot. 'diff' returns only changed screen lines.

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNoRead mode: 'auto' (default, auto-selects stream/snapshot), 'stream', 'snapshot', or 'diff'auto
timeoutNoSettle timeout in seconds (stream mode)
scrollbackNoLines of scrollback history to include (snapshot mode only)
session_idYesSession ID returned by session_create
strip_ansiNoStrip ANSI escape sequences from output
truncationNoTruncation mode: 'tail' (keep beginning), 'head_tail' (keep beginning+end), 'tail_only' (keep end), 'none' (no truncation)

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Given no annotations, the description partially discloses behavior by explaining mode auto-detection for TUI applications and diff mode returning only changed lines. However, it does not explicitly state that this is a read-only operation (non-destructive) or mention any side effects, rate limits, or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary purpose, and every clause contributes meaning. No redundant or vague phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 6 parameters (some mode-specific) and no output schema, the description is too sparse. It does not explain parameter interactions (e.g., timeout only in stream mode, scrollback only in snapshot), truncation, or return format. More detail is needed to fully guide correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining that 'auto' auto-detects TUI applications and that 'diff' returns only changed screen lines, which is not fully detailed in the schema's parameter descriptions. It does not cover other parameters but that is acceptable given schema completeness.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Read' and resource 'output from a session', defining the tool's core function. It also explains key modes ('auto', 'diff') that distinguish it from sibling tools like session_send or session_create, which handle other session operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide any guidance on when to use session_read versus alternative tools (e.g., session_list, session_interact). It only describes internal mode behavior, leaving the selection context implicit. No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_resizeA

Resize the terminal window of an active session. Sends SIGWINCH to the process.

ParametersJSON Schema
NameRequiredDescriptionDefault
colsYesNew terminal width in columns
rowsYesNew terminal height in rows
session_idYesSession ID returned by session_create

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the SIGWINCH signal sent to the process, which is a critical behavioral detail not evident from the schema. It does not mention other potential effects (e.g., screen refresh) or prerequisites, but the information given is valuable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at two short sentences. The first sentence clearly states the main action, and the second sentence adds a key behavioral detail. There is no wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple resize operation with well-documented parameters and no output schema, the description is nearly complete. It covers purpose, parameter usage (via schema), and adds the signal behavior. Minor gaps like error conditions or size limits do not significantly impair an agent's ability to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with clear parameter descriptions (e.g., 'New terminal width in columns'). The tool description only restates the overall purpose and does not add additional meaning or constraints to the parameters beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Resize' and the specific resource 'terminal window of an active session', and uniquely identifies the operation among sibling tools like session_create, session_send, etc. The additional detail about sending SIGWINCH further clarifies the mechanism.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to adjust terminal dimensions of an active session, but provides no explicit guidance on when to use this tool versus alternatives or when not to use it. However, siblings are sufficiently distinct that confusion is unlikely.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_sendA

Send input text, a control character, or a special key to an active session. Use control_char for signals (e.g. 'c' for Ctrl-C). Use key for special keys (e.g. 'up', 'tab', 'f1').

ParametersJSON Schema
NameRequiredDescriptionDefault
keyNoSpecial key to send (arrow keys, function keys, etc.)
inputNoText to send to the session
passwordNoPassword or secret to send (will not be logged)
confirmedNoSet to true to bypass dangerous command gate
session_idYesSession ID returned by session_create
press_enterNoAppend carriage return after input
control_charNoControl character to send: 'c' (SIGINT), 'd' (EOF), 'z' (SIGTSTP), 'l' (clear), ']' (telnet)

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It explains the modes of input but does not disclose critical behavioral traits such as whether sending certain inputs is destructive, what happens if the session is inactive, or the implications of the 'confirmed' parameter bypassing a dangerous command gate. The password parameter's logging note is a minor positive, but overall transparency is low.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no wasted words. The first sentence states the core purpose, and the second provides concrete usage examples for the two parameter families. Excellent front-loading of essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 7 parameters and no output schema, the description is relatively lean. It covers the three input modes but lacks explanation of the 'confirmed' parameter's role, the 'press_enter' default behavior, return value, or error conditions. While adequate for straightforward use, more details would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description adds value by mapping control_char values to signals (e.g., 'c' for Ctrl-C) and key enum values to special keys, which clarifies intent beyond the schema's enum lists. This extra context justifies a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool sends input text, control characters, or special keys to an active session. It uses a specific verb-resource pair and distinguishes the action from sibling tools like session_read or session_exec, which handle output or command execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides guidance on how to use the parameters (e.g., 'Use control_char for signals... Use key for special keys...') but does not specify when to choose this tool over alternatives like session_exec or session_interact. No explicit when-not-to-use or context for excluding other tools is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_wait_forA

Read output from a session until a regex pattern matches or timeout expires. Use this instead of session_read when you know what output to expect.

ParametersJSON Schema
NameRequiredDescriptionDefault
patternYesRegex pattern to wait for in output
timeoutNoMax seconds to wait
session_idYesSession ID
strip_ansiNoStrip ANSI escape sequences
truncationNoTruncation mode for output

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must fully disclose behavior. It does state the core mechanism (reading output, waiting for pattern or timeout). However, it lacks details on what happens on timeout (e.g., error vs partial output), whether output is returned in full or incrementally, and how parameters like truncation and strip_ansi affect the behavior. The baseline is adequate but leaves gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loading the core purpose and then adding usage guidance. Every word is informative and necessary. No redundancy or verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 parameters, no output schema, and no annotations, the description is moderately complete. It explains the tool's function and when to use it, but does not describe return values or behavior in edge cases (e.g., timeout, truncation effects). Without an output schema, the description should provide more details on what the agent can expect as output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all parameters. The description adds no extra semantic information about parameters—such as pattern format, timeout units, or truncation modes. It provides no value beyond the schema, meeting the baseline but not exceeding it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads output from a session until a regex matches or timeout expires. It also explicitly distinguishes from session_read by specifying when to use this alternative, making the purpose and differentiation very clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives direct usage guidance: 'Use this instead of session_read when you know what output to expect.' This implies the appropriate context. However, it does not explicitly mention when NOT to use (e.g., for continuous reading without a pattern) or provide scenarios for alternatives beyond session_read.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 9 tool updatesv0.4.7
    • First observedsession_close
    • First observedsession_create
    • First observedsession_exec
    • First observedsession_interact
    • First observedsession_list
    • First observedsession_read
    • First observedsession_resize
    • First observedsession_send
    • First observedsession_wait_for

TDQS

A4.1/5.0

Scored across 9 tools

Disambiguation5/5

Each tool has a clear, distinct purpose: create/list/resize/send/read/wait/interact/exec/close. Overlaps like session_read vs session_wait_for are well-differentiated by their descriptions (reading vs waiting for a pattern). No two tools could be easily confused.

Naming Consistency5/5

All tools follow a consistent 'session_verb' pattern using snake_case. Verbs are descriptive (create, list, resize, send, read, wait_for, interact, exec, close). No mixing of styles or vague names.

Tool Count5/5

Nine tools is an ideal size for a terminal session manager. Each tool serves a necessary operation without being too few or too many, covering creation, manipulation, reading, and destruction of sessions.

Completeness5/5

The tool set provides a full lifecycle for interactive terminal sessions: creation (session_create), querying (session_list), resizing, input sending (session_send), output reading (session_read, session_wait_for), combined interaction (session_interact), one-shot execution (session_exec), and cleanup (session_close). No obvious gaps.

Maintenance

ActivitySlowing
ResponsivenessSlow

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides AI agents with fully interactive terminal sessions, including TUI support, keyboard control, and screen capture across Windows, Linux, and Mac.
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables AI agents to have persistent, fully interactive SSH sessions into remote hosts, behaving like a local terminal.
    14 npm
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to securely execute terminal commands with persistent sessions, async jobs, and mission control, while providing a live dashboard for human oversight.
    4
    Apache 2.0