Skip to main content
Glama
atengk
by atengk

@atengk/mcp-server-ssh

NPM Version Release CI Status License: Apache-2.0 PRs Welcome Node.js Version TypeScript Model Context Protocol Tests

基于标准 OpenSSH 协议 深度连接与操控 Linux/Unix 系统的 Model Context Protocol (MCP) 服务。为大语言模型(LLM)和 AI 智能体(Claude Desktop、Cursor、Antigravity、Cline 等)提供安全、可控、零侵入的远程终端执行与 POSIX 文件系统管理基础设施。

💡 版本更新日志 (Release Notes):每一个正式版本的详细变动明细、修复记录与贡献者致谢均由系统自动维护,可直接前往 GitHub Releases 查看最新记录。


🌟 核心特性 (Features)

  • 🌐 零侵入标准协议直连:目标 Linux 主机仅需原生 OpenSSH 服务,绝不安装任何专有 Agent 或 HTTP 守护进程(ADR-0001)。

  • ⚡ 双模命令执行引擎(ADR-0002):

    • 无状态执行 (ssh_exec):单命令独立通道,默认包装为登录 Shell(bash -l -c)以完整继承用户环境变量与 PATH,精确捕获退出码、耗时与标准输出/错误;支持管道隐式注入凭据的 零命令行泄露安全 Sudo 提权(ADR-0011)。

    • 交互式会话 (ssh_session_*):基于 PTY 伪终端维持常驻会话流,支持流式增量回显、正则提示符监听(expectPattern)与 \x03 (Ctrl+C) 中断控制信号。

  • ⏱️ 用户态脱机解耦后台作业 (ssh_job_*):通过系统解耦技术在远端独立托管耗时脚本、大文件拉取或构建任务,支持退出码精准判定与增量日志流式追踪,连接断开任务不终止(ADR-0010)。

  • 📁 高级 POSIX SFTP 管理与流式归档:

    • 精准文本差异补丁 (sftp_patch_file):基于目标锚点块校验的局部精准替换,避免大文件全量覆写(ADR-0009);

    • 纯 JS 流式 Tar 目录双向同步 (sftp_*_dir):支持排除过滤与自动继承 .gitignore,零 C++ 原生编译依赖(ADR-0008);

    • 基础文件管理:单文件安全读写(内置防撑爆阈值)、元数据获取、目录递归建删与软链接防环保护。

  • 🔌 三位一体网络隧道治理 (ssh_forward_port):统一管控本地转发(Local)、远程暴露(Remote)与 纯 JS RFC 1928 动态 SOCKS5 代理,内置空闲超时自动熔断与物理断连级联回收(ADR-0011)。

  • 🛡️ 网络安全与网络暴露收敛(ADR-0017):

    • 常数时间 SSE 强身份鉴权:支持 Header Bearer 与 Query Token,双重 SHA-256 常数时间比对防时序攻击;

    • 默认回环与暴露强制熔断 (Fail-Closed):默认收敛绑定 127.0.0.1,外部暴露未配置 Token 立即终止启动;

    • 目标主机白名单 (Target Allowlist):支持 IP、CIDR 网段、通配符域名与端口约束,阻断内网横向跳板渗透;

    • 来源白名单与跨域重塑 (Origin Whitelist):彻底废除通配符 *,精确匹配请求来源以防御跨站攻击。

  • 🏷️ 多实例服务标识与引导指示 (--server-name / --server-instructions):协议级一等公民下发,在多服务并存时向大模型精准传递系统角色定位,工具描述自动修饰紧凑前缀(ADR-0015)。

  • 📜 全景生命周期安全审计 (AuditService):记录全量 29 个原子工具调用的调用源、入参深度凭据脱敏(密码/私钥自动打码掩饰)与执行耗时,支持纯 Node 原生免依赖多文件轮转切分(ADR-0014)。

  • 🩺 四维全景自检排障套件 (--doctor):涵盖 Runtime 运行时、本地 OpenSSH 密钥链、配置合规性与目标连通性全方位秒级诊断巡检(ADR-0013)。

  • 🛡️ 严格安全防护双保险(ADR-0003):

    • 前置安全守卫 (SafetyGuard):实时拦截全盘强删(rm -rf /)、磁盘覆写(dd/mkfs)、关机重启(reboot/shutdown)及 Fork 炸弹等致命破坏,支持 dryRun 演练。

    • 智能防爆截断 (OutputTruncator):单次输出实施 64KB 双端智能截断(保留前 8KB 标头与后 56KB 最新日志),自动清洗 ANSI 终端转义符,保护 LLM 上下文不崩溃。

  • 📦 免安装一键即用:打包为独立单文件 Bundle,全球用户通过 npx 零依赖即开即用(ADR-0004)。


Related MCP server: ssh-for-agents

🚀 快速上手 (Quick Start)

无需 git clone 或本地编译,在任何支持 MCP 的宿主客户端配置文件(如 Claude Desktop 的 claude_desktop_config.json、Cursor 的 mcp.json 或 Antigravity / Cline 对应配置)中添加如下配置即可直接启动:

通用 MCP 客户端基础配置模板

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "@atengk/mcp-server-ssh"],
      "env": {
        "MCP_SSH_HOST": "192.168.1.100",
        "MCP_SSH_PORT": "22",
        "MCP_SSH_USER": "root",
        "MCP_SSH_PRIVATE_KEY_PATH": "/Users/yourname/.ssh/id_ed25519"
      }
    }
  }
}

🔒 单一规范命名空间提示 (ADR-0012):服务严格仅识别 MCP_SSH_* 规范命名空间环境变量。布尔变量严格仅接受 "true" 或 "false"。请务必使用官方规范键名以确保配置生效。


🖥️ CLI 命令行工具与全景诊断套件 (CLI & Diagnostics)

除了作为标准 MCP stdio/SSE 服务被大模型客户端唤起外,@atengk/mcp-server-ssh 还提供完整的现代化 CLI 命令行交互能力,同时原生支持 GNU 规范长短标志(-h / --help, -v / --version, --doctor)与 POSIX 风格位置子命令(doctor, version, help),版本号动态联动 package.json 保持单一真实信源(ADR-0013)。

1. 命令行语法与选项速查

# 基本调用语法
$ mcp-server-ssh [选项]
$ mcp-server-ssh <子命令>

# 或通过 npx 零安装即时调用
$ npx @atengk/mcp-server-ssh [选项 / 子命令]

命令形态 / 选项标志

等价子命令 (Subcommand)

类型

说明与行为

-h, --help

help

布尔标志

打印包含全部 12-Factor 环境变量、29 项原子工具与快速上手范例的帮助手册并退出

-v, --version

version

布尔标志

打印当前安装与运行的服务版本号(如 v1.4.0)并退出

--doctor

doctor

布尔标志

启动四维全景自检排障套件,对运行时、密钥链、网络安全与目标连通性进行秒级诊断

--server-name <name>

(无)

字符串参数

自定义当前服务实例的唯一命名空间标识(默认: "mcp-server-ssh")

--server-instructions <text>

(无)

字符串参数

向大模型注入系统级服务角色引导指示说明(在协议握手阶段下发)

📌 参数生效优先级准则 (Precedence Invariant):
CLI 命令行长选项 (--server-name / --server-instructions) > 规范环境变量 (MCP_SSH_SERVER_NAME / MCP_SSH_SERVER_INSTRUCTIONS) > 系统内置默认值。


2. 🩺 四维全景排障自检套件 (--doctor / doctor)

在客户端配置报错、无法建连或网络拓扑受阻时,无需繁琐查看堆栈或启动完整宿主客户端,直接运行 doctor 即可在 纯只读、零副作用 的前提下秒级扫描系统健康状况:

# 运行诊断 (标志与子命令完全等价)
npx @atengk/mcp-server-ssh --doctor
# 或
npx @atengk/mcp-server-ssh doctor

四维立体排查矩阵

自检维度

诊断检查项与对应标准

状态判定与告警逻辑

1. Runtime 运行时

Node.js 主版本要求操作系统平台与 ABI

• PASS: Node.js >= 18.0.0• FAIL: Node.js 版本过低,提示升级环境

2. 本地 OpenSSH 资产

~/.ssh/config 配置文件默认私钥链探测 (id_ed25519 / id_ecdsa / id_rsa)SSH Agent 转发通道 (SSH_AUTH_SOCK)

• PASS: 探测到合法私钥、可读配置文件或活跃 Agent• WARN: 缺失可选资产(不影响基于环境变量的账密或自定义私钥直连)

3. 环境变量与安全合规

规范环境变量强解析 (ADR-0012)安全审计落盘目录权限 (ADR-0014)服务身份与引导指示 (ADR-0015)SSE 网络模式与非回环 Fail-Closed 熔断 (ADR-0017)预建端口转发 / SOCKS5 代理隧道 (12-Factor App)目标主机白名单与动态建连约束 (ADR-0017)

• PASS: 配置合规且约束健全• WARN: 本地开发模式下未启用审计或仅绑定回环免密• FAIL: 非回环外部网络绑定未配置 Token 触发安全熔断阻断、审计目录不可写或环境变量格式非法

4. 目标连通性只读探测

TCP 端口可达性探测SSH 协议握手与公私钥/账密鉴权

• PASS: 目标主机 22 端口连通且鉴权通过• WARN: 未配置默认目标(按需空载动态建连模式)• FAIL: 网络超时或凭证鉴权被远端服务器拒绝

CI/CD 与容器健康门禁退出码约束 (Exit Code Contract)

doctor 命令严格遵循标准退出码规范,可无缝接入 CI/CD 流水线与 Docker 容器启动探针:

  • 退出码 0:全部检查项通过(允许包含非致命的 WARN 提示);

  • 退出码 1:存在至少 1 项阻断性严重缺陷(FAIL,如 Node 版本不满足、外部暴露缺少 Token 熔断、配置非法或 SSH 鉴权失败)。

终端诊断输出范例

=================================================
   mcp-server-ssh 全景自检排障套件 (Doctor)     
=================================================

[Runtime 运行时]
  [PASS] Node.js 版本: Node.js v22.19.0 满足环境要求 (>= 18.0.0)
  [PASS] 操作系统平台: Linux (linux x64), Node ABI: 127
[本地 OpenSSH 资产]
  [PASS] SSH 配置文件: ~/.ssh/config 文件存在且具备可读权限
  [PASS] 默认本地私钥: 在 ~/.ssh/ 探测到本地默认私钥: id_ed25519
  [PASS] SSH Agent 转发通道: SSH_AUTH_SOCK 处于活跃挂载状态
[环境变量配置]
  [PASS] 规范配置解析 (ADR-0012): 环境变量解析强校验通过 (传输模式: stdio, 超时: 30000ms)
  [PASS] 安全审计轨迹 (ADR-0014): 安全审计处于未启用状态 (MCP_SSH_AUDIT_ENABLED=false)
  [PASS] 服务身份标识 (ADR-0015): 服务标识名称: "mcp-server-ssh" (未配置额外引导指示)
[目标主机连通性]
  [PASS] 目标主机 TCP 连通性: 192.168.1.100:22 TCP 端口畅通 (耗时 12ms)
  [PASS] SSH 握手与鉴权: 成功与 192.168.1.100:22 协商并完成公钥身份验证 (耗时 88ms)

-------------------------------------------------
诊断结果: 8 项通过, 0 项提示, 0 项失败
=================================================

⚙️ 6 大连接场景配置矩阵 (Scenarios)

针对不同网络拓扑与鉴权需求,提供开箱即用的配置范例:

场景 1:密码账密直连 (最简临时测试)

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "@atengk/mcp-server-ssh"],
      "env": {
        "MCP_SSH_HOST": "192.168.1.100",
        "MCP_SSH_PORT": "22",
        "MCP_SSH_USER": "root",
        "MCP_SSH_PASSWORD": "your_secure_password"
      }
    }
  }
}

场景 2:公私钥免密直连 (生产环境规范推荐)

支持物理文件路径、原始 PEM 文本与 Base64 编码三种形态:

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "@atengk/mcp-server-ssh"],
      "env": {
        "MCP_SSH_HOST": "192.168.1.100",
        "MCP_SSH_PORT": "22",
        "MCP_SSH_USER": "root",
        "MCP_SSH_PRIVATE_KEY_PATH": "D:/files/server/id_ed25519",
        "MCP_SSH_KEY_PASSPHRASE": "optional_passphrase"
      }
    }
  }
}

💡 免文件挂载小妙招:在容器或无文件系统环境中,可直接将私钥 Base64 字符串赋值给 MCP_SSH_PRIVATE_KEY_BASE64(或 PEM 文本赋值给 MCP_SSH_PRIVATE_KEY),服务将自动解码,无需挂载任何本地私钥文件!
💡 Windows 提示:本地路径强烈推荐统一使用正斜杠(如 "D:/files/server/id_ed25519"),Node.js 原生完美支持,且能彻底避免 JSON 反斜杠转义(\\)遗漏导致的解析崩溃。

场景 3:直接复用本地 ~/.ssh/config 别名 (最推荐,省心免配)

直接继承本机既有的公私钥路径、跳板机、自定义端口与 Host 别名:

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "@atengk/mcp-server-ssh"],
      "env": {
        "MCP_SSH_CONFIG_ALIAS": "my-cloud-vps"
      }
    }
  }
}

场景 4:企业级 ProxyJump 堡垒机/跳板机穿透预建连

