SSH MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOG_LEVEL | No | Fallback, used only when `SSH_MCP_LOG_LEVEL` is unset | info |
| SSH_MCP_LOG_LEVEL | No | `debug`, `info`, `warn`, `error` | info |
| SSH_PROFILES_FILE | Yes | Path to the profiles JSON — **required** | |
| SSH_MCP_CONTROL_DIR | No | Where control sockets live | ~/.ssh/ssh-mcp |
| SSH_MCP_LOG_TIMESTAMP | No | Timestamps in log lines | true |
| SSH_MCP_PROFILES_WATCH | No | Reload the profiles file when it changes | true |
| SSH_MCP_CONTROL_PERSIST | No | Seconds a shared connection stays alive after the last command; `0` closes it at once | 600 |
| SSH_MCP_PROFILES_CACHE_TTL | No | Profile cache TTL, ms | 60000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
SSH to configured machines. Every call names a profile; there is no default.
Credentials — key, passphrase or password — live in the profiles and the server reads them itself, and so does the password sudo asks for where it asks for one. Never ask anyone for a secret; name the profile. When the person says "the server" without naming one, ask ssh_monitor action:list for the names instead of guessing: two profiles can point at the same address and differ only by name.
On a machine you have not touched yet: ssh_monitor action:test first — it names the state (ready, limited, no-route, rejected) before anything else runs.
Which tool for which question: run something ssh_exec — for what has no tool of its own slow work ssh_exec detach:true, then ssh_job_status, ssh_job_output, ssh_job_list, ssh_job_kill logs, any text search ssh_log_search to look for something, ssh_log_tail to read the end; a container is read by name, container: "web-1" files ssh_file_read to see inside, ssh_file_list to see what is there, ssh_file_write to put text there move bytes ssh_upload sends what is already on this machine, ssh_download fetches; text you can paste goes with ssh_file_write instead how it is doing ssh_snapshot — right now how it is set up ssh_audit_baseline — settings, not load; ssh_tls_check per domain something is wrong ssh_service_status for one unit, ssh_disk_breakdown for a full disk the connection ssh_monitor
Reach for the specific tool before ssh_exec: each batches round trips, parses the answer, verifies what it wrote, or says it could not check — where exec returns a blank that reads as zero.
A detached job is followed, not waited for: ssh_job_status names its state and shows the last lines it wrote, so every look says how far the work got. Look again when the work would have moved on. Never sleep on this side and never hold a call open to wait.
Answers put the outcome in structuredContent wherever a schema is declared, and its legend explains the words it uses. Read the fields; the text holds the detail.
Setup questions: ssh://profiles/current (what is configured here) and ssh://profiles/example (the shape of the file).
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ssh_execA | Runs one command or a list of them on a server, each with its own exit code, stdout and stderr. Work measured in minutes belongs in detach, not in a longer timeout. Reach for it last — files, logs, transfers, health and jobs each have a tool that batches the round trips and parses the answer. |
| ssh_file_readA | Reads text files from a server, several of them in one call. A file it could not read is named with the reason, never returned empty or cut short as if that were the content. To look for something inside logs rather than read them, ssh_log_search greps on the server. |
| ssh_file_writeA | Writes text files on a server, several in one call, each with its own path, permissions, owner and sudo. A file is replaced whole and never appears half-written; there is no append. For something that already exists on this machine, use ssh_upload. |
| ssh_file_listA | Lists a directory on a server: every entry with its size, mode, owner and modification time, as fields. A directory it was not allowed to enter is named rather than left out, and a listing cut short by the output limit says so. To see what is inside a file, use ssh_file_read. |
| ssh_job_statusA | Reports the state of a detached job, with the last lines it wrote so you can see where it got to. lost means no exit code was left behind, not that the work failed — ssh_job_output still has the output. |
| ssh_job_outputA | Returns what a detached job has written so far, stdout and stderr together, from a byte offset you choose. For whether the job is still running rather than what it printed, ssh_job_status answers in one line. |
| ssh_job_listA | Lists the detached jobs on a machine with their state, jobs started with sudo included — for when an id was not kept. Ids and states only; for what a job printed, use ssh_job_output. |
| ssh_job_killA | Stops a detached job and everything it started — the signal reaches the whole process group. A job that had already finished is reported as gone, not as a refusal. |
| ssh_log_tailA | Returns the last lines of one or more log files, whatever their size — nothing is shipped here to be trimmed locally. A container is read by name instead of by path, through the file its driver writes. To look for something rather than read the end, use ssh_log_search. |
| ssh_log_searchA | Greps log files on the server and returns the matching lines with their paths, or the paths alone when line bodies are not wanted. An empty answer means no match, never a failed search — files that could not be read are listed apart. For the tail of a file rather than a search through it, ssh_log_tail is cheaper. A container is searched by name instead of by path. |
| ssh_snapshotA | Reports how a machine is doing right now: cpu, memory, disk, containers, listening ports, services and recent errors, in one round trip. Whatever could not be measured comes back null and marked unavailable, never as a zero that reads like an idle machine. For how the machine is set up rather than how it is running, use ssh_audit_baseline. |
| ssh_monitorA | Looks after the SSH connections themselves, not the machines behind them: lists the configured profiles, tests one, reports pool statistics, closes a connection or reloads the profile file. Start here on a machine you have not used yet — test names the state before anything else runs. |
| ssh_uploadA | Copies a local file or directory to a server, checked by sha256 on both sides and never left half-written at the target. A directory replaces the target whole — whatever was there and is not in the source is gone with it; merge: true keeps it instead. For text you can paste, ssh_file_write is cheaper; piping base64 through ssh_exec truncates silently. |
| ssh_downloadA | Copies a file or directory from a server to this machine, checked by sha256 on both sides. To read a text file rather than keep it, ssh_file_read skips the disk. |
| ssh_audit_baselineA | Reports how a machine is set up: sshd, firewall, pending updates, failed services, docker, listening ports and disk, each section marked CRITICAL, WARNING or OK. Reads only, in one round trip instead of a dozen commands. For load and health at this moment rather than settings, use ssh_snapshot. |
| ssh_tls_checkA | Checks the TLS certificate a domain serves — days left, whether the name matches a SAN, the issuer and whether renewal is configured — with the handshake made from the server itself, so it sees what that machine sees, including hosts closed to the outside. A null field means the check could not run, not that the certificate is bad. Run it per domain, once ssh_audit_baseline has named the sites. |
| ssh_disk_breakdownA | Finds what filled a disk: free space per filesystem, the largest directories under each path given, and what docker, journald and package caches hold. Reads only, nothing is deleted. For how full the disks are at all, ssh_snapshot answers in one line. |
| ssh_service_statusA | Reports one systemd unit: whether it is loaded, active and enabled, with the tail of its journal. A machine without systemd comes back as NOT CHECKED, never as a stopped service — that would read as an outage which is not there. For every failed unit at once, ssh_audit_baseline names them. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Configured profiles | The machines this server can reach: name, host, port, user and whether the login uses a key or a password. No secret is included. Read it instead of asking anyone which servers exist. |
| Profiles file format | The shape of SSH_PROFILES_FILE with every field it accepts, and of the secrets file beside it. Read it before writing or editing a profile. |
TDQS
Scored across 18 tools
Each tool targets a distinct resource+action, and the descriptions explicitly cross-reference the nearest alternative (file_read vs log_search, snapshot vs audit_baseline, disk_breakdown vs snapshot, job_status vs job_output). The one broad tool, ssh_exec, is deliberately framed as a fallback ('reach for it last'), which resolves rather than creates overlap. An agent can pick the right tool without guessing.
All names are snake_case with a uniform ssh_ prefix and a resource-oriented structure (ssh_file_*, ssh_job_*, ssh_log_*), which makes families obvious. However the pattern mixes noun_verb (file_read, log_tail, job_list) with noun_noun (job_status, disk_breakdown, audit_baseline, service_status) and a few bare names (snapshot, monitor, upload, download), so it is not a single predictable convention.
18 tools is on the heavy side but each maps to a real, non-redundant capability across files, jobs, logs, health, auditing and connection management. Nothing looks like padding, though the surface leans toward the upper edge of comfortable for one server.
Coverage is broad: command execution, file read/write/list/upload/download, full detached-job lifecycle, log tail/search, health snapshots, baseline audit, TLS, disk and service inspection. The notable gaps are destructive file operations (no delete/move/rename) and service/package mutation (service_status is read-only, no restart), which an agent must fall back to ssh_exec for.