SSH MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SSH_HOST | Yes | 服务器地址(必填)。 | |
| SSH_PORT | No | SSH 端口,默认 22。 | 22 |
| SSH_TIMEOUT | No | 命令执行默认超时(毫秒),默认 30000;单次 ssh_exec 的 timeout 优先。 | 30000 |
| SSH_PASSWORD | No | 密码认证。与私钥内容或私钥文件路径至少提供一个。 | |
| SSH_USERNAME | Yes | 用户名(必填)。 | |
| SSH_PASSPHRASE | No | 私钥密码(加密私钥可选,不是第三类认证)。 | |
| SSH_KNOWN_HOSTS | No | known_hosts 文件路径,默认 ~/.ssh/known_hosts。 | ~/.ssh/known_hosts |
| SSH_PRIVATE_KEY | No | 私钥内容(原始 PEM 或其 Base64 编码)。与密码或私钥文件路径至少提供一个。 | |
| SSH_SFTP_TIMEOUT | No | SFTP 无进展超时(毫秒),默认 30000。 | 30000 |
| SSH_CONNECT_TIMEOUT | No | 连接超时(毫秒),默认 10000;自动连接和 ssh_connect 共用。 | 10000 |
| SSH_KEEPALIVE_COUNT | No | Keepalive 最大无响应次数,超过后判定连接死亡,默认 3。 | 3 |
| SSH_HOST_FINGERPRINT | No | 固定的 SHA256:... 主机指纹,不匹配则拒绝连接。 | |
| SSH_PRIVATE_KEY_PATH | No | 私钥文件路径(支持 ~ 展开)。与密码或私钥内容至少提供一个。 | |
| SSH_KEEPALIVE_INTERVAL | No | Keepalive 探测间隔(毫秒),默认 10000。设为 0 可禁用。 | 10000 |
| SSH_RECONNECT_MAX_DELAY | No | 重连最大延迟上限(毫秒),默认 10000。 | 10000 |
| SSH_RECONNECT_BASE_DELAY | No | 重连基础延迟(毫秒),默认 1000。 | 1000 |
| SSH_MAX_RECONNECT_ATTEMPTS | No | 最大尝试次数(含首次),默认 3;正整数,设为 1 表示不重试,0 为无效配置。 | 3 |
| SSH_STRICT_HOST_KEY_CHECKING | No | yes、accept-new、no。默认 accept-new:第一次见到主机时写入 known_hosts,密钥变化则拒绝连接。 | accept-new |
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_connectA | Create a new SSH connection to a remote server. Returns a session_id and the accepted host key fingerprint. Host keys are checked against known_hosts (default accept-new: remember a new key, reject a changed key). If server is pre-configured via environment variables, this is optional. |
| ssh_execA | Execute a command on a connected SSH session. Returns stdout, stderr, and exit code. timeout applies to this call only; on timeout the execution channel is closed and the command is not run again. Set background=true to return a job_id immediately, then use ssh_exec_poll and ssh_exec_cancel. If session_id is omitted, uses the default pre-configured session. |
| ssh_exec_pollA | Read the current output and status of a background command started with ssh_exec background=true. |
| ssh_exec_cancelA | Close the execution channel of a background command. This does not guarantee a detached remote process has stopped. |
| ssh_list_sessionsB | List all active SSH sessions with their connection details. |
| ssh_disconnectA | Disconnect an SSH session and release resources. If session_id is omitted, disconnects the default session. |
| sftp_listA | List files and directories in a remote path. Returns file names, sizes, permissions, and modification times. |
| sftp_uploadC | Upload a local file to the remote server. |
| sftp_downloadC | Download a file from the remote server to local. |
| sftp_readB | Read part of a remote file. Use offset and next_offset to page through it. encoding=utf8 avoids splitting a character; encoding=base64 returns exact bytes. |
| sftp_writeB | Write content to a remote file. Creates the file if it doesn't exist, overwrites if it does. |
| sftp_deleteC | Delete a file or empty directory on the remote server. |
| sftp_mkdirC | Create a directory on the remote server. |
| sftp_renameC | Rename or move a file/directory on the remote server. |
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 14 tools
The set splits cleanly into sftp_* file operations and ssh_* connection/execution operations, and most tools have distinct targets (mkdir vs rename vs delete). The only real overlap risk is sftp_write vs sftp_upload and sftp_read vs sftp_download, which target the same resources in different ways, plus ssh_exec_cancel vs ssh_disconnect; descriptions do resolve these but require reading.
Names follow a predictable prefix+action pattern (sftp_write, sftp_mkdir, ssh_connect, ssh_list_sessions) consistently across both domains. Minor deviation: ssh_disconnect omits the noun object that peers like ssh_list_sessions include, but the convention is still readable and predictable.
14 tools is well within the ideal range and each earns its place: eight SFTP file operations and six SSH connection/execution operations, including the background-job lifecycle (exec, poll, cancel). Nothing feels padded or missing for an SSH/SFTP server.
Core SSH workflow (connect, exec, background poll/cancel, list sessions, disconnect) and SFTP lifecycle (list, read, write, upload, download, mkdir, rename, delete) are fully covered with no dead ends. Minor gaps exist around file metadata/permission changes (chmod/chown/stat) and port forwarding/tunnels, which agents may occasionally need.