通过公网跳板机(Bastion)安全穿透至隔离内网中的私有目标服务器(注意:MCP_SSH_PROXY_* 仅专用于物理建连中继跳板,与会话内动态端口转发 ssh_forward_port 完全解耦):

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "@atengk/mcp-server-ssh"],
      "env": {
        "MCP_SSH_HOST": "10.0.1.50",
        "MCP_SSH_PORT": "22",
        "MCP_SSH_USER": "deploy",
        "MCP_SSH_PROXY_HOST": "bastion.company.com",
        "MCP_SSH_PROXY_PORT": "2222",
        "MCP_SSH_PROXY_USER": "bastion_user"
      }
    }
  }
}

场景 5:云原生网络常驻 SSE 模式 (强身份鉴权 + 来源/目标双白名单)

常驻部署于容器、Kubernetes 或内网跳板节点,强制启用 Token 鉴权与目标收敛:

{
  "mcpServers": {
    "ssh-remote": {
      "url": "http://192.168.1.100:8000/sse",
      "headers": {
        "Authorization": "Bearer YOUR_GENERATED_SECRET_TOKEN"
      }
    }
  }
}

💡 空载按需连接模式:若启动时不提供任何预建连环境变量,服务将以空载状态启动,AI 智能体将在会话中通过 ssh_connect 按需连接主机。若设置了 MCP_SSH_ALLOWED_TARGETS,所有连接将受目标白名单强约束;设置 MCP_SSH_DISABLE_DYNAMIC_CONNECT=true 则彻底关闭动态建连。

场景 6:预建连 + 启动即用内网端口映射 / SOCKS5 代理隧道 (开机即穿透)

在启动 MCP 服务完成 SSH 鉴权的同时,自动在宿主机本地拉起端口转发或动态代理,生命周期与 SSH 服务同步保持常驻(默认 MCP_SSH_TUNNEL_IDLE_TIMEOUT=0 常驻不熔断):

选项 A:启动时自动映射私网数据库(如本地 16379 映射至远端私网 Redis 10.0.1.200:6379)

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "@atengk/mcp-server-ssh"],
      "env": {
        "MCP_SSH_HOST": "192.168.1.100",
        "MCP_SSH_USER": "root",
        "MCP_SSH_PRIVATE_KEY_PATH": "D:/files/server/id_ed25519",
        "MCP_SSH_TUNNEL_TYPE": "local",
        "MCP_SSH_TUNNEL_LOCAL_PORT": "16379",
        "MCP_SSH_TUNNEL_REMOTE_HOST": "10.0.1.200",
        "MCP_SSH_TUNNEL_REMOTE_PORT": "6379"
      }
    }
  }
}

选项 B:启动时一键拉起本地动态 SOCKS5 代理(全内网集群动态穿透)

本地客户端(如浏览器 SwitchyOmega、DBeaver、Terminal)配置代理 socks5://127.0.0.1:1080,即可直接访问远端机房所在的整个私有集群:

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "@atengk/mcp-server-ssh"],
      "env": {
        "MCP_SSH_CONFIG_ALIAS": "my-cloud-vps",
        "MCP_SSH_TUNNEL_TYPE": "socks5",
        "MCP_SSH_TUNNEL_LOCAL_PORT": "1080"
      }
    }
  }
}

🌐 环境变量完整速查矩阵 (12-Factor App)

全面遵循现代化 12-Factor App 与 ADR-0012 单一命名空间治理规范,服务严格仅识别 MCP_SSH_* 官方标准前缀,彻底摒弃遗留多别名推断,所有布尔变量严格要求 "true" 或 "false":

配置分类

规范环境变量 (MCP_SSH_*)

类型 / 取值约束

默认值 / 行为说明

传输协议

MCP_SSH_TRANSPORT

枚举: "stdio" | "sse"

默认 stdio(本地宿主管道),sse 为网络/容器常驻模式

服务监听地址

MCP_SSH_SERVER_HOST

IPv4 / 域名 / 回环

默认 127.0.0.1(安全回环绑定;配置为 0.0.0.0 等非回环外部暴露时强制要求提供 Token,否则启动熔断终止)

服务监听端口

MCP_SSH_SERVER_PORT

整数: 1 ~ 65535

默认 8000

网络边界安全

MCP_SSH_AUTH_TOKEN

敏感字符串

SSE 模式强身份鉴权令牌(支持 Header Bearer 与 URL Query,双 SHA-256 常数时间防时序攻击)

网络边界安全

MCP_SSH_ALLOWED_ORIGINS

逗号分隔字符串

CORS 跨域请求来源 Origin 白名单(废除通配符 *,未命中或未配置时一律拒绝跨域头)

网络边界安全

MCP_SSH_ALLOWED_TARGETS

逗号分隔规则列表

出站目标与跳板机白名单列表(支持单个 IP/域名、带端口、CIDR 网段如 10.0.0.0/8 及通配符域名如 *.internal.corp)

网络边界安全

MCP_SSH_DISABLE_DYNAMIC_CONNECT

严格布尔: "true" | "false"

默认 false。设为 true 时彻底禁用动态 ssh_connect 工具,锁定为仅使用预建连目标或本地别名

默认目标主机

MCP_SSH_HOST

主机名 / IP 地址

预建连默认目标 Linux 服务器 IP 或域名(提供时启动自动建连)

默认目标端口

MCP_SSH_PORT

整数: 1 ~ 65535

默认目标 SSH 端口号,默认 22

认证用户名

MCP_SSH_USER

字符串

预建连登录用户名(缺省时自动探测本地当前系统用户名)

认证密码

MCP_SSH_PASSWORD

敏感字符串

预建连明文密码(日志、审计与输出中强制掩码 *** 脱敏)

私钥文件路径

MCP_SSH_PRIVATE_KEY_PATH

本地文件路径

预建连私钥文件绝对路径(统一锁定为 PRIVATE_KEY_PATH)

私钥文本内容

MCP_SSH_PRIVATE_KEY

PEM 多行文本

原始 PEM 格式私钥文本(自动还原环境转义的 \n 换行)

Base64 私钥

MCP_SSH_PRIVATE_KEY_BASE64

Base64 编码字符串

Base64 编码私钥(彻底避免换行丢失,容器与云原生免文件挂载规范推荐)

私钥解密口令

MCP_SSH_KEY_PASSPHRASE

敏感字符串

若私钥受密码保护,提供解密口令

配置别名

MCP_SSH_CONFIG_ALIAS

字符串

匹配并继承本地 ~/.ssh/config 中的 Host 别名

ProxyJump 跳板

MCP_SSH_PROXY_HOST

主机名 / IP 地址

ProxyJump 堡垒机/跳板机 IP 或域名(专用于初始物理建连)

ProxyJump 跳板

MCP_SSH_PROXY_PORT

整数: 1 ~ 65535

ProxyJump 跳板机 SSH 端口,默认 22

ProxyJump 跳板

MCP_SSH_PROXY_USER

字符串

ProxyJump 跳板机认证用户名

ProxyJump 跳板

MCP_SSH_PROXY_PASSWORD

敏感字符串

ProxyJump 跳板机认证密码(可选)

ProxyJump 跳板

MCP_SSH_PROXY_PRIVATE_KEY_BASE64

Base64 编码字符串

ProxyJump 跳板机专用私钥(可选)

ProxyJump 跳板

MCP_SSH_PROXY_KEY_PASSPHRASE

敏感字符串

ProxyJump 跳板机私钥解密口令(可选)

预建隧道模式

MCP_SSH_TUNNEL_TYPE

枚举: "local" | "remote" | "socks5"

启动时预建隧道类型(默认 "local",支持本地正向、远程反向与动态 SOCKS5 代理)

预建本地端口

MCP_SSH_TUNNEL_LOCAL_PORT

整数: 0 ~ 65535

宿主机本地监听端口(传 0 自动随机分配空闲端口;socks5 模式默认 1080)

预建目标主机

MCP_SSH_TUNNEL_REMOTE_HOST

主机名 / IP 地址

远端目标内网服务地址,默认 127.0.0.1

预建目标端口

MCP_SSH_TUNNEL_REMOTE_PORT

整数: 1 ~ 65535

远端目标服务端口(local/remote 模式必填;socks5 动态代理无需配置)

预建本地网卡

MCP_SSH_TUNNEL_LOCAL_HOST

主机名 / IP 地址

宿主机本地监听网卡地址,默认 127.0.0.1(安全回环)

预建空闲熔断

MCP_SSH_TUNNEL_IDLE_TIMEOUT

非负整数秒

预建隧道空闲超时自动关闭秒数,默认 0(常驻不超时,伴随 MCP 物理连接生命周期)

服务身份标识

MCP_SSH_SERVER_NAME

字符串

自定义服务唯一命名空间(默认 mcp-server-ssh,非默认值触发工具描述前缀)

服务引导指示

MCP_SSH_SERVER_INSTRUCTIONS

多行文本

系统级服务角色与操作边界引导说明上下文(握手阶段下发给大模型)

连接超时时间

MCP_SSH_TIMEOUT

正整数毫秒

目标建连与握手超时时间(毫秒),默认 30000

心跳保活间隔

MCP_SSH_KEEP_ALIVE_INTERVAL

正整数毫秒

KeepAlive 心跳间隔(毫秒),默认 10000

致命命令逃生

MCP_SSH_ALLOW_DANGEROUS_COMMANDS

严格布尔: "true" | "false"

是否放行全盘强删等致命破坏命令,默认 false 严格阻断

安全审计开关

MCP_SSH_AUDIT_ENABLED

严格布尔: "true" | "false"

是否激活全景审计轨迹(配置 MCP_SSH_AUDIT_LOG_PATH 时自动开启)

审计日志路径

MCP_SSH_AUDIT_LOG_PATH

文件路径

审计日志物理落盘路径(缺省时输出至 stderr)

审计切分大小

MCP_SSH_AUDIT_MAX_SIZE_MB

正整数 MB

单日志文件滚动轮转阈值(MB),默认 10

审计保留份数

MCP_SSH_AUDIT_MAX_FILES

正整数

历史切分备份文件保留份数上限,默认 5

审计熔断模式

MCP_SSH_AUDIT_STRICT

严格布尔: "true" | "false"

是否启用审计失败严格熔断(默认 false 柔性降级)

📌 严格配置准则与架构约束 (Strict Configuration Guard & Architecture Invariants):

  1. 单命名空间锁定:服务 100% 仅读取 MCP_SSH_* 规范变量,不再支持无前缀或废弃前缀变量,杜绝环境变量多源歧义;

  2. 布尔严格解析:所有布尔类型变量仅接受 "true" 或 "false"(不区分大小写与空白字符),输入 "1"、"yes"、"on" 等非标值将立即报错阻断启动;

  3. 跳板机(ProxyJump)与端口转发隧道(Tunnel)概念与生命周期严格隔离:

    • 跳板机 (Jump Host):属于物理基础设施层与拓扑路由,专用于穿透公私网边界中继建立底层 SSH 物理网络链路(通过 MCP_SSH_PROXY_* 规范环境变量或本地 ~/.ssh/config 静态预置,服务启动建连期即生效);

    • 端口转发隧道 (Port Forwarding & SOCKS5):属于微服务级数据转发链路,既支持通过 MCP_SSH_TUNNEL_* 在服务启动完成 SSH 鉴权后自动预建常驻隧道(开机即穿透,默认不超时),也支持在会话期间通过 ssh_forward_port / ssh_tunnel_list / ssh_tunnel_close 由大模型按需动态创建与安全回收(默认 300 秒空闲熔断防护)。


🔌 远程服务调用 (SSE 协议客户端接入)

若服务已部署在局域网服务器、NAS(群晖/威联通)或云容器中,MCP 客户端可直接通过标准 HTTP SSE 端点网络接入,无需在客户端本地安装 Node.js 或运行子进程:

{
  "mcpServers": {
    "ssh-remote": {
      "url": "http://192.168.1.100:8000/sse",
      "headers": {
        "Authorization": "Bearer YOUR_GENERATED_SECRET_TOKEN"
      }
    }
  }
}

💡 鉴权方式:支持通过 HTTP 请求头 Authorization: Bearer <token> 认证,亦兼容浏览器原生 EventSource 客户端通过 URL 查询参数 ?token=<token> 接入。

服务端点矩阵与健康检查探针

在 SSE 模式下,轻量 HTTP 服务对外暴露以下规范端点:

端点路由

HTTP 方法

功能说明

响应格式 / 状态

/sse

GET

建立长轮询 Server-Sent Events 事件流,协商客户端 Session(需 Token 认证)

text/event-stream (200)

/message

POST

客户端发送 JSON-RPC 消息请求(需携带 ?sessionId=... 与 Token 认证)

application/json (202 Accepted)

/health

GET

服务就绪与存活探针(免密探针,已安全脱敏,支持 Docker/K8s 健康探测)

application/json (200 OK)

/ping

GET

极简存活探测端点(免密探针,等同于 /health)

application/json (200 OK)

🔒 安全收敛说明:根路径 / 已彻底移除公开免密访问,未授权请求将直接响应 404 Not Found;健康探针已剔除内部版本与活跃连接数等指纹信息。

探针请求回显范例:

{
  "status": "healthy"
}

🐳 生产环境容器化常驻部署 (Docker & Docker Compose)

项目已由 GitHub Actions CI/CD 自动构建并发布官方多架构镜像(全平台支持 linux/amd64 与 linux/arm64,适配 Intel/AMD x86 服务器、Mac M系列及树莓派/ARM 云主机)。无需克隆源码仓库,只需单文件配置即可一键秒级拉起常驻守护服务。

1. 使用 Docker Compose 一键拉起(推荐 ⭐⭐⭐⭐⭐)

无需下载整个代码库,仅需下载或新建 docker-compose.yaml 即可常驻运行:

# 方式 A:单行命令直接从 GitHub 拉取配置并启动服务
curl -fsSL https://raw.githubusercontent.com/atengk/mcp-server-ssh/main/docker-compose.yaml -o docker-compose.yaml && docker compose up -d

