Safe SSH MCP Server
A well-scoped SSH MCP server for executing read-only diagnostic commands over SSH.
In this project, "safe" refers specifically to the safety of the remote host: the server is designed to prevent modifications to the remote system and reduce the risk of operational harm. Secrets redaction is best-effort but not guaranteed, so keep that in mind with models that retain data or learn from it.
See SECURITY.md for the threat model and how to report a vulnerability.
Badges
Snyk Vulnerability Database report - security check


Overview
The core philosophy behind this MCP server is safety first. Instead of providing an AI agent with an unrestricted bash shell, this server exposes only carefully curated, read-only commands for system diagnostics and monitoring.
Feedback
Using safe-ssh-mcp? I'd love to hear from you.
Whether you're using it with Claude Code, Codex, Ollama, or another MCP client, please tell me what works and what doesn't. Even a two-sentence report is valuable.
Share it in GitHub Discussions.
Available Tools (Partial List)
A few examples from each group; <...> marks a validated parameter.
Start here
- get_host_overview : a first look in one call: identity, uptime, CPU, memory, pressure, disks, mount problems, failed units, top processes, listening sockets, journal errors. Each section is exactly the output of an existing tool; facts only, no thresholds or findings
Disk and filesystems
- get_disk_free :
df -h
- get_disk_usage :
find <path> -mindepth 1 -maxdepth 1 -exec du -sh -- {} + 2>/dev/null | sort -rh | head -n 20
- get_mounts :
findmnt (or cat /proc/mounts)
- get_fstab :
cat /etc/fstab
- get_mount_problems : fstab against
/proc/mounts and /proc/swaps (not mounted, read-only, swap off), then findmnt --verify
CPU, memory and processes
- get_top :
top -b -n 2 -d 1 -c -w 512, second sample, first 30 lines
- get_vmstat :
vmstat 1 5
- get_mpstat :
mpstat -P ALL 1 3 (per-core CPU), or computed from /proc/stat without sysstat
- get_iostat :
iostat -x -m -y 1 3 (per-disk await and %util), or computed from /proc/diskstats without sysstat
- get_pressure :
cat /proc/pressure/{cpu,io,memory}
- get_cpu_info :
lscpu (without flags), or a summary of /proc/cpuinfo where lscpu is missing
Systemd and logs
- get_systemd_list_failed :
systemctl list-units --state=failed --no-pager
- get_systemd_status :
systemctl status <daemon>
- get_journal_errors :
journalctl -p warning -n <lines> --no-pager
- get_journalctl_disk_usage :
journalctl --disk-usage
- get_dmesg :
dmesg
Network
- get_listening_sockets :
ss -tulpn
- get_ip_route :
ip route show and ip -6 route show
- get_ip_neigh :
ip [-s] -4 neigh show and ip [-s] -6 neigh show (the ARP / NDP table, like arp -a), or /proc/net/arp
- get_dns_lookup :
getent ahosts <name> or dig <name> <record_type>
- check_tcp_connect :
nc -vz -w 3 <target_host> <target_port>
- check_http :
curl -q -sS --fail -o /dev/null -w ... on <scheme>://<target_host>[:<target_port>]<path>: status, TLS check and timings, never the body (or wget --spider)
Docker
- get_docker_ps_all :
docker ps --all
- get_docker_logs :
docker logs --tail <lines> <container>
- get_docker_stats :
docker stats --no-stream
Kubernetes
- get_kubectl_events :
kubectl get events --sort-by=.lastTimestamp
- get_kubectl_logs :
kubectl logs --tail=<lines> --namespace=<namespace> <pod>
- get_crictl_ps :
crictl ps --all