SSH MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
ssh-mcp runs commands and moves files on remote hosts over SSH, using ~/.ssh/config, the ssh-agent and known_hosts the way the OpenSSH client does.
After an auth, connect or host-key failure, run ssh_diagnose on that host before retrying. ssh_test is the quick check; ssh_key_list and ssh_key_load fix a key missing from the agent; ssh_known_hosts_fix replaces a stale host key.
Prefer the purpose-built tools over ssh_exec: ssh_read_file, ssh_ls, ssh_stat, ssh_find, ssh_tail, ssh_service_status. Use ssh_multi_exec for the same command on several hosts.
ssh_exec returns the exit code first, then stderr, then stdout. Proxies may cut long results (Yaw MCP keeps about 100 KB), so filter on the remote (grep, head, tail) instead of printing everything. Page a large file with ssh_read_file offset and length.
The SFTP tools take absolute remote paths (ssh_mkdir also accepts a relative one); ~ is not expanded.
Host keys: a host already in known_hosts must match. An unknown host is trusted on every connection unless strict mode (SSH_MCP_STRICT_HOSTKEYS=1) is on; add it with ssh_known_hosts_fix first.
On Windows the agent is the OpenSSH Authentication Agent service pipe; if agent auth fails, ssh_agent_ensure checks that the agent is reachable.
SSH_MCP_COMMAND_WHITELIST / SSH_MCP_COMMAND_BLACKLIST gate only ssh_exec and ssh_multi_exec, not the SFTP write and delete tools, and are a best-effort guard rail rather than a security boundary. Under a whitelist, run one plain command: shell control syntax and leading variable assignments, including the env parameter, are refused by default.
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_execA | Execute a command on a remote host via SSH. The command is interpreted by the remote login shell — pipes, redirects, globs, and other shell metacharacters work as expected. Returns up to three content blocks in this order: the status ( |
| ssh_read_fileA | Read a file from a remote host via SFTP. A whole-file read is limited to 10 MB. For a large file -- or behind a proxy that caps results, such as Yaw MCP at about 100 KB -- read it in pages with |
| ssh_write_fileA | Write content to a file on a remote host via SFTP. Creates or overwrites the file. If the connection pool is full (SSH_MCP_MAX_POOL_SIZE, default 100), waits up to 30s for a free slot before starting. NOT gated by SSH_MCP_COMMAND_WHITELIST / SSH_MCP_COMMAND_BLACKLIST: command policy applies only to the remote command-execution tools (single-host and multi-host), so a blacklist such as |
| ssh_uploadA | Upload a local file to a remote host via SFTP. Reads an arbitrary local file at an agent-chosen |
| ssh_downloadA | Download a file from a remote host to local filesystem via SFTP. If the connection pool is full (SSH_MCP_MAX_POOL_SIZE, default 100), waits up to 30s for a free slot before starting. |
| ssh_lsA | List files in a directory on a remote host via SFTP. If the connection pool is full (SSH_MCP_MAX_POOL_SIZE, default 100), waits up to 30s for a free slot before starting. |
| ssh_statA | Get metadata for a file or directory on a remote host via SFTP. Returns size, permissions (octal), uid/gid, mtime/atime, and the path type. Symlinks are reported as |
| ssh_mkdirA | Create a directory on a remote host via SFTP. Set |
| ssh_deleteA | Delete a file or empty directory on a remote host via SFTP. Auto-detects the path type and calls the right SFTP op (unlink for files/symlinks, rmdir for empty dirs). Recursive directory delete is intentionally NOT supported -- for that, run |
| ssh_diagnoseA | Diagnose SSH connectivity issues. Checks ssh-agent status, loaded keys, known_hosts, SSH config, and attempts a test connection. Use this BEFORE attempting SSH operations if you suspect connectivity issues, or AFTER a failed SSH operation to understand why it failed. |
| ssh_agent_ensureA | Ensure ssh-agent is running and reachable. Starts a new agent if needed and sets environment variables so subsequent SSH operations work. Use this FIRST when SSH operations fail with agent-related errors. |
| ssh_key_listA | List all SSH private keys in ~/.ssh/ with their type, fingerprint, and whether they are loaded in the agent. Use this to find which keys are available and which ones need to be loaded. Reports isError only when ~/.ssh exists but could not be read -- an absent or empty ~/.ssh is a successful answer with a ssh-keygen hint. |
| ssh_key_loadA | Load an SSH private key into the running agent. Ensures the agent is running first. Use this after listing local keys shows one that is not loaded. |
| ssh_config_lookupA | Resolve the effective SSH configuration for a host. Shows hostname, user, port, identity files, proxy settings, and all other options from ~/.ssh/config. Use this to understand how SSH will connect to a host. |
| ssh_known_hosts_fixA | Remove a stale host key from known_hosts and re-scan the host to add the current key. Use this when you see 'Host key verification failed' errors, typically after a server has been recreated or reprovisioned. |
| ssh_testA | Quick connectivity test to an SSH host. Reports success/failure with timing and actionable error details. Lighter and faster than a full SSH environment diagnosis — use this for a quick check before running operations. |
| ssh_git_checkA | Test Git-over-SSH authentication to a hosting provider (GitHub, GitLab, Bitbucket, etc). Verifies your SSH key is registered and working. Use this when git clone/pull/push fails with SSH errors. |
| ssh_multi_execA | Execute a command on multiple remote hosts in parallel. Runs at most SSH_MCP_MAX_POOL_SIZE hosts at once (default 100) and works through a longer list as slots free up. |
| ssh_findB | Search for files on a remote host. Wraps the find command with structured parameters so you don't have to construct find syntax manually. |
| ssh_tailA | Read the last N lines of a file on a remote host, optionally filtering by a grep pattern. Use this for reading log files instead of running tail/grep by hand as a remote shell command. |
| ssh_service_statusA | Check the status of a systemd service on a remote host. Returns whether it's active, its PID, uptime, and description. Use this instead of running systemctl as a remote shell command. |
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 21 tools
Each tool targets a distinct SSH resource or operation (exec, SFTP CRUD, key management, diagnostics, config), and descriptions explicitly cross-reference each other (e.g. ssh_test vs ssh_diagnose, ssh_find vs ssh_ls vs ssh_tail). The only real overlap is the diagnostic cluster (ssh_test / ssh_diagnose / ssh_agent_ensure / ssh_known_hosts_fix), which is adequately disambiguated by stated scope and ordering hints.
All 21 tools use a uniform snake_case `ssh_` prefix with no camelCase mixing. Most follow verb_noun (ssh_read_file, ssh_multi_exec, ssh_config_lookup), with a few noun_verb outliers (ssh_key_list, ssh_git_check, ssh_agent_ensure, ssh_known_hosts_fix) that are minor ordering deviations but still readable.
21 tools sits at the heavy end of the scale for a single server, even one covering as wide a surface as SSH. Every tool maps to a real operation, but several (ssh_test, ssh_tail, ssh_service_status) are thin convenience wrappers over ssh_exec/ssh_read_file, so the set feels broader than strictly necessary.
Core file lifecycle is well covered (read, write, delete, stat, ls, mkdir, find, upload, download) plus exec, multi-host exec, key/agent handling, and config lookup. Gaps exist — no rename/move, no chmod/chown, no service start/stop/restart (only status), and no remote-to-remote copy — but most are workaroundable via ssh_exec.