mcp-server-ssh
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SSH_HOST | No | The hostname or IP address of the remote SSH server. | |
| SSH_PORT | No | The port of the remote SSH server. | |
| SSH_USER | No | The username for SSH authentication. | |
| SSH_KEY_PATH | No | Path to the private key file for SSH authentication. | |
| SSH_CONFIG_ALIAS | No | Alias of a host defined in the local ~/.ssh/config file. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ssh_pingA | 测试 SSH MCP 服务的存活状态、版本信息与通信延迟 |
| ssh_connectB | 建立新的 SSH 主机连接,或依据本地 ~/.ssh/config 别名载入配置 |
| ssh_disconnectB | 断开并关闭指定的 SSH 物理网络连接 |
| ssh_list_targetsA | 统一目标发现视图:一次性聚合返回当前已连接活跃节点与本地 ~/.ssh/config 预设主机清单 |
| ssh_list_connectionsA | [Deprecated] 列出当前所有已建立且存活的 SSH 连接与默认路由状态(建议使用更全面的 ssh_list_targets) |
| ssh_list_config_hostsA | [Deprecated] 读取并列出本地 ~/.ssh/config 中解析到的所有 Host 别名与基本配置(建议使用更全面的 ssh_list_targets) |
| ssh_execA | 在远程 Linux 主机执行单次无状态 Bash/Shell 命令,精准返回退出码、标准输出与标准错误 |
| ssh_batch_execB | 向多台目标 Linux 主机批量分发执行无状态 Bash/Shell 命令(支持 @all_active、@all_configured、通配符、并发限流、串行中断及 16KB 紧凑输出截断) |
| ssh_session_startA | 在远程主机启动持久交互式伪终端 (PTY) 会话,支持跨多次输入维持环境状态 |
| ssh_session_sendB | 向指定的持久 PTY 终端写入指令或控制信号(如 '\x03' 发送 Ctrl+C),并收集增量屏幕回显 |
| ssh_session_closeB | 关闭指定的持久交互式 PTY 终端会话并回收系统资源 |
| sftp_read_fileA | 读取远程主机文本文件内容(单次读取限制 512KB 防爆,超出建议下载) |
| sftp_write_fileB | 写入并覆盖远程主机文本文件(支持自动递归创建父级目录) |
| sftp_list_dirC | 列出远程目录下的文件与子目录元数据列表 |
| sftp_statC | 获取远程文件或目录的 POSIX 详细元数据信息 |
| sftp_mkdirC | 在远程主机上创建目录(默认类似 mkdir -p 递归创建上级目录) |
| sftp_removeB | 删除远程文件或目录(支持非空目录递归级联删除,内置防环保护) |
| sftp_uploadC | 将宿主机本地文件快速上传至远程目标主机 |
| sftp_downloadC | 将远程主机上的文件快速下载到宿主机本地指定路径 |
| sftp_patch_fileA | 对远程大文本文件实施精准锚点文本块原子化替换,杜绝整文件覆写与行号漂移风险 |
| sftp_upload_dirC | 基于纯 JS 内存流式 Tar 架构将宿主机本地整个目录树批量打包上传至远程主机并解压 |
| sftp_download_dirC | 基于纯 JS 流式 Tar 架构将远程目录打包并流式下载解压至宿主机本地 |
| ssh_system_infoA | 一键无损采集远程 Linux 系统的发行版、内核、硬件架构、CPU 负载、内存/磁盘余量与监听端口摘要 |
| ssh_forward_portB | 建立本地端口转发隧道(-L),将宿主机本地端口经由 SSH 链路转发至远程内网服务(内置空闲超时释放防泄漏) |
| ssh_tunnel_listB | 列出当前所有活跃的端口转发隧道状态、端口映射与传输统计 |
| ssh_tunnel_closeB | 按标识符主动关闭指定的端口转发隧道并释放宿主机本地监听端口 |
| ssh_job_startB | 在远程主机后台脱机启动长耗时命令(编译/镜像构建/备份等),不受网络断开或 MCP 请求超时影响 |
| ssh_job_statusA | 查询远程脱机后台作业的存活状态、退出码与执行信息 |
| ssh_job_logsB | 分段或增量获取远程脱机后台作业的标准输出与错误日志 |
| ssh_job_killB | 向远程脱机后台作业进程发送终止信号(如 SIGTERM 或 SIGKILL) |
| ssh_job_cleanB | 清理远程主机上已结束或过期的后台作业工作空间目录 (~/.mcp_jobs/) |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 31 tools
Most tools have clearly distinct purposes across connection management, command execution, PTY sessions, background jobs, SFTP, and tunnels. The main ambiguity comes from two deprecated listing tools that overlap with ssh_list_targets, and from the multiple SFTP transfer variants, though descriptions mostly clarify when to use each.
Names are consistently snake_case and use predictable ssh_ or sftp_ domain prefixes. There is minor variation between verb-first names like ssh_connect and resource-first names like ssh_job_start, but the convention remains readable and coherent overall.
With 31 tools, the surface is heavy and exceeds the typical 3-15 range, even for a broad SSH server. The features are legitimate, but the count is large enough that discoverability and selection burden are real concerns.
The server covers connection management, command execution, persistent sessions, background jobs, extensive SFTP operations, local port forwarding, and system inspection. Minor gaps remain, such as SFTP rename/chmod/chown and remote or dynamic port forwarding, but these are mostly workaroundable through shell execution.