Curated ssh_probe diagnostics and single-host ssh_exec over an allowlisted SSH fleet.
io.github.inhuman/mcp-ssh-fleet MCP Server
This MCP server provides curated SSH probe diagnostics and supports executing commands on a single host via ssh_exec, scoped to an allowlisted SSH fleet. It is designed to work with an existing fleet of permitted targets, combining diagnostic-style probing with per-host command execution.
π οΈ Key Features
Curated ssh_probe diagnostics
Single-host ssh_exec
Operates over an allowlisted SSH fleet
π Use Cases
Running SSH diagnostics against permitted hosts
Executing targeted SSH commands on one host at a time
β‘ Developer Benefits
Clear separation of probing (ssh_probe) and execution (ssh_exec)
Safer operation by limiting access to an allowlisted fleet
β οΈ Limitations
Command execution is restricted to the allowlisted SSH fleet
MCP server that gives an agent two tools over SSH to a fleet of hosts outside
Kubernetes. The SSH key is a mounted secret (never enters model context); the
inventory is a fail-closed allowlist.
Tools
ssh_probe(tags, check) β curated read-only diagnostics on every host
carrying the given tags (AND semantics, like GitLab runner tags). check is
one of a built-in set: uptime, disk, mem, failed, logs. Arbitrary
commands cannot be passed. Class: read-only.
ssh_exec(host, command) β one arbitrary non-interactive command on ONE
inventory host (by name or address; hosts outside the inventory are refused).
Class: write-external: the server executes the command, while access gating
(approval/RBAC) belongs to the MCP client.
Both: output size cap, per-host timeout, TOFU host-key check (fingerprint in
logs), output as one section per host.
This is the shape MCP clients use when installing from the
MCP Registry
(io.github.inhuman/mcp-ssh-fleet).
Connecting an MCP client (http/sse)
By default the server speaks StreamableHTTP; register it as a regular HTTP MCP
server with endpoint /mcp (URL like http://<host>:8080/mcp). Both tools
become available to the client.
Client-side security recommendations:
ssh_probe is read-only (curated checks only) and can be granted broadly.
ssh_exec is arbitrary execution (write-external). Gate its access on the
client side (approval / RBAC / user allowlist) β the server merely executes a
command on an inventory host; it does not decide access policy.
Development
sh
make test# unit tests + e2e against a real in-process SSH server
make vet
make vulncheck
make build
make docker
Release: tag vX.Y.Z β GitHub Actions builds and publishes a multi-arch image
to ghcr.io/inhuman/mcp-ssh-fleet.
Install
Configuration
Environment variables
SSH_FLEET_TRANSPORTdefault stdio
MCP transport. Must be 'stdio' for direct docker/stdio use.
SSH_FLEET_CMD_TIMEOUT_SECONDSdefault 20
Per-host command timeout in seconds (1..600).
SSH_FLEET_OUTPUT_CAP_BYTESdefault 8192
Cap on output bytes per host section (>=256).
SSH_FLEET_PROBE_CONCURRENCYdefault 8
Parallelism for ssh_probe.
SSH_FLEET_PROBE_MAX_HOSTSdefault 50
Safety cap on the number of hosts in one probe.
SSH_FLEET_AUTH_TOKENsecret
Optional X-MCP-AUTH bearer token (only used by the http/sse transports).