
Safe Ssh Mcp
io.github.AresoPublished by GitHub account Aresov0.2.3Updated Nov 17, 2026
A secured scoped SSH MCP server for executing safe read-only diagnostic DevOps / SysOps commands
Overview
A scoped SSH MCP server that lets an assistant run curated read-only diagnostic commands on remote Linux hosts for DevOps and SysOps troubleshooting.
- What you can do
- Inspect disk, filesystem and mount usage on a remote host
- Read CPU, memory, pressure, process and vmstat metrics
- Check systemd units, journal errors, dmesg, failed logins and coredumps
- Inspect network state: listening sockets, routes, DNS lookups and TCP reachability
- Review Docker containers, logs and stats, and Kubernetes events, pod logs and crictl state
- Report OS version, installed packages and the files behind running processes
- When to use it
- Useful when you want an assistant to diagnose a remote Linux server without handing it a general-purpose shell: checking why a service failed, what fills a disk, whether a port is reachable, or what a container or pod is logging.
- Requirements
- Runs as a local Python process (PyPI package safe-ssh-mcp, tested on Python 3.11-3.14, desktop only). Needs network access to the target host and SSH credentials: an account password passed to the tool, an unprotected key via key_path, or a passphrase-protected key via the SSH_KEY_PASSPHRASE environment variable or the macOS Keychain/ssh-agent (SSH_AUTH_SOCK). Passphrase source is set in mcp_config.ini.
Installation
In SourceWeft
- Open Safe Ssh Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Safe SSH MCP Server
A secure and scoped SSH MCP server for executing read-only diagnostic commands over SSH.
In this project, "safe" refers specifically to host safety: the server is designed to prevent modifications to the remote system and reduce the risk of operational harm. It does NOT attempt to guarantee that command output cannot be misused by external agents.
Badges
Snyk Vulnerability Database report - security check
[PyPI Downloads]
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
Hi there! 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(orcat /proc/mounts) - get_fstab :
cat /etc/fstab - get_mount_problems : fstab against
/proc/mountsand/proc/swaps(not mounted, read-only, swap off), thenfindmnt --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/statwithout sysstat - get_iostat :
iostat -x -m -y 1 3(per-disk await and %util), or computed from/proc/diskstatswithout sysstat - get_pressure :
cat /proc/pressure/{cpu,io,memory} - get_cpu_info :
lscpu(without flags), or a summary of/proc/cpuinfowhere 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 showandip -6 route show - get_dns_lookup :
getent ahosts <name>ordig <name> <record_type> - check_tcp_connect :
nc -vz -w 3 <target_host> <target_port>
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
System, logins and crashes
- get_distroname_version :
cat /etc/os-release - get_installed_packages :
dpkg-query -W(with source package),rpm -qa --qf(with epoch and source RPM) or/lib/apk/db/installed(with origin) - get_process_files :
/proc/<pid>/exeand/proc/<pid>/mapsof every process, with the package that owns each file - get_failed_logins :
lastb -F -n <lines> - get_coredumps :
coredumpctl list --no-pager - get_cron_jobs :
/etc/crontab,/etc/cron.d/*and every user's crontab (secrets redacted), with a check that a cron daemon runs
Click to open full list of available tools
Example of invocation
okay, could u check disk usage on /root/ path with help of safe-ssh-mcp server on a remote myserver.mydomain.pro using root and /Users/myUser/.ssh/id_rsa to login?
Means of connection
The server supports SSH account-password authentication and private-key
authentication. Configure the private-key passphrase source in
mcp_config.ini:
-
SSH account password: provide
passwordto the MCP tool. Do not use this for a private-key passphrase. -
Unprotected SSH key: use
key_path. The defaultENV_VARsetting also supports unprotected keys;SSH_KEY_PASSPHRASEis not required. -
Passphrase-protected SSH key from an environment variable: leave
ssh_key_passphrase_method=ENV_VAR, setSSH_KEY_PASSPHRASEin the environment that starts the MCP server, and providekey_path. -
macOS Keychain / SSH agent: set
ssh_key_passphrase_method=KEYCHAIN, then unlock the key in the same user session that starts the MCP server. The server receives SSH signatures fromssh-agent; it does not read the key passphrase or thekey_path. -
Cursor launched from the macOS Dock: use
KEYCHAIN(recommended). You can runssh-addfrom any Terminal window; it updates the SSH agent for your macOS login session, so Cursor does not need to be started from that Terminal.After changing
mcp_config.ini, restart the MCP server in Cursor (or fully quit and reopen Cursor). When invoking a tool inKEYCHAINmode, omitkey_path; the agent selects from its loaded identities.If you must use
ENV_VAR, set it in the macOS launchd session before opening Cursor from the Dock, then fully quit and reopen Cursor:This value lasts only for the current login session, and putting a passphrase directly in a command may save it in shell history. Prefer
KEYCHAIN.
For KEYCHAIN, the MCP server must inherit SSH_AUTH_SOCK from that user
session. This is normally automatic for a stdio server started from a desktop
application. ENV_VAR stores the passphrase in the server process environment,
so restrict access to the process and avoid putting it in source control.
Changelog
Project Contents
- mcp_ssh.py - the SSH MCP server
- mcp_config.ini - the server's config
- check_health_sse.py - check the server's tools and either it's up (sse transport)
- check_health_stdio.py - check the server's tools and either it's up (stdio transport)
Compatibility
Tested manually on Python3.11 running on MacOS against remote Ubuntu server
Autotested with Python 3.11 3.12 3.13 3.14 3.15
The MCP Registry
mcp-name: io.github.Areso/safe-ssh-mcp
The License
This project is licensed under the GNU AGPLv3 License.
Why AGPL?
This server acts as core infrastructure and contains no business logic. By using the AGPL license, we ensure that any security improvements, bug fixes, or new diagnostic tools added to the server are shared back with the open-source community.
Note for Client Developers
Because MCP clients communicate with this server via standard Inter-Process Communication (IPC) or network protocols (like HTTP/SSE), the AGPL license does not "infect" or restrict the client applications connecting to it.
You can safely connect proprietary, closed-source, or permissively licensed (e.g., MIT, Apache 2.0) AI agents to this server without violating the license terms.
Source: README.md at commit 492608e
Tools
0Version history
4- v0.2.3LatestNov 17, 2026
- v0.2.1Nov 15, 2026
- v0.2.0Nov 13, 2026
- v0.1.15Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