# 常用运维命令
docker compose logs -f    # 查看服务实时日志
docker compose pull       # 一键更新至官方最新镜像
docker compose down       # 优雅停止服务

docker-compose.yaml 核心配置参考:

services:
  mcp-server-ssh:
    # 官方预构建多架构镜像 (默认最新版,亦可指定具体版本如 :1.2.3)
    image: ghcr.io/atengk/mcp-server-ssh:${MCP_SSH_IMAGE_TAG:-latest}
    container_name: mcp-server-ssh
    restart: unless-stopped
    ports:
      - "8000:8000"
    environment:
      # 启用 SSE 协议常驻服务 (非回环绑定必须提供强身份令牌)
      - MCP_SSH_TRANSPORT=sse
      - MCP_SSH_SERVER_HOST=0.0.0.0
      - MCP_SSH_SERVER_PORT=8000
      - MCP_SSH_AUTH_TOKEN=${MCP_SSH_AUTH_TOKEN:-change_me_to_your_secure_random_token}

      # 默认目标服务器凭据 (纯环境变量注入,免文件挂载)
      - MCP_SSH_HOST=192.168.1.100
      - MCP_SSH_PORT=22
      - MCP_SSH_USER=root
      - MCP_SSH_PASSWORD=your_secure_password
      # 亦支持私钥文本/Base64 纯环境变量注入:
      # - MCP_SSH_PRIVATE_KEY_BASE64=LS0tLS1CRUdJTi...
    volumes:
      # 可选: 若需要复用宿主机 ~/.ssh/ 凭据 (只读挂载)
      # - ~/.ssh:/home/node/.ssh:ro

2. 使用 Docker CLI 独立运行

亦可直接使用标准 docker run 命令启动(支持 linux/amd64 与 linux/arm64 双架构):

# 方式 A:SSE 远程常驻模式 (后台守护 + 端口映射 + 强鉴权令牌)
docker run -d \
  --name mcp-server-ssh \
  -p 8000:8000 \
  -e MCP_SSH_TRANSPORT=sse \
  -e MCP_SSH_SERVER_HOST=0.0.0.0 \
  -e MCP_SSH_AUTH_TOKEN="your_secure_generated_token" \
  -e MCP_SSH_HOST=192.168.1.100 \
  -e MCP_SSH_USER=root \
  -e MCP_SSH_PASSWORD=your_password \
  ghcr.io/atengk/mcp-server-ssh:latest

# 方式 B:本地 stdio 单次管道模式 (宿主机无需安装 Node.js)
# 客户端直接将 docker run 作为 command 执行,stdio 直接管道透传
docker run -i --rm \
  -e MCP_SSH_TRANSPORT=stdio \
  -e MCP_SSH_HOST=192.168.1.100 \
  -e MCP_SSH_USER=root \
  -e MCP_SSH_PASSWORD=your_password \
  ghcr.io/atengk/mcp-server-ssh:1.2.3

🌐 多服务器连接与集群管理 (Multi-Host Architecture)

@atengk/mcp-server-ssh 内置企业级连接池管理器(ConnectionPool),原生支持在单个服务内同时维持与调度多台 Linux 主机。根据您的使用习惯,提供三种灵活的架构模式:

模式一:单 MCP 实例内的【动态连接池路由】(最灵活、推荐)

只需启动一个通用的 MCP 服务(如上述“场景 5”的空载配置),AI 即可在自然语言对话中随时建立、切换并并发调度多台主机:

跨主机协同调度机制

所有命令与文件工具(ssh_exec、sftp_* 等)均包含可选参数 connectionId:

  • 建立连接:调用 ssh_connect 时指定 connectionId: "prod" 或 connectionId: "test";

  • 定向下发:传入 connectionId 时,请求将精准路由至对应主机的物理通道;未传入时自动路由至当前的默认连接(Default Connection);

  • 跨机数据同步:AI 可在一个任务链中从主机 A 下载文件(sftp_download(..., connectionId: "test")),紧接着直接上传至主机 B(sftp_upload(..., connectionId: "prod"))!

跨机实战对话范例:

用户:“帮我连上生产机 192.168.1.100:22 (命名为 prod),再连上测试机 192.168.1.50:22 (命名为 test)。然后对比两台机器的可用内存。”

🤖 AI 行为:

  1. 调用 ssh_connect({ host: "192.168.1.100", port: 22, username: "root", connectionId: "prod", setAsDefault: true });

  2. 调用 ssh_connect({ host: "192.168.1.50", port: 22, username: "dev", connectionId: "test" });

  3. 分别调用 ssh_exec({ command: "free -m", connectionId: "prod" }) 与 ssh_exec({ command: "free -m", connectionId: "test" });

  4. 对比两台服务器的内存指标并为您生成直观的可视化对比表格。


模式二:客户端级别的【静态多实例隔离与大模型精准识别】(物理隔离、互不干扰)

若您在客户端中需要同时挂载多个独立的 SSH 服务分别连接不同安全域的主机(如核心生产机房 vs 开发测试集群),大模型如何明确区分并精准调用对应目标?

@atengk/mcp-server-ssh 提供专为大模型设计的 多实例服务身份标识与引导指示体系 (ADR-0015):

  1. CLI 命令行长选项接入:--server-name <name> 与 --server-instructions <text>;

  2. 规范环境变量接入:MCP_SSH_SERVER_NAME 与 MCP_SSH_SERVER_INSTRUCTIONS(CLI 选项优先级高于环境变量);

  3. 协议级一等公民握手:在服务初始化时直接向客户端与大模型下发唯一服务身份名称及角色操作边界;

  4. 工具描述自动紧凑修饰:所有对外暴露的 29 个 MCP 工具描述前自动透明追加 [<serverName>] 紧凑前缀(如 [prod-bastion] 无状态执行远程 Bash 命令...),彻底终结大模型混淆调用目标的隐患!

Claude Desktop / Cursor 实战配置示范:

{
  "mcpServers": {
    "ssh-prod": {
      "command": "npx",
      "args": [
        "-y",
        "@atengk/mcp-server-ssh",
        "--server-name", "prod-bastion",
        "--server-instructions", "专用于生产环境核心业务服务器,执行高危变更前必须双重确认"
      ],
      "env": {
        "MCP_SSH_HOST": "10.0.1.100",
        "MCP_SSH_PORT": "22",
        "MCP_SSH_USER": "ops",
        "MCP_SSH_PRIVATE_KEY_PATH": "D:/keys/prod_id_ed25519"
      }
    },
    "ssh-dev": {
      "command": "npx",
      "args": [
        "-y",
        "@atengk/mcp-server-ssh",
        "--server-name", "dev-node",
        "--server-instructions", "开发联调测试集群,可自由编译调试与重启容器"
      ],
      "env": {
        "MCP_SSH_HOST": "192.168.1.50",
        "MCP_SSH_PORT": "22",
        "MCP_SSH_USER": "dev",
        "MCP_SSH_PASSWORD": "dev_password"
      }
    }
  }
}
  • 大模型感知效果:

    • 工具描述自动前缀化:AI 工具栏中直观呈现 [prod-bastion] ssh_exec 与 [dev-node] ssh_exec;

    • 角色行为自动对齐:当您向 AI 发出“重启微服务容器”时,AI 会自觉依据 instructions 在测试节点立即执行,而在生产节点前置向您提示风险并请求确认!


模式三:继承本地 ~/.ssh/config 集群别名(零凭证泄露)

在宿主机的 ~/.ssh/config 中配置多主机拓扑(含各自私钥、自定义端口与跳板机),启动服务后,无需在聊天中告知 AI 任何敏感 IP 或密码:

用户:“帮我连上本地配置里的 ali-prod 和 tencent-test 主机。”
🤖 AI:自动通过 sshConfigAlias 建立连接并映射路由,安全优雅!



💡 大模型日常提示词与实战指令库 (Prompts & Best Practices)

为让大模型充分发挥 MCP 工具矩阵的最大威力,我们精心整理了系统级引导模版与日常最高频的运维 Prompt 模版。无论是写入客户端配置还是直接粘贴发送,均可即开即用:

1. 服务引导指示模版库 (Server Instructions Templates)

通过 --server-instructions <text> 参数或 MCP_SSH_SERVER_INSTRUCTIONS 环境变量在服务启动时注入,在协议初始化时直接成为大模型的全局行为基准:

模版 A:【生产机房高可用运维型】(安全防御优先,严控破坏性指令)

你是一名管理核心生产服务器的资深 Linux 系统运维专家。
操作原则:
1. 安全第一:执行任何涉及文件删除、配置覆写、服务停止或网络重启的命令前,必须在对话中向用户说明影响面并获得确认;
2. 变更留痕:修改关键配置文件前必须先备份为 .bak;尽量使用 sftp_patch_file 局部更新,严禁全量盲目覆写;
3. 输出精简:命令执行后提炼关键输出、状态码与错误堆栈,禁止向用户输出无意义的原始长日志。

模版 B:【开发测试极客与排障型】(自主排查,快速迭代)

你是一名全栈研发与运维专家,负责当前测试集群的持续联调与诊断。
操作原则:
1. 深入探查:遇到服务异常或测试失败,自主调用日志工具、进程查看与网络探针,迅速定位瓶颈;
2. 快速演练:支持对配置文件直接热修并验证语法;耗时编译构建任务优先使用 ssh_job_start 异步脱机执行;
3. 主动总结:每次排查完毕后,输出清晰的排查推演过程与修复建议。

模版 C:【安全基线与只读巡检型】(零侵入,仅读不写)

你是一名负责企业资产安全合规的系统审计员。
操作原则:
1. 严格只读:严禁下发任何修改系统配置、写文件、停止服务或启动新进程的写操作;
2. 全景采集:调用 ssh_system_info 与各类只读探针系统化检查内核、开放端口、SSH 配置、Sudo 权限及异常开机启动项;
3. 规范汇报:严格以标准 Markdown 审计报表格式呈现风险隐患、合规评级与加固整改方案。

2. 日常高频实战提示词 (Daily User Prompts)

复制以下提示词并替换其中的占位符,直接在 AI 聊天对话框中下发:

🎯 场景 1:主机全景健康体检与规格采集

Prompt 复制即用:

帮我全面巡检当前主机的健康状态与规格:
1. 查看操作系统架构、发行版与 Linux 内核版本;
2. 检查当前 CPU 核心数、实时负载(Load Average)与可用内存比例;
3. 列出根分区及挂载数据盘的磁盘空间占用与 Inode 消耗;
4. 排查当前处于 LISTEN 状态的公网与内网监听端口。
请将所有核心指标汇总为直观的 Markdown 对比卡片。

🛠️ 底层工具链:ssh_system_info / ssh_exec (uname, uptime, free, df)

🎯 场景 2:线上故障紧急排查与日志溯源

Prompt 复制即用:

我们的微服务出现异常波动,请帮我排查系统:
1. 抓取 /var/log/syslog 或 /var/log/messages 中最近 10 分钟内的 ERROR/FATAL 级别日志;
2. 查看当前 CPU 占用前 5 和内存占用前 5 的进程列表(PID、用户、占用百分比及命令);
3. 分析是否存在僵尸进程、OOM Killer 触发记录或磁盘 I/O 堵塞;
4. 给出可能引发故障的根因推断与紧急处置方案。

🛠️ 底层工具链:ssh_exec (grep, ps, dmesg) + OutputTruncator (双端 64KB 智能防撑爆)

🎯 场景 3:配置文件安全精准热修 (Patch)

Prompt 复制即用:

需要微调 Nginx 的连接超时配置:
1. 读取 /etc/nginx/nginx.conf 确认当前的 keepalive_timeout 配置;
2. 使用差异补丁将 keepalive_timeout 65; 替换为 keepalive_timeout 15; keepalive_requests 1000;;
3. 运行 nginx -t 严格校验配置语法;
4. 语法通过后平滑重载 Nginx,并确认 worker 进程工作正常。

🛠️ 底层工具链:sftp_patch_file (局部精准替换) + ssh_exec (nginx -t, nginx -s reload)

🎯 场景 4:耗时长任务脱机后台托管 (Job)

Prompt 复制即用:

我需要从远端镜像源拉取一份 10GB 的大文件并在远端执行解压与构建:
1. 请使用脱机后台作业(Job)在后台异步启动下载与解包脚本,不要阻塞当前会话;
2. 返回分配的 jobId 与系统 pid;
3. 每隔数秒帮我流式增量查看最新的日志输出,直到任务顺利完成并确认 exitCode 为 0。

🛠️ 底层工具链:ssh_job_start (脱机后台托管) + ssh_job_status + ssh_job_logs

🎯 场景 5:网络穿透与受管端口转发隧道 (三位一体 Tunnel & SOCKS5)

5.1 本地正向端口映射 (Local Forwarding, -L):访问私网数据库或微服务

Prompt 复制即用:

我在本地开发机上需要临时连接目标服务器私网内的 Redis 服务(远端内网 10.0.1.200:6379):
1. 调用 ssh_forward_port 建立本地端口转发隧道(type: "local"),将我本机的 16379 端口映射至 10.0.1.200:6379;
2. 设置 idleTimeoutSeconds 为 1800 秒(30 分钟无流量自动关闭释放端口,防止忘记关闭导致资源泄露);
3. 建立成功后打印本地监听地址与连接参数,方便我直接用本地 RedisInsight 工具连接。

🛠️ 底层工具链:ssh_forward_port (type: "local", localPort: 16379, remoteHost: "10.0.1.200", remotePort: 6379)

5.2 远程反向端口穿透 (Remote Forwarding, -R):将本地开发接口暴露给远端测试

Prompt 复制即用:

我本地 3000 端口正在调试一个 Webhook 回调接口,需要远端服务器上的测试程序调用它:
1. 调用 ssh_forward_port 建立远程反向端口转发(type: "remote"),将远端服务器的 8080 端口映射回我本地 127.0.0.1:3000;
2. 设置 idleTimeoutSeconds 为 600 秒(10 分钟自动回收);
3. 建立成功后,帮我在远端执行 curl -I http://127.0.0.1:8080 测试是否能够顺利请求到我本地的 Webhook 服务。

🛠️ 底层工具链:ssh_forward_port (type: "remote", remotePort: 8080, localPort: 3000) + ssh_exec (curl 验证)

5.3 动态 SOCKS5 全局代理 (Dynamic SOCKS5, -D):透明穿透整个内网私有集群

Prompt 复制即用:

我需要临时排查远端机房私有子网内的多个 Web 站点与内部 API 节点:
1. 调用 ssh_forward_port 启动纯 JS RFC 1928 动态 SOCKS5 代理服务(type: "socks5"),在本地 1080 端口监听;
2. 设置空闲超时为 3600 秒(1 小时);
3. 启动完成后告知我代理协议地址(socks5://127.0.0.1:1080)与浏览器配置指引,以便我一键畅游内网集群。

🛠️ 底层工具链:ssh_forward_port (type: "socks5", localPort: 1080, 自动动态解析目标端口)

5.4 活跃隧道巡检、流量审计与主动关闭释放

Prompt 复制即用:

联调测试已结束,请帮我清理与审计隧道资源:
1. 调用 ssh_tunnel_list 列出当前所有活跃的端口转发与代理隧道;
2. 检查各隧道的建立时间、当前活跃连接数(activeSockets)以及累计传输字节数(bytesTransferred);
3. 针对已经不再使用的隧道,调用 ssh_tunnel_close 输入 tunnelId 进行主动优雅关闭,确保本地和远端监听端口被干净释放。

🛠️ 底层工具链:ssh_tunnel_list + ssh_tunnel_close (tunnelId)

🎯 场景 6:特权命令安全提权执行 (Sudo)

Prompt 复制即用:

请帮我以特权身份更新目标服务器上的系统时间同步服务:
1. 提权执行 systemctl restart chronyd;
2. 检查 chronyc sources 验证上游时间服务器同步状态;
注意:请使用安全管道 Sudo 提权机制,密码绝不可暴露在命令行参数或系统日志中。

🛠️ 底层工具链:ssh_exec (sudo: true Stdin 隐式管道注入)

🎯 场景 7:工程代码与静态资产极速双向归档 (Tar Stream)

Prompt 复制即用:

帮我把本地的项目工程目录 ./my-project 上传并解压到服务器的 /opt/app/ 目录下:
1. 采用纯 JS 流式 Tar 目录传输;
2. 自动继承并读取 .gitignore,排除 node_modules、.git 及 *.log 等无用目录与临时文件;
3. 上传完成后校验目标目录的文件结构完整性。

🛠️ 底层工具链:sftp_upload_dir (流式 Tar + 排除规则) + sftp_list_dir

🎯 场景 8:多主机集群对比与资产调度 (Multi-Host)

Prompt 复制即用:

帮我同时调度生产机 prod 与测试机 dev:
1. 分别提取两台机器上的 /etc/hosts 文件与关键环境变量;
2. 对比两者的网段映射与解析差异,指出测试环境遗漏的域名配置;
3. 从 prod 节点下载 /opt/app/schema.sql 并直接部署传输至 dev 节点对应目录。

🛠️ 底层工具链:ssh_connect (多 connectionId) + sftp_download + sftp_upload

🎯 场景 9:MCP 服务存活验证、版本确认与心跳时延探测 (Ping)

Prompt 复制即用:

帮我自检当前连接的 SSH MCP 服务状态:
1. 调用 ssh_ping 发送心跳探针,携带自定义探针标识(如 probe-health);
2. 确认当前运行的 MCP 服务版本号与服务标识名称;
3. 计算并汇报从客户端发起到收到响应的往返时延(RTT 毫秒数)。

🛠️ 底层工具链:ssh_ping (message: "probe-health")


🛠️ 全量 29 个原子工具矩阵参考 (Tools)

服务基于单一职责与高内聚原则,对外提供覆盖 Linux 运维全生命周期的 29 项工业级原子工具:

领域模块

工具名称

核心职责说明

关键输入参数

基础运维 (2)

ssh_ping

测试 MCP 服务存活、当前版本及网络握手延迟

message?

ssh_system_info

采集远程系统硬件架构、CPU/内存指标与网络监听摘要

connectionId?

连接管理 (5)

ssh_connect

建立新 SSH 物理连接或依据本地配置别名预载入

host, port, username, password?, privateKey?, proxyJump?, sshConfigAlias?

ssh_disconnect

安全关闭并级联释放指定的物理连接及挂载隧道

connectionId

ssh_list_connections

列出连接池中所有活跃连接、建连时间与默认路由标记

无

ssh_list_config_hosts

解析并列出本机 ~/.ssh/config 预设的所有别名与主机

无

ssh_list_targets

[统一发现] 一次性返回活跃连接与配置别名双重视图

无

命令执行 (1)

ssh_exec

无状态执行远程 Shell 命令(支持 Sudo 隐式提权与 dryRun 演练)

command, connectionId?, cwd?, sudo?, sudoPassword?, timeoutMs?, dryRun?, dangerouslySkipSafetyCheck?

交互终端 (3)

ssh_session_start

启动常驻交互式 PTY 伪终端会话流(支持调整窗口行列)

connectionId?, cols?, rows?

ssh_session_send

向伪终端注入按键流、控制信号(如 \x03 Ctrl+C)或提示符快响

sessionId, input, expectPattern?, waitForMs?

ssh_session_close

优雅销毁指定的交互式伪终端会话并回收系统资源

sessionId

文件传输 (8)

sftp_read_file

读取远程文本文件(内置 512KB 防撑爆阈值)

remotePath, connectionId?, encoding?, maxBytes?

sftp_write_file

覆写远程文本文件(支持自动递归创建父级目录)

remotePath, content, createDirectories?

sftp_list_dir

浏览远程目录,返回 POSIX 权限、大小与时间元数据

remotePath, connectionId?

sftp_stat

获取指定远程路径的详细 POSIX 状态与属性

remotePath, connectionId?

sftp_mkdir

创建远程目录(默认自动级联 mkdir -p)

remotePath, recursive?

sftp_remove

删除远程文件或目录(支持级联删除与防环保护)

remotePath, recursive?

sftp_upload

将宿主机单文件极速上传至远程目标路径

localPath, remotePath, connectionId?

sftp_download

将远程单文件极速下载至宿主机本地目标路径

remotePath, localPath, connectionId?

流式与差异 (3)

sftp_upload_dir

[纯 JS 流式 Tar] 目录极速打包上传,支持正则与 .gitignore 排除

localPath, remotePath, excludePatterns?, useGitignore?

sftp_download_dir

[纯 JS 流式 Tar] 远程目录极速打包下载至本地

remotePath, localPath, excludePatterns?

sftp_patch_file

[原子差异补丁] 基于目标块锚点唯一性校验的局部精准热修

remotePath, targetContent, replacementContent, allowMultiple?

端口转发 (3)

ssh_forward_port

[三位一体] 管控 local/remote 端口映射及动态 SOCKS5 代理

type? ("local"|"remote"|"socks5"), localHost?, localPort?, remoteHost?, remotePort?, idleTimeoutSeconds?, connectionId?

ssh_tunnel_list

列出当前所有活跃隧道、端口映射、转发模式与流量统计

(无参数)

ssh_tunnel_close

手动关闭指定的端口转发隧道或代理服务

tunnelId

后台作业 (5)

ssh_job_start

[脱机作业] 在远程后台异步启动长耗时命令(记录 PID 与状态)

command, jobId?, cwd?

ssh_job_status

检查后台作业的活跃进程状态、运行耗时与最终退出码

jobId

ssh_job_logs

分页或流式增量抓取后台作业的标准输出与错误日志

jobId, tailLines?, offsetBytes?

ssh_job_kill

向后台作业发送优雅 SIGTERM 及强制 SIGKILL 终止进程

jobId

ssh_job_clean

清理已终结后台作业在远端暂存的临时日志与状态目录

jobId


🛡️ 安全防御矩阵与演练模式 (SafetyGuard)

为了防范 AI 模型幻觉引发毁灭性系统灾难,服务内置了强力前置守卫:

  • 实时拦截黑名单:自动阻断系统全盘强删(rm -rf /、rm -rf /*)、块设备覆写(mkfs、dd if=... of=/dev/...)、系统停机关机(reboot、shutdown、init 0)、清空根权限(chmod -R 000 /)及 Fork 炸弹等。

  • 运维受控逃生门:针对系统管理员确需执行重启等特殊运维任务的场景,服务提供双重授权逃生门机制——必须在服务端配置环境变量 MCP_SSH_ALLOW_DANGEROUS_COMMANDS=true,且在 ssh_exec 调用时显式传入 dangerouslySkipSafetyCheck: true 方可放行,单方面调用将被严格拒绝。

  • 实机绝对安全:拦截发生在客户端下发前,危险字节流绝对不会走出本地网络,远端物理通道零受影响。

  • 安全演练模式 (dryRun):在调用 ssh_exec 时传入 dryRun: true,可在不下发执行的前提下验证命令是否符合安全规则。


❓ 常见问题与排坑指南 (FAQ & Troubleshooting)

很多开发者容易将 跳板机(Jump Host / ProxyJump) 与 端口转发隧道(Tunnel) 混为一谈。在领域架构设计上,两者属于完全不同的网络层级:

核心维度

跳板机 (Jump Host / ProxyJump)

端口转发隧道 (SSH Tunnel & SOCKS5)

层级与角色

物理网络拓扑层:穿透公网与隔离私网边界,作为中继节点中转 SSH 底层物理连接

会话级微服务转发层:在已鉴权的物理连接内部开辟数据多路复用隧道,穿透访问内网特定服务

配置形式

静态预置:通过 12-Factor 环境变量(MCP_SSH_PROXY_*)或本地 ~/.ssh/config 声明

运行时动态编排:通过运行时工具 ssh_forward_port 按需拉起,无静态环境变量

生命周期

服务初始化启动时预建连,生命周期伴随服务主进程

会话期间按需创建,支持 300 秒空闲自动熔断,物理连接断开时级联释放

管控工具

ssh_connect (入参 proxyJump)

ssh_forward_port / ssh_tunnel_list / ssh_tunnel_close


🔌 三位一体端口转发模式详解 (ssh_forward_port)

通过原子工具 ssh_forward_port,可一键拉起以下三种模式之一:

1. 本地正向端口转发 (Local Forwarding, -L)
  • 工作原理:在宿主机本地监听端口,将进入该端口的 TCP 流量经由 SSH 链路转发至远端内网服务。

  • 典型入参:

    {
      "type": "local",
      "localHost": "127.0.0.1",
      "localPort": 16379,
      "remoteHost": "10.0.1.200",
      "remotePort": 6379,
      "idleTimeoutSeconds": 1800
    }
  • 适用场景:本地开发调试时,临时直接用本地 GUI 工具连接目标主机内网的私有 Redis、MySQL 或内部微服务。

2. 远程反向端口转发 (Remote Forwarding, -R)
  • 工作原理:在远程服务器上开启监听端口,将远端服务器接收到的访问流量反向经由 SSH 链路转发回宿主机本地。

  • 典型入参:

    {
      "type": "remote",
      "remotePort": 8080,
      "localHost": "127.0.0.1",
      "localPort": 3000,
      "idleTimeoutSeconds": 600
    }
  • 适用场景:将本地正在开发的临时 Webhook 服务或微服务接口暴露给远端测试环境调用。

3. 动态 SOCKS5 代理 (Dynamic Proxy, -D, RFC 1928)
  • 工作原理:在宿主机本地开启高并发 SOCKS5 代理协议监听,无需配置单一固定的远端目标;宿主机任何支持 SOCKS5 代理的客户端发起的任意 TCP 连接均由远端服务器动态代理外发。

  • 典型入参(remotePort 由协议动态协商解析,无需填报):

    {
      "type": "socks5",
      "localHost": "127.0.0.1",
      "localPort": 1080,
      "idleTimeoutSeconds": 3600
    }
  • 适用场景:将本地浏览器、API 调试工具或终端配置代理 socks5://127.0.0.1:1080,即可透明畅游目标机所在的整个局域网集群。


🛡️ 四大生命周期与安全防泄漏防护

  1. 默认回环绑定:本地监听默认锁定 127.0.0.1,绝不对宿主机外网暴露;

  2. 零冲突端口自选:localPort 传 0 或缺省时,系统底层自动分配合法的随机空闲端口并在返回值中明确告知实际分配的 localPort;

  3. 空闲超时自动熔断:默认 idleTimeoutSeconds: 300(可按需调整),在持续无流量传输时自动关闭 Server 并释放端口,杜绝无主监听常驻;

  4. 物理断连级联回收:当底层关联的 SSH 物理连接断开或网络闪断时,隧道服务自动触发级联析构,100% 确保宿主机和远端端口被洁净释放;

  5. 实时状态与流量观测:调用 ssh_tunnel_list 可一览所有活跃隧道的建立时间、最近活跃时间、当前并发客户端数(activeSockets)及传输总字节数(bytesTransferred)。


🏗️ 架构拓扑 (Architecture)

flowchart TD
    subgraph ClientSide ["AI 客户端生态 (MCP Client)"]
        LocalClient["本地宿主客户端 (Claude Desktop / Cursor / Antigravity)"]
        RemoteClient["远程/容器客户端 (Dify / Web / 自动化管道)"]
    end
    
    subgraph MCP_Server["@atengk/mcp-server-ssh (Node.js Bundle / Docker)"]
        Transport{"双模传输分发路由\n(MCP_SSH_TRANSPORT)"}
        Stdio["Stdio 管道通道"]
        SSE["HTTP SSE 传输服务 (8000 端口)"]
        
        subgraph Multi_Instance["服务身份与指令治理 (ADR-0015)"]
            Identity["Server Identity (--server-name)\n协议一等公民 + 工具描述 [name] 前缀"]
            Instructions["Server Instructions (--server-instructions)\n大模型系统级引导提示指示"]
        end

        subgraph Security_Audit["安全与审计双保险 (ADR-0003, ADR-0014)"]
            Guard["SafetyGuard (致命破坏模式拦截)"]
            Truncator["OutputTruncator (64KB 双端智能截断)"]
            Audit["AuditService (29 工具全景审计 + 凭据递归脱敏 + 文件滚动切分)"]
        end
        
        subgraph Core_Services["29 项原子能力微服务集群"]
            ConnPool["ConnectionPool (多主机连接池 / 路由 / 心跳保活)"]
            Exec["ExecService (登录 Shell 执行 + 管道 Sudo 提权)"]
            Session["SessionService (持久 PTY 终端会话 + 提示符快响)"]
            SFTP["SFTPService (POSIX 文件系统 + 防环限制)"]
            TarStream["TarService (纯 JS 流式 Tar 双向目录同步)"]
            Patcher["PatchService (原子锚点差异补丁)"]
            Tunnel["TunnelService (本地/远程端口映射 + 动态 SOCKS5 代理)"]
            Job["JobService (用户态脱机后台作业托管)"]
            System["SystemService (硬件/网络指标采集诊断)"]
        end
    end
    
    subgraph Remote_Network["远程目标基础设施"]
        Bastion["ProxyJump 堡垒机 / 跳板机"]
        LinuxHost["目标 Linux 服务器 (标准 OpenSSH Server)"]
    end
    
    LocalClient <==>|JSON-RPC via stdio| Stdio
    RemoteClient <==>|HTTP GET / POST via sse| SSE
    Stdio --> Transport
    SSE --> Transport
    Transport --> Multi_Instance
    Multi_Instance --> Security_Audit
    Security_Audit --> Core_Services
    ConnPool -.->|ProxyJump 隧道转发| Bastion
    Bastion -.->|Direct TCP/IP| LinuxHost
    Core_Services ===>|SSH2 / SFTP 子通道| LinuxHost

🏛️ 架构决策记录 (Architecture Decision Records)

本项目严格遵循 架构决策记录 (ADR) 演进机制,每一次重大决策均经过多轮技术推演与方案权衡:


🌐 官方生态与目录收录 (Community Catalogs)

本项目支持通过标准 PR / Issue 形式收录至全球 MCP 目录:


🤝 参与贡献 (Contributing)

欢迎任何形式的贡献、优化建议与缺陷反馈!本项目遵循现代化 GitHub Flow 与 Conventional Commits 规范,提供了开箱即用的本地工程化工具链:

# 1. 一键初始化本地环境并激活 Git 提交守门钩子
npm run setup

# 2. 启动 TypeScript 热重载监听与运行全量单测
npm run dev && npm test

# 3. 启动交互式向导规范化组装 Conventional Commit 提交
npm run commit

详细的分支策略、二元流水线机制、发版向导与开发规范请参阅完整的 贡献指南 (CONTRIBUTING.md)。


📄 开源许可证 (License)

本项目基于 Apache License 2.0 (Apache-2.0) 协议完全开源。

Available Tools

30 tools
sftp_downloadC

将远程主机上的文件快速下载到宿主机本地指定路径

NameRequiredDescriptionDefault
localPathYes保存到宿主机本地的绝对路径
remotePathYes待下载的远程主机文件绝对路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It says nothing about whether an existing local file is overwritten, whether parent directories are created, whether the transfer is atomic/streamed, what happens on a missing remote file, or what the tool returns — all material for a tool that writes to the local filesystem.

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?

A single, front-loaded sentence with the operation and direction stated first and no filler. It is efficient, though the terseness is also what leaves the behavioral gaps unaddressed.

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?

No output schema and no annotations mean the description must cover behavior, yet it omits overwrite semantics, directory creation, error cases and connection prerequisites. For a tool in a 16-sibling SSH/SFTP suite, that is insufficient to call it safely.

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 remotePath, localPath and connectionId are already documented (including the default-connection fallback for connectionId). The description adds no format, path-syntax or connection-selection detail beyond the schema, so the baseline 3 applies.

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?

States a specific verb (下载/download) and resource (文件/file) with an explicit direction (远程主机 → 宿主机本地路径), which cleanly separates it from the sibling sftp_upload. It does not name any sibling, but the directional wording makes the distinction obvious without opening a schema.

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?

There is no when-to-use guidance, no prerequisites (e.g. an active connection or ssh_connect having been called), and no mention of alternatives such as sftp_read_file for reading contents versus downloading a whole file. The agent is left to infer context entirely.

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

sftp_download_dirC

基于纯 JS 流式 Tar 架构将远程目录打包并流式下载解压至宿主机本地

NameRequiredDescriptionDefault
localPathYes宿主机本地保存并解压的目标目录绝对路径
remotePathYes远程待打包下载的目录绝对路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接
useGitignoreNo是否自动探测远程目录下的 .gitignore 规则并转译为 tar 排除参数,默认 true
excludePatternsNo通配排除规则列表(例如 ['node_modules', '.git', '*.tmp']),匹配的文件与目录将被忽略不下载

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It describes the tar-stream mechanism but omits critical behavior: whether local files are overwritten, whether the target directory must exist, permission requirements, symlink handling, and error behavior during partial extraction.

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 a single concise sentence with little waste. The implementation detail about 'pure JS streaming Tar architecture' is somewhat unnecessary for an agent, but it does not obscure the main purpose.

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?

For a tool that mutates the local filesystem by extracting an archive, the description is incomplete. With no annotations and no output schema, it should clarify overwrite behavior, local directory creation, and failure semantics.

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 the input schema already documents each parameter thoroughly. The description does not add parameter-specific meaning beyond what the schema provides, making the baseline 3 appropriate.

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 states a specific action and resource: package a remote directory and stream-download/extract it locally. It is clear what the tool does, but it does not explicitly distinguish itself from sibling tools like sftp_download or sftp_upload_dir.

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?

There is no guidance on when to use this tool versus alternatives such as sftp_download for single files or sftp_upload_dir. The implied use case is downloading a directory, but no conditions, 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.

sftp_list_dirC

列出远程目录下的文件与子目录元数据列表

NameRequiredDescriptionDefault
remotePathYes待浏览的远程目录绝对路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

C2.9/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 behavioral burden. While '列出' implies a read-only operation, it omits key details such as authentication requirements, pagination, symlink handling, and whether the operation has any side effects.

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 a single, front-loaded sentence with no wasted words. However, its extreme brevity leaves gaps that could be addressed without sacrificing conciseness.

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?

The tool is simple, but the absence of an output schema means the description should ideally explain the return structure or metadata fields. It only states that a metadata list is returned, without specifying fields like name, size, or type, and no annotations cover safety or 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%, and the schema fully documents both parameters. The description adds no additional meaning beyond what the schema already provides for remotePath and connectionId, so the baseline score of 3 is appropriate.

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 specifies the verb ('列出') and resource ('远程目录下的文件与子目录'), clearly identifying a directory-listing operation. It does not explicitly differentiate from siblings like sftp_stat or sftp_read_file, but the purpose is 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 given on when to use this tool versus alternatives such as sftp_stat (for single file metadata) or sftp_read_file (for file contents). The description only states what it does, leaving the agent to infer appropriate usage contexts.

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

sftp_mkdirC

在远程主机上创建目录(默认类似 mkdir -p 递归创建上级目录)

NameRequiredDescriptionDefault
recursiveNo是否类似 'mkdir -p' 递归创建上级目录,默认 true
remotePathYes待创建的远程目录绝对路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It hints at idempotent-style behavior via the 'mkdir -p' analogy, but says nothing about error handling when the directory already exists, permission requirements, or what happens on partial failure – and the mkdir -p note merely repeats the schema's own recursive parameter text.

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?

A single short sentence with the core operation front-loaded and a brief parenthetical qualifier; nothing is padded. The parenthetical is mildly redundant with the schema, keeping it just under a 5.

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?

For a simple mutation tool with full schema coverage and no output schema, the description is minimally adequate. It leaves out existence/overwrite behavior and connection prerequisites, which an agent would want before invoking a remote write.

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 all three parameters are already documented in the schema; baseline 3 applies. The description's parenthetical about recursive parent creation duplicates the schema text for the recursive parameter rather than adding new meaning.

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?

States a specific verb+resource: creating a directory on a remote host, which is inherently distinguishable from siblings like sftp_write_file, sftp_upload, or sftp_list_dir. It does not explicitly name or contrast with a sibling, so it stays at 4 rather than 5.

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 offers no when-to-use guidance, no prerequisites (e.g. that a connection must exist or that connectionId/current default is used), and no mention of alternatives. Usage is only implied by the verb itself.

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

sftp_patch_fileA

对远程大文本文件实施精准锚点文本块原子化替换,杜绝整文件覆写与行号漂移风险

NameRequiredDescriptionDefault
remotePathYes远程文件绝对路径(必须以 '/' 开头)
connectionIdNo目标连接标识符,缺省时使用当前默认连接
allowMultipleNo当目标文本块在文件中存在多处匹配时是否全部替换,默认 false(要求唯一匹配以防误伤)
targetContentYes待在远程文件中寻找并替换的精确目标文本块
replacementContentYes替换后的新文本内容

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It usefully discloses atomicity and the avoidance of line-number drift and full rewrites, but says nothing about permissions, failure behavior when the target is not found, or whether changes are reversible.

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?

A single dense sentence that front-loads the core operation (atomic anchor-based replacement) followed by the risk it avoids. No filler, nothing redundant.

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 complete schema coverage and no output schema, the description covers the tool's nature and its key differentiator (no line-number drift). It remains thin on mutation-side behavior such as error handling, but for a patch tool with a fully documented schema it is largely sufficient.

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 the schema already documents all five parameters including allowMultiple's unique-match default. The description's phrase '锚点文本块' loosely maps to targetContent but adds no format or matching semantics beyond the schema, so baseline 3 applies.

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 states a specific verb and resource: atomic, anchor-based replacement of text blocks in remote large text files. It implicitly differentiates from the whole-file-overwrite sibling (sftp_write_file) via '杜绝整文件覆写', but does not name an alternative tool explicitly.

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?

Usage is only implied: target edits to large files without rewriting the whole file. There is no explicit when-to-use versus sftp_write_file/sftp_read_file, and no mention of prerequisites such as needing an existing connection.

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

sftp_read_fileA

读取远程主机文本文件内容(单次读取限制 512KB 防爆,超出建议下载)

NameRequiredDescriptionDefault
encodingNo文件文本解码字符集,默认 utf-8utf-8
maxBytesNo最大读取字节数限制,默认 512KB (524288 字节),超出则拦截并建议下载
remotePathYes远程文件绝对路径(必须以 '/' 开头)
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the hard 512KB read cap and that exceeding it triggers interception plus a download suggestion, which is real behavior beyond the schema. However, it says nothing about error behavior, binary/encoding failure handling, permission requirements, or what the call returns.

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?

A single compact sentence with the core action front-loaded and the limit/fallback parenthesized after it. Every clause earns its place; nothing is redundant 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?

For a 4-parameter read tool with no annotations and no output schema, the description covers the critical size constraint but omits what the caller receives (text content string?), how binary or oversized content behaves in practice, and default-connection behavior. Adequate but with clear gaps.

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 all four parameters (encoding, maxBytes, remotePath, connectionId) are already documented in the schema; this is the baseline case where the schema does the heavy lifting. The description's 512KB mention merely restates the maxBytes default/limit rather than adding new semantics.

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?

States a specific verb and resource ('读取远程主机文本文件内容'), so an agent immediately knows this reads a remote text file rather than writing, listing, or stat-ing one. It implicitly routes oversized reads toward the download sibling ('超出建议下载') but never names sftp_download explicitly, so it stops short of full sibling differentiation.

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?

Gives a clear use condition (reading remote text file content) and an implicit when-not: files exceeding the 512KB single-read limit should go to a download instead. There is no explicit prerequisite or connection guidance, but the boundary condition for choosing an alternative is present.

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

sftp_removeB

删除远程文件或目录(支持非空目录递归级联删除,内置防环保护)

NameRequiredDescriptionDefault
recursiveNo若为目录且非空,是否级联递归删除,默认 false(防止误删)
remotePathYes待删除的远程文件或目录绝对路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

B3.4/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 does reasonably well: it discloses recursive cascade behavior and built-in loop protection. However, it does not state whether deletion is permanent/irreversible or whether permissions are required, which matters for a destructive operation.

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?

Single compact sentence in a parenthetical structure; front-loaded with the core action and supplementary behaviors. Slightly dense but no wasted words.

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?

For a destructive tool with no annotations and no output schema, the description covers recursive behavior and loop protection but omits irreversibility, permission requirements, and error/return behavior. Adequate but leaves meaningful gaps for a delete operation.

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 all three parameters (recursive, remotePath, connectionId) are fully documented in the schema. The description mentions recursive deletion at a high level but adds no syntax or format detail beyond the schema. Baseline 3 applies.

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?

States a specific verb+resource ('删除远程文件或目录' = delete remote file/directory) and adds distinguishing details (non-empty directory recursive cascade deletion, built-in loop protection). Clear enough to separate from siblings like sftp_upload or sftp_write_file, though it doesn't explicitly name an alternative.

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 on when to use this vs alternatives or when to avoid it. The recursive default of false implies a safety posture, but there is no explicit when/when-not instruction or prerequisite (e.g., connection state) mentioned.

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

sftp_statC

获取远程文件或目录的 POSIX 详细元数据信息

NameRequiredDescriptionDefault
remotePathYes待检查状态的远程路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden. '获取…信息' implies a read-only, non-destructive operation, which is useful, but it says nothing about error behavior for missing paths, symlink handling, or whether a connection must already be open.

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?

A single front-loaded sentence with no filler. It is efficient, though it is arguably too terse to carry the missing usage and behavioral context the tool needs.

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?

For a simple two-parameter read tool with full schema coverage, the description is minimally sufficient to invoke correctly. With no output schema and no annotations, it could have disclosed what metadata is returned and how failures surface, but it stops short.

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 both remotePath and connectionId (including its default-connection fallback) are already documented in the schema. The description adds no format, path-style, or defaulting detail beyond that, so the baseline 3 applies.

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 states a specific verb (获取/get) and resource (remote file or directory POSIX metadata), so an agent knows this retrieves metadata for a single path rather than listing contents. It does not, however, name or distinguish itself from the closest sibling, sftp_list_dir.

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?

There is no guidance on when to use this instead of sftp_list_dir or sftp_read_file, nor any mention of prerequisites (e.g., an active connection). The agent must infer usage entirely from the name and the 'file or directory' phrasing.

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

sftp_uploadC

将宿主机本地文件快速上传至远程目标主机

NameRequiredDescriptionDefault
localPathYes宿主机本地文件的绝对路径
remotePathYes上传到远程主机的绝对目标路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It claims a 'fast' upload but says nothing about overwrite behavior on an existing remote file, required permissions, connection requirements (connectionId defaults to the current connection), or how failures are reported — all material for a mutation tool with zero annotation coverage.

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?

A single short sentence with no filler, and the source-to-destination framing is front-loaded. It is efficient but so terse that it forgoes any useful elaboration.

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?

For a 3-parameter tool with a fully documented schema and no output schema, the description is just barely sufficient. It omits overwrite semantics, error behavior, and any statement of what distinguishes it from sftp_write_file, which a mutation tool with no annotations should cover.

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 localPath, remotePath and connectionId are already documented in the schema, including the default-connection behavior. The description adds no syntax, path format, or override details beyond that, so the baseline of 3 applies.

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?

States a specific verb (上传/upload), the source (宿主机本地文件) and the destination (远程目标主机), so the agent knows the direction of transfer. It does not distinguish itself from the sibling sftp_write_file, which also writes to a remote path, leaving ambiguity about which to pick.

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 gives no when-to-use or when-not-to-use guidance and never names an alternative such as sftp_write_file or sftp_download. An agent must infer selection purely from the tool name.

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

sftp_upload_dirC

基于纯 JS 内存流式 Tar 架构将宿主机本地整个目录树批量打包上传至远程主机并解压

NameRequiredDescriptionDefault
localPathYes宿主机本地待上传目录的绝对路径
remotePathYes远程目标解包目录绝对路径(不存在时会自动创建)
connectionIdNo目标连接标识符,缺省时使用当前默认连接
useGitignoreNo是否自动读取待同步目录下的 .gitignore 文件规则并合并至排除清单,默认 true
excludePatternsNo通配排除规则列表(例如 ['**/node_modules/**', '**/.git/**']),匹配的文件与目录将被忽略不传输

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the internal mechanism (pure JS in-memory streaming Tar) and implies archive-and-extract semantics, but says nothing about overwrite behavior on the remote, permissions, failure/partial-transfer handling, or auth requirements.

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?

A single front-loaded sentence with no filler. It is efficient, though it spends words on implementation architecture ('纯 JS 内存流式 Tar 架构') that is less actionable for an agent than behavioral facts would be.

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?

For a directory-upload tool with no annotations and no output schema, the description conveys the core mechanism and the schema covers all inputs, but it leaves out overwrite semantics and error/partial-transfer behavior. Adequate but with clear gaps.

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 every parameter (localPath, remotePath, connectionId, useGitignore, excludePatterns) is already documented in the schema. The description adds no parameter-level detail beyond noting the batch/directory nature, so the baseline 3 applies.

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?

States a specific verb+resource: batch-packaging the entire local directory tree and uploading it to the remote host, then extracting. This clearly distinguishes it from single-file sftp_upload and from sftp_download_dir, though it never names a sibling explicitly.

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?

There is no guidance on when to use this versus sftp_upload (single file) or other transfer tools, and no exclusions or prerequisites stated. The scope word '整个目录树批量' implies directory-level use but stops short of any explicit when/when-not routing.

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

sftp_write_fileB

写入并覆盖远程主机文本文件(支持自动递归创建父级目录)

NameRequiredDescriptionDefault
contentYes待写入的文本内容
remotePathYes远程文件绝对路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接
createDirectoriesNo当远程父级目录不存在时是否自动递归创建,默认 true

TDQS

B3.2/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It does disclose two meaningful traits beyond the schema: the write overwrites existing content, and parent directories are auto-created recursively. But it omits encoding, error behavior on failure, permission requirements, and whether the overwrite is atomic or truncating.

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?

A single tight sentence with the core action front-loaded and secondary behavior in parentheses. No filler, though it is on the sparse side for a mutation tool.

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?

For a 4-parameter write tool with no annotations and no output schema, the description covers the essential overwrite-and-create behavior but leaves unanswered what happens on failure, how existing file contents are affected mid-write, and whether special handling applies to non-text content.

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 all four parameters are already documented, setting the baseline at 3. The description reinforces the createDirectories default behavior but adds no syntax, path-format, or content-type details beyond what the schema states.

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?

States a specific verb and resource ('写入并覆盖远程主机文本文件') and adds the qualifier 'text file', which implicitly separates it from the binary-oriented sftp_upload sibling. However, it never names or contrasts with any sibling explicitly, so differentiation is left to inference.

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?

There is no when-to-use or when-not-to-use guidance. The phrase '文本文件' hints that binary transfers belong to sftp_upload, but the agent is not told this, nor are prerequisites (connection setup, permissions) or the relationship to sftp_mkdir described.

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

ssh_connectB

建立新的 SSH 主机连接,或依据本地 ~/.ssh/config 别名载入配置

NameRequiredDescriptionDefault
hostNo目标 Linux 服务器的主机名或 IP 地址
portNoSSH 端口号,默认 22
passwordNo登录密码(可选,优先推荐使用密钥认证)
usernameNo登录远程主机的用户名
proxyJumpNo跳板机别名、连接字符串 (user@bastion:22) 或结构化认证凭据配置
passphraseNo若私钥受密码保护,提供解密口令
privateKeyNoPEM/OpenSSH 格式的私钥内容,或私钥文件的本地绝对路径
connectionIdNo自定义连接标识符,未指定则自动分配唯一 ID
readyTimeoutNo建立连接就绪握手超时时间(毫秒),默认 30000
setAsDefaultNo是否将该连接设为后续操作的默认活跃连接,默认 true
sshConfigAliasNo本地 ~/.ssh/config 中配置的 Host 别名(如 prod-server)
keepaliveIntervalNo心跳保活检测发送间隔(毫秒),默认 10000

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states that it establishes or loads a connection; it omits authentication flow, connection persistence, error handling, and whether the connection becomes the default active connection (setAsDefault is only in schema).

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?

A single front-loaded sentence with no filler. It efficiently conveys the core purpose and the alias-based alternative.

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?

For a 12-parameter connection tool with no annotations and no output schema, the description is too thin. It does not explain that this creates a persistent connection usable by ssh_exec/ssh_session_* tools, nor does it cover authentication expectations or lifecycle management.

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 the schema already documents all 12 parameters. The description adds a small hint about ~/.ssh/config alias usage but does not explain parameter syntax or interactions beyond that.

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?

States a specific verb+resource (建立 SSH 主机连接) and an alternative mode (载入 ~/.ssh/config 别名). It clearly distinguishes from siblings like ssh_exec or sftp_* which operate on an existing connection.

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?

Describes two connection modes but gives no guidance on when to use this tool versus ssh_session_start, ssh_ping, or other siblings. No prerequisites or when-not conditions are provided.

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

ssh_disconnectB

断开并关闭指定的 SSH 物理网络连接

NameRequiredDescriptionDefault
connectionIdYes待关闭的 SSH 连接标识符

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states that a connection is closed but omits whether the connection must be active, what happens on failure, whether the operation is reversible, or any side effects on sessions tied to the connection.

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?

A single, front-loaded sentence with no wasted words that names the action and its target directly.

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?

For a simple one-parameter tool with no output schema this is minimally adequate, but with no annotations and no differentiation from ssh_session_close, an agent lacks enough context to choose confidently between the two.

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% and the single connectionId parameter is fully documented in the schema. The description adds no meaning beyond what the schema already provides, so the baseline of 3 applies.

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 gives a specific verb pair (断开/关闭) and resource (指定的 SSH 物理网络连接), making the operation clear. It does not, however, differentiate itself from the sibling ssh_session_close, which an agent could easily confuse with closing a connection.

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?

There is no explicit statement of when to use this tool versus alternatives such as ssh_session_close or when not to call it. Usage is only implied by the tool name and verb.

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

ssh_execA

在远程 Linux 主机执行单次无状态 Bash/Shell 命令,精准返回退出码、标准输出与标准错误

NameRequiredDescriptionDefault
cwdNo初始执行工作目录(自动包装为 cd <cwd> && <command>)
envNo注入远程环境的环境变量键值对
sudoNo是否以 sudo 特权身份执行命令(默认 false)。若为 true,自动通过 SSH Channel Stdin 管道流式安全注入提权密码,零命令行明文泄露
dryRunNo是否仅通过安全拦截守卫检测合规性,而不真正下发执行,默认 false
commandYes待在远程 Linux 系统执行的 Bash/Shell 命令
rawExecNo是否绕过登录 Shell 包装(bash -l -c),直接以非登录 Shell 原生执行,默认 false
timeoutMsNo执行超时时间(毫秒),默认 60000ms (1分钟)
connectionIdNo目标连接标识符,缺省时自动路由至当前默认活跃连接
sudoPasswordNosudo 提权专用密码。若未提供,则自动复用当前 SSH 连接的登录密码
dangerouslySkipSafetyCheckNo是否强制跳过前置高危安全拦截规则(危险操作逃生门,需同时配置环境变量 SSH_ALLOW_DANGEROUS_COMMANDS=true 授权)

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden and does contribute key facts: the execution is stateless and it returns exit code, stdout and stderr. However it says nothing about the side-effecting/destructive nature of arbitrary command execution, the sudo/safety-guard behavior, or the dangerous-command bypass hinted at by the schema.

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?

A single front-loaded sentence with zero filler that states verb, resource, execution model and return contract in one pass. Everything in it earns its place.

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?

For a complex 10-parameter tool with no annotations and no output schema, the description usefully covers the return contract (exit code/stdout/stderr) which compensates for the missing output schema. It is still thin on behavioral caveats for such a powerful, side-effecting tool, leaving it only minimum-viable.

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 the schema already documents all ten parameters in detail (cwd wrapping, sudo, dryRun, timeoutMs, rawExec, etc.). The description adds no parameter-level meaning beyond that, so the baseline 3 applies.

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 names a specific verb (执行/execute) and resource (single stateless Bash/Shell command on a remote Linux host), and the word '无状态' (stateless) subtly separates it from session/job siblings. It stops short of naming an actual sibling like ssh_session_send or ssh_job_start, so differentiation is implied rather than explicit.

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?

Usage is only implied: '单次无状态' (single, stateless) signals this is for one-off commands rather than persistent sessions, which hints at when it applies versus ssh_session_send or ssh_job_start. There is no explicit when-to-use/when-not statement or named alternative.

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

ssh_forward_portB

建立本地端口转发隧道(-L),将宿主机本地端口经由 SSH 链路转发至远程内网服务(内置空闲超时释放防泄漏)

NameRequiredDescriptionDefault
typeNo隧道类型:local (本地正向转发 -L), remote (远程反向转发 -R), socks5 (本地动态代理 -D),默认 locallocal
localHostNo宿主机本地绑定的监听地址,默认 127.0.0.1127.0.0.1
localPortNo宿主机本地监听端口,传 0 或缺省时自动分配空闲随机端口
remoteHostNo远程目标主机地址或内网主机名,默认 127.0.0.1127.0.0.1
remotePortNo远程目标服务端口号(local/remote 模式必填,socks5 模式自动动态解析)
connectionIdNo使用的 SSH 物理连接标识符,缺省时使用当前默认连接
idleTimeoutSecondsNo空闲自动超时释放时间(秒),默认 300 秒无流量自动关闭隧道以防泄漏;传 0 表示长驻不超时

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose one genuinely useful behavior: a built-in idle timeout that auto-releases the tunnel to prevent leaks. However, it omits other key behaviors such as the SSH-connection prerequisite, failure/auth semantics, and what identifying handle the created tunnel returns.

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?

A single dense sentence that front-loads the action (建立...隧道) and the mechanism (-L), then appends the leak-prevention behavior in parenthesis. No wasted words.

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?

No annotations and no output schema exist, so the description should carry more. It covers the core action and one behavioral trait, but omits prerequisites (existing SSH connection) and what the tool returns (a tunnel identifier usable with ssh_tunnel_list/ssh_tunnel_close), leaving gaps for a 7-parameter tool.

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 every parameter (type, localHost, localPort, remoteHost, remotePort, connectionId, idleTimeoutSeconds) is already explained in the schema. The description adds no parameter-level detail beyond what the schema provides, so the baseline 3 is appropriate.

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 gives a specific verb+resource (建立端口转发隧道) and even names the equivalent SSH flag (-L), so an agent immediately knows this creates a forwarding tunnel. It is somewhat narrowed to local/-L mode even though the schema supports local/remote/socks5, and it does not distinguish itself from the ssh_tunnel_list/ssh_tunnel_close siblings.

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?

There is no explicit guidance on when to use this tool versus alternatives, nor any stated prerequisites such as needing an existing SSH connection. The relationship to ssh_tunnel_list and ssh_tunnel_close (how to inspect or tear down the tunnel created here) is left entirely to inference.

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

ssh_job_cleanB

清理远程主机上已结束或过期的后台作业工作空间目录 (~/.mcp_jobs/)

NameRequiredDescriptionDefault
jobIdNo若指定则清理特定作业的工作空间;若未指定则批量清理过期作业
maxAgeDaysNo若批量清理,超过指定天数无活动的作业将被物理删除,默认 7 天
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses what gets removed (finished or expired job workspaces) and where (~/.mcp_jobs/), but does not state irreversibility, that deletion is physical, or any permission requirements — the '物理删除' detail lives only in the schema.

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?

A single compact sentence that front-loads the action and its scope, with the target path appended. No wasted clauses, though it is terse enough to leave behavioral gaps.

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?

For a simple, zero-required-parameter destructive tool with no annotations and no output schema, the description covers purpose and target directory but omits irreversibility and permission context, leaving meaningful gaps.

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 all three parameters are already well documented (jobId targeting, maxAgeDays threshold with default 7, connectionId defaulting to current). The description adds no parameter-level detail beyond that baseline.

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?

Specific verb (清理) plus resource (后台作业工作空间目录) and scope (已结束或过期), with the concrete location ~/.mcp_jobs/ named. It is distinguishable from ssh_job_kill and ssh_job_status, though it does not explicitly reference those siblings.

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 states no when-to-use conditions or alternatives. The choice between targeted cleanup (jobId) and bulk expiry cleanup is only visible in the schema, not in the description. No exclusions or prerequisites are given.

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

ssh_job_killB

向远程脱机后台作业进程发送终止信号(如 SIGTERM 或 SIGKILL)

NameRequiredDescriptionDefault
jobIdYes待终止的目标作业 ID
signalNo发送的终止信号(如 SIGTERM 或 SIGKILL),默认 SIGTERMSIGTERM
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

B3.1/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 behavioral burden. It mentions the signal types but omits critical traits: whether the operation is destructive/irreversible, what permissions or connection state are required, and what happens if the job is already gone. This is a kill tool, yet the description does not convey its destructive nature.

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?

A single, front-loaded sentence with zero waste. It states the core action and the signal examples immediately, which is appropriately sized for a simple kill operation.

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 no annotations and no output schema, the description is expected to fill behavioral gaps. It does not address destructive nature, prerequisites, or when to choose this over ssh_job_clean. Parameter semantics are fully covered by the schema, so the description is adequate but incomplete for safe invocation.

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 the schema already documents jobId, signal, and connectionId thoroughly, including the default SIGTERM. The description repeats the signal example but adds no new meaning beyond the schema, so the baseline 3 applies.

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 states a specific verb (发送终止信号) and resource (远程脱机后台作业进程), making the tool's action immediately clear. It does not explicitly differentiate itself from siblings like ssh_job_clean or ssh_job_status, so it falls short of the top score that requires sibling differentiation.

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 such as ssh_job_clean or ssh_job_status. It only states the action, leaving the agent to infer that this is for terminating rather than cleaning or inspecting jobs.

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

ssh_job_logsB

分段或增量获取远程脱机后台作业的标准输出与错误日志

NameRequiredDescriptionDefault
jobIdYes目标后台作业 ID
maxLinesNo本次读取的最大行数,默认 200 行
offsetLinesNo从第几行开始读取(0-indexed,用于分页与增量拉取),默认 0
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses that it retrieves both stdout and stderr and that reads can be segmented/incremental, implying a read-only, non-destructive operation. However, it says nothing about auth/permission needs, behavior on a missing or still-running job, or whether log availability depends on job retention.

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?

A single front-loaded clause with no filler or repetition. It is appropriately terse, though the fragmentary phrasing offers no structural signposting for the reading/pagination model it hints at.

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?

For a tool with no annotations and no output schema, the description is minimal: it identifies what is retrieved but not the return shape, ordering, or failure semantics an agent would want. The 100% schema coverage covers inputs, so the gap is mainly behavioral rather than fatal.

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 jobId, maxLines, offsetLines, and connectionId are all documented in the schema. The description's 分段/增量 wording loosely corresponds to the maxLines/offsetLines paging parameters but adds no syntax, units, or edge-case detail beyond the schema, so the baseline 3 applies.

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 gives a specific verb (获取) and resource (远程脱机后台作业的标准输出与错误日志), making it clear this reads a detached background job's stdout/stderr. It is distinguishable from job-control siblings like ssh_job_status, ssh_job_start, or ssh_job_kill, though it does not name 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?

Phrases like 分段或增量获取 imply the intended usage pattern (paged/incremental log tailing), but there is no explicit when-to-use or when-not-to-use guidance, and no mention of the obvious alternatives (ssh_job_status for state, sftp_read_file for arbitrary files). Usage must be inferred.

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

ssh_job_startB

在远程主机后台脱机启动长耗时命令(编译/镜像构建/备份等),不受网络断开或 MCP 请求超时影响

NameRequiredDescriptionDefault
cwdNo作业执行工作目录(缺省时使用用户登录主目录)
envNo注入作业环境的环境变量键值对
commandYes待在远程后台脱机运行的长耗时命令
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

B3.4/5.0
Behavior3/5

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

No annotations, so the description carries full burden. It usefully discloses that the job survives network disconnects and MCP request timeouts, which is key behavioral context. But it omits how the started job is identified (job id) and what is required to manage it, leaving a meaningful gap for a job-lifecycle tool.

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?

A single front-loaded sentence that leads with the core action and qualifies it with the timeout-immunity benefit. No filler, though it is dense parenthetical framing rather than cleanly separated clauses.

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 no output schema and no annotations, the description should tell the agent how to follow up (obtaining a job id to use with ssh_job_status/logs/kill). It captures the purpose and key resilience trait but stops short of the lifecycle context an agent needs to actually complete a background-job workflow.

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 all four parameters (command, cwd, env, connectionId) are already documented in the schema. The description adds only the concept of a long-running command and no format, precedence, or connection-fallback nuance beyond what the schema provides. Baseline 3 is appropriate.

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?

States a specific verb+resource (start long-running commands in the background, offline/daemonized on a remote host) and gives concrete examples (compilation, image build, backup). The 'long-running/background/offline' framing implicitly contrasts with ssh_exec, but no sibling is named explicitly, so an agent must infer the distinction.

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?

Usage is implied by 'long-running commands' and the timeout-immunity note, which is enough to signal this is for heavy jobs rather than quick commands. However, it never says when to prefer ssh_exec, nor does it mention the companion lifecycle tools (ssh_job_status, ssh_job_logs, ssh_job_kill) that an agent must use next.

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

ssh_job_statusA

查询远程脱机后台作业的存活状态、退出码与执行信息

NameRequiredDescriptionDefault
jobIdYes待查询的后台作业 ID
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It conveys that this is a read/query operation returning status codes and execution info, but says nothing about polling behavior, freshness of the data, permission requirements, or behavior when the job no longer exists.

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?

A single, front-loaded sentence listing exactly what is returned. No wasted words, though it is terse enough that it leaves behavioral questions unanswered.

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?

With no output schema, the description does the work of naming the return values (liveness, exit code, execution info), which is the key thing an agent needs. Remaining gaps (error behavior, staleness) are minor for a simple status-query tool.

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 only 2 parameters (jobId, connectionId), both documented in the schema itself. The description adds no additional meaning about parameter formats or defaults, so the baseline 3 applies.

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 uses a specific verb (查询) with a clearly scoped resource (远程脱机后台作业) and enumerates the returned data (存活状态、退出码、执行信息). This distinguishes it from siblings like ssh_job_logs, ssh_job_start, and ssh_job_kill, though the differentiation is implicit rather than stated.

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 purpose implies when the tool is useful (checking on a background job), but it never explicitly says when to use this versus ssh_job_logs for output or ssh_job_kill for termination. Usage is left to inference.

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

ssh_list_config_hostsA

[Deprecated] 读取并列出本地 ~/.ssh/config 中解析到的所有 Host 别名与基本配置(建议使用更全面的 ssh_list_targets)

NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses the data source (~/.ssh/config, local file) and that it is a read-style listing, but says nothing about behavior when the file is missing/unparseable or how results are shaped. Adequate but not rich.

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?

A single sentence, front-loaded with the [Deprecated] flag so the most decision-relevant information comes first, followed by scope and then the alternative. 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 deprecated, zero-parameter, read-only listing tool with no output schema, the essentials are covered: source, scope, and the recommended replacement. The one gap is that '基本配置' (basic config) is not itemized, so the exact fields returned remain vague.

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 tool takes zero parameters, so there is no parameter semantics to document; the baseline for a no-param tool is 4. The description correctly implies no filtering or scope arguments are accepted.

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?

States a specific verb (读取并列出 / read and list) and a precise resource (Host aliases and basic config parsed from local ~/.ssh/config). It also names the sibling it overlaps with (ssh_list_targets), so an agent can distinguish the two without opening either schema.

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

Usage Guidelines5/5

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

Explicitly marks itself as [Deprecated] and routes the agent to a named alternative (ssh_list_targets), described as more comprehensive. This is a clear when-not-to-use signal plus a concrete substitute, matching the strongest calibration example.

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

ssh_list_connectionsA

[Deprecated] 列出当前所有已建立且存活的 SSH 连接与默认路由状态(建议使用更全面的 ssh_list_targets)

NameRequiredDescriptionDefault

No parameters

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses deprecation status and hints at scope (live connections only, plus default route state), which is valuable behavioral context, but it does not state whether this is a pure read, what the return shape is, or any auth requirements.

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?

A single sentence with the deprecation warning front-loaded, followed immediately by the resource scope and the recommended alternative. No padding or 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?

For a deprecated, no-parameter list tool with no output schema, the description supplies the essential routing information. The only minor gap is that it doesn't clarify how its output differs from ssh_list_targets beyond the 'more comprehensive' framing.

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 tool takes zero parameters, so the baseline is 4. The description correctly implies there are no inputs to specify and adds no misleading parameter semantics.

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?

States a specific verb (列出/list) plus two concrete resources (存活的 SSH 连接 and 默认路由状态), so the scope is unambiguous. It also names the sibling ssh_list_targets as the preferred replacement, letting an agent distinguish this tool without opening the schema.

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

Usage Guidelines5/5

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

Explicitly marks the tool as deprecated and directs the agent to ssh_list_targets as a more comprehensive alternative. This is exactly the when-not-to-use and alternative-routing guidance the dimension asks for.

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

ssh_list_targetsA

统一目标发现视图:一次性聚合返回当前已连接活跃节点与本地 ~/.ssh/config 预设主机清单

NameRequiredDescriptionDefault

No parameters

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the two data sources (live connected nodes and local ~/.ssh/config presets), which is genuinely useful context, but says nothing about read-only safety, deduplication between the two sources, ordering, or freshness of the config file read.

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?

A single dense sentence, front-loaded with the framing ('统一目标发现视图') followed by the two aggregated sources. No wasted words, though the colon-heavy Chinese phrasing packs a lot into one clause.

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?

No output schema exists, so the description must describe returns — and it does name the two components of the aggregate (active connected nodes, local config hosts). It stops short of describing the merge/return structure or duplicate handling, but is adequate for a zero-parameter read tool.

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 tool takes zero parameters, so the schema leaves nothing to explain; baseline 4 applies. There is no input the description could clarify further.

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?

States a specific verb (聚合返回 / aggregate-and-return) and resource (统一目标发现视图 of connected nodes plus ~/.ssh/config hosts). An agent can tell this is a combined view rather than a single-source list, though it never names the siblings ssh_list_connections and ssh_list_config_hosts that it supersedes.

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?

Usage is only implied: the '一次性聚合' (one-shot aggregation) phrasing hints this should be preferred over calling the two narrower list tools separately, but no explicit when-to-use, when-not-to-use, or alternative is stated. Nothing tells the agent whether this replaces or supplements ssh_list_connections.

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

ssh_pingA

测试 SSH MCP 服务的存活状态、版本信息与通信延迟

NameRequiredDescriptionDefault
messageNo回显自定义消息内容

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the observable behavior (liveness, version, latency) which hints at the response. However it says nothing about whether it is read-only, whether it opens a network connection, or what side effects the echoed message has, leaving real behavioral 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?

A single front-loaded clause that states the resource and the three things it verifies, with zero filler. Nothing is redundant and nothing needs to be moved.

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 one-optional-parameter diagnostic tool with no output schema and no annotations, the description's enumeration of liveness/version/latency effectively conveys what comes back and is sufficient to call it. Only the echo parameter's purpose is left entirely to the schema.

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% and the single optional 'message' parameter is documented as an echo payload in the schema. The description adds no semantics for it, so the baseline of 3 applies with the schema doing the work.

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 names a specific verb (测试/test) and resource (SSH MCP 服务) and enumerates what it checks: liveness, version info, and latency. This clearly separates it from siblings like ssh_exec or sftp_* which act on remote hosts rather than the local service itself, though it never explicitly references an alternative.

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?

Usage is only implied: a health/latency probe is naturally used for diagnostics or connectivity checks before connecting, but the description never states when to call it versus ssh_connect or ssh_list_connections. No prerequisites or exclusions are given.

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

ssh_session_closeB

关闭指定的持久交互式 PTY 终端会话并回收系统资源

NameRequiredDescriptionDefault
sessionIdYes待关闭的 PTY 终端会话 ID

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries full behavioral disclosure. It states that the session is closed and resources reclaimed, but omits whether termination is graceful or abrupt, what happens to running processes, required permissions, error behavior, and whether the operation is irreversible.

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?

A single, front-loaded sentence with no redundant or filler content. It states the action and the resource immediately and ends cleanly.

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?

For a one-parameter close tool with a fully described parameter, the description conveys the essential purpose and cleanup effect. However, with no annotations and no output schema, it should disclose more about side effects and safety to be fully complete for a destructive-style operation.

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% and the single sessionId parameter is fully documented in the schema. The description adds no additional meaning, format, or constraints beyond what the schema already provides, so the baseline of 3 applies.

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?

States a specific verb (关闭) and a precise resource (指定的持久交互式 PTY 终端会话), including a cleanup outcome (回收系统资源). It does not explicitly distinguish itself from siblings such as ssh_disconnect or ssh_session_send, so it falls short of a 5.

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 when-to-use guidance, prerequisites, or alternative tools are named. The usage is only implied by the action of closing a session; there is no explicit context for choosing this tool over ssh_disconnect or other session or connection operations.

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

ssh_session_sendB

向指定的持久 PTY 终端写入指令或控制信号(如 '\x03' 发送 Ctrl+C),并收集增量屏幕回显

NameRequiredDescriptionDefault
inputYes待发送的数据内容或控制字符(如 '\x03' 发送 Ctrl+C)
sessionIdYes目标持久 PTY 终端会话 ID
timeoutMsNo当指定 expectPattern 时,最长等待模式匹配超时时间(毫秒),默认 30000ms (30秒)
waitForMsNo若未指定 expectPattern,等待收集终端响应输出的时间(毫秒),默认 1000ms
expectPatternNo用于主动检测命令完成或 Shell 提示符的正则表达式模式字符串(如 '[$#>:]\s*$'),匹配即刻响应返回

TDQS

B3.2/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden; it does disclose the core behavior of writing input and gathering incremental screen echo, which is useful. However it omits blocking semantics, whether writes mutate persistent session state, and any permission requirements — significant gaps for an interactive write tool with zero annotation coverage.

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?

A single dense sentence with the action front-loaded and no filler; the parenthetical control-character example is directly useful. Slightly compressed for the number of behaviors it touches, but well-structured.

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 5 parameters, no annotations, and no output schema, the description is adequate but lean. It covers the input/echo loop yet leaves out how the call blocks, when it returns, and how it relates to sibling session/exec tools, leaving clear gaps for a fairly complex interactive tool.

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 the schema already documents sessionId, input, timeoutMs, waitForMs, and expectPattern. The description's Ctrl+C example duplicates the schema's own input description and adds no new parameter meaning, so the baseline 3 applies.

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 states a specific verb (写入/write) and resource (指定的持久 PTY 终端) plus what it returns (增量屏幕回显), so an agent knows this drives an interactive terminal rather than a one-shot exec. It doesn't explicitly name ssh_exec or ssh_session_start as the contrasting sibling, keeping it below 5.

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?

There is no when-to-use, when-not-to-use, or alternative guidance. The agent must infer from the 'persistent PTY' framing that this is for interactive/long-lived sessions rather than ssh_exec, but nothing states that routing rule.

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

ssh_session_startA

在远程主机启动持久交互式伪终端 (PTY) 会话,支持跨多次输入维持环境状态

NameRequiredDescriptionDefault
colsNo伪终端列数宽度,默认 120
rowsNo伪终端行数高度,默认 30
connectionIdNo目标连接标识符,缺省时自动路由至当前默认连接

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. It usefully discloses that the session is persistent and state-preserving, but omits lifecycle facts: that it must be driven by ssh_session_send and torn down with ssh_session_close, whether sessions are resource-limited, or what happens on reconnect.

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?

A single front-loaded sentence with no filler; the core action and its key differentiator (persistent state) come first.

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?

For a session-lifecycle tool with no annotations and no output schema, the description covers what it does but not how the returned session is used or closed. An agent still needs the sibling tools to understand the full lifecycle, leaving a real gap.

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 cols, rows, and connectionId are already documented in the schema (including defaults and the default-connection routing behavior). The description adds no parameter-level meaning, so the baseline 3 applies.

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?

States a specific verb and resource: start a persistent interactive PTY session on a remote host. The qualifiers '持久交互式' and '跨多次输入维持环境状态' implicitly separate it from the one-shot ssh_exec sibling, though no sibling is named explicitly.

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?

Gives clear context for when to use it — when an agent needs an interactive session whose state survives multiple inputs. It stops short of stating exclusions or naming ssh_exec/ssh_connect as alternatives, so it is clear context without routing guidance.

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

ssh_system_infoA

一键无损采集远程 Linux 系统的发行版、内核、硬件架构、CPU 负载、内存/磁盘余量与监听端口摘要

NameRequiredDescriptionDefault
connectionIdNo目标连接标识符,缺省时使用当前默认连接

TDQS

A3.5/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It usefully declares '无损' (non-destructive), signaling a read-only operation, but omits permission requirements, execution time, failure modes, and return format details. This is better than a plain mutation description but still incomplete for a tool with zero annotation coverage.

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 a single compact sentence with no filler. It front-loads the action ('一键无损采集') before listing the collected resources, though the dense enumeration is less structured than a multi-sentence breakdown.

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 read-only tool with a fully documented single parameter and no output schema, the description adequately communicates the collected fields, which effectively describe the return content. Minor gaps remain around usage context and exact output format, but no critical information for invocation is missing.

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?

The schema fully documents the sole connectionId parameter (100% coverage), including its default behavior. The description adds no additional syntax or meaning for connectionId beyond what the schema already provides, so the baseline 3 applies.

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 '采集' (collect) and resource '远程 Linux 系统的...摘要' (remote Linux system summary), explicitly enumerating the collected data: distro, kernel, architecture, CPU load, memory/disk, and listening ports. This clearly distinguishes it from generic execution siblings like ssh_exec or ssh_ping.

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 when-to-use guidance or alternatives are provided. It does not state when to prefer this over ssh_exec or other SSH tools, nor does it mention prerequisites like needing an active connection, apart from what the schema implies via connectionId.

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

ssh_tunnel_closeB

按标识符主动关闭指定的端口转发隧道并释放宿主机本地监听端口

NameRequiredDescriptionDefault
tunnelIdYes待关闭的端口转发隧道 ID

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose one meaningful behavioral consequence beyond the name — that the host's local listening port is released — but is silent on what happens if the tunnel is already gone (idempotency), error behavior for an unknown/invalid tunnelId, and any permission requirements.

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?

A single front-loaded sentence with no filler; the action and its effect are stated immediately. It is appropriately sized for a one-parameter tool, though it leaves no room for the guidance the previous dimensions flag as missing.

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?

For a simple one-parameter tool with no output schema and no annotations, the description covers purpose and the port-release effect, which is roughly adequate. It nonetheless omits error/idempotency behavior that an agent needs before calling a mutating close operation.

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 a single fully documented tunnelId parameter, so the schema already carries the semantics. '按标识符' merely echoes the schema's '待关闭的端口转发隧道 ID' and adds no format, origin, or lookup guidance beyond it; baseline 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?

States a specific verb (关闭/close), a precise resource (端口转发隧道/port forwarding tunnel), the identification method (按标识符), and the side effect (释放宿主机本地监听端口). This lets an agent distinguish it from the forward-creating sibling ssh_forward_port and the read-only ssh_tunnel_list without opening either schema.

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 says only what the tool does; it gives no when-to-use context, no prerequisites, and no routing against alternatives such as ssh_disconnect or ssh_session_close that could plausibly overlap. Usage is left entirely to inference from the name.

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

ssh_tunnel_listB

列出当前所有活跃的端口转发隧道状态、端口映射与传输统计

NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. '列出' plus '当前所有活跃的' does communicate that this is a non-mutating read scoped to active tunnels, which rules out any write side effect. However, it does not say whether authentication is required, whether inactive/closed tunnels are excluded, or whether the tunnel list can be stale, leaving real gaps for an unannotated tool.

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?

A single dense sentence that front-loads the verb and resource with no filler or redundancy. It is appropriately sized for a no-argument listing tool, though the phrase packs listing scope and all three reported fields into one clause.

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?

There is no output schema, and the description usefully compensates by naming what comes back: tunnel status, port mappings, and transfer statistics. For a parameterless read tool this is close to complete; only the active-vs-inactive filter boundary and any permission requirement remain unstated.

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 tool takes zero parameters, so there is nothing for the description to disambiguate and the baseline of 4 applies. The schema coverage is 100% and the input object is empty, which is fully consistent with the description's claim of listing all active tunnels.

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?

Specific verb (列出/list) plus a precise resource (活跃的端口转发隧道) and an explicit scope of what is reported (状态、端口映射、传输统计). An agent can distinguish it from ssh_list_connections or ssh_list_targets by the resource, though it never names a sibling explicitly to reinforce the contrast.

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 contains no when-to-use or when-not-to-use guidance. It does not tell the agent how this relates to ssh_forward_port (which creates tunnels) or ssh_tunnel_close, nor that it should be called before closing a tunnel to obtain its identifier. Usage must be inferred entirely.

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. 15 tool updatesv1.4.1
    • Addedsftp_download_dir
    • Addedsftp_patch_file
    • Addedsftp_upload_dir
    • Changedssh_exec2 fields changed
      • addedInput schema / properties / sudo
        Added value: +{
        +  "default": false,
        +  "description": "是否以 sudo 特权身份执行命令(默认 false)。若为 true,自动通过 SSH Channel Stdin 管道流式安全注入提权密码,零命令行明文泄露",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / sudoPassword
        Added value: +{
        +  "description": "sudo 提权专用密码。若未提供,则自动复用当前 SSH 连接的登录密码",
        +  "type": "string"
        +}
    • Addedssh_forward_port
    • Addedssh_job_clean
    • Addedssh_job_kill
    • Addedssh_job_logs
    • Addedssh_job_start
    • Addedssh_job_status
    • Addedssh_list_targets
    • Changedssh_session_send3 fields changed
      • addedInput schema / properties / expectPattern
        Added value: +{
        +  "description": "用于主动检测命令完成或 Shell 提示符的正则表达式模式字符串(如 '[$#>:]\\s*$'),匹配即刻响应返回",
        +  "type": "string"
        +}
      • addedInput schema / properties / timeoutMs
        Added value: +{
        +  "default": 30000,
        +  "description": "当指定 expectPattern 时,最长等待模式匹配超时时间(毫秒),默认 30000ms (30秒)",
        +  "exclusiveMinimum": 0,
        +  "type": "integer"
        +}
      • changedInput schema / properties / waitForMs / description
        Previous value: -"等待收集终端响应输出的时间(毫秒),默认 1000ms"New value: +"若未指定 expectPattern,等待收集终端响应输出的时间(毫秒),默认 1000ms"
    • Addedssh_system_info
    • Addedssh_tunnel_close
    • Addedssh_tunnel_list
  2. 17 tool updatesv1.2.5
    • First observedsftp_download
    • First observedsftp_list_dir
    • First observedsftp_mkdir
    • First observedsftp_read_file
    • First observedsftp_remove
    • First observedsftp_stat
    • First observedsftp_upload
    • First observedsftp_write_file
    • First observedssh_connect
    • First observedssh_disconnect
    • First observedssh_exec
    • First observedssh_list_config_hosts
    • First observedssh_list_connections
    • First observedssh_ping
    • First observedssh_session_close
    • First observedssh_session_send
    • First observedssh_session_start

TDQS

B3.2/5.0

Scored across 30 tools

Disambiguation4/5

Most tools have clearly distinct purposes: one-shot exec vs persistent PTY sessions vs detached background jobs vs SFTP file operations. The two deprecated list tools overlap with ssh_list_targets, and sftp_upload vs sftp_write_file vs sftp_upload_dir can be confused, but descriptions clarify the boundaries.

Naming Consistency3/5

All names use snake_case and are grouped by ssh_ or sftp_ prefixes, which is consistent. However, ordering varies between verb_noun (ssh_list_targets, sftp_read_file) and noun_verb (ssh_job_start, ssh_tunnel_list, ssh_session_send), so the pattern is mixed though still readable.

Tool Count3/5

30 tools is heavy, but the server spans several subdomains: connections, sessions, background jobs, tunnels, system info, and SFTP operations. Each area mostly earns its tools, though the two deprecated duplicates add avoidable bloat.

Completeness4/5

Coverage is broad: connection lifecycle, command execution, PTY sessions, background job lifecycle, local port forwarding, and SFTP read/write/list/stat/mkdir/remove/upload/download/patch. Minor gaps include direct rename/move, chmod, checksum, and reverse/dynamic tunnels, though ssh_exec can work around many of these.

Maintenance

ActivityMaintained
ResponsivenessResponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to securely execute remote SSH commands, perform file transfers, and monitor system status through a standardized interface. It features robust security controls including command whitelisting, blacklisting, and credential isolation to prevent unauthorized operations.
    10
    11 npm
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to securely execute commands on remote hosts via SSH and SFTP, with persistent shells, file transfers, screenshots, and an audit log.
    5
    MIT