Safe Ssh MCP logo

Safe Ssh MCP

A secured scoped SSH MCP server for executing safe read-only diagnostic DevOps / SysOps commands

Install Safe Ssh MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 56 tools correctly ().

Overview

Tools56

What Safe Ssh MCP lets your agent do. Expand a tool for its parameters.

Verified live~11.6k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

19/20 checks healthy over the last 111d

What it can do

From the 56 tools this server returned when we ran it.

Runs commands · 2Handles credentials · 43Read-only tools · 54
Tool definitions changed on 2026-11-20. Review them if you approved this server earlier.
Network at startup2 connections
Files written at startup25

Observed 2026-11-20 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · safe-ssh-mcp (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars9Stargazers on the source repository.
Last commit4d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed56Callable tools this server registers over MCP.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

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
PyPI Downloads
Areso/safe-ssh-mcp MCP server

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

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>/exe and /proc/<pid>/maps of every process, with the package that owns each file
  • get_process_info : one process by pid and/or name: ps (state, elapsed time, threads, wait channel, command line), /proc/<pid>/status, cgroup, open files against limits, oom_score, io (command line redacted; never the environment)
  • 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:

ini
# ENV_VAR (SSH_KEY_PASSPHRASE) or KEYCHAIN (ssh-agent)
ssh_key_passphrase_method=ENV_VAR
  1. SSH account password: provide password to the MCP tool. Do not use this for a private-key passphrase.

  2. Unprotected SSH key: use key_path. The default ENV_VAR setting also supports unprotected keys; SSH_KEY_PASSPHRASE is not required.

  3. Passphrase-protected SSH key from an environment variable: leave ssh_key_passphrase_method=ENV_VAR, set SSH_KEY_PASSPHRASE in the environment that starts the MCP server, and provide key_path.

    server.ts
    export SSH_KEY_PASSPHRASE='your-key-passphrase'
    safe-ssh-mcp
    
  4. 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 from ssh-agent; it does not read the key passphrase or the key_path.

    bash
    ssh-add --apple-use-keychain ~/.ssh/id_ed25519
    
    # Optional: make the loaded identity expire after one hour.
    ssh-add -t 1h ~/.ssh/id_ed25519
    
    # Remove one identity, or clear every loaded identity.
    ssh-add -d ~/.ssh/id_ed25519
    ssh-add -D
    
  5. Cursor launched from the macOS Dock: use KEYCHAIN (recommended). You can run ssh-add from any Terminal window; it updates the SSH agent for your macOS login session, so Cursor does not need to be started from that Terminal.

    bash
    ssh-add --apple-use-keychain ~/.ssh/id_ed25519
    ssh-add -l
    

    After changing mcp_config.ini, restart the MCP server in Cursor (or fully quit and reopen Cursor). When invoking a tool in KEYCHAIN mode, omit key_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:

    bash
    launchctl setenv SSH_KEY_PASSPHRASE 'your-key-passphrase'
    

    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

  1. mcp_ssh.py - the SSH MCP server
  2. mcp_config.ini - the server's config
  3. check_health_sse.py - check the server's tools and either it's up (sse transport)
  4. check_health_stdio.py - check the server's tools and either it's up (stdio transport)

Compatibility

Remote hosts. Besides the unit tests, the tools are checked live against disposable VMs (scripts/ab_test/, scripts/redaction_test/, scripts/socket_load/):

DistroLogin userWhat it covers
Ubuntu 24.04rootsystemd, dpkg, docker
Debian 13rootsystemd, dpkg, docker
Fedora 44rootsystemd, rpm
CentOS Stream 10rootsystemd, rpm, RHEL-family tooling
Alpine 3.24unprivileged, doas -nBusyBox, no systemd, apk, no bash
Ubuntu + kubeadmrootkubectl and crictl against a real cluster

Hosts need only sh and the usual base tools: where a tool is missing (sysstat, ss, lscpu, pciutils, usbutils, GNU timeout), the tool falls back to /proc, /sys, netstat or BusyBox.

The server. Unit tests run in CI on Python 3.11, 3.12, 3.13, 3.14 and 3.15 (Linux). Tested manually on macOS with Python 3.11.

MCP clients. Any client that speaks MCP over stdio, SSE or streamable HTTP. Used day to day with Claude Code. Setup notes above for Cursor; an example config for Cline in cline_mcp_settings.json.

STDIO vs HTTP/SSE

The default transport is stdio: the MCP client starts the server as a local process, and nothing listens on the network.

The HTTP transports (streamable-http, sse; set in mcp_config.ini) are meant to run behind a reverse proxy, which handles authentication and TLS (mTLS, OIDC, or basic auth over TLS, whatever your setup uses).
The server itself does not authenticate requests, so it binds to 127.0.0.1 by default: expose it only through the proxy, as its callers get the use of this server's SSH keys.

The MCP Registry

mcp-name: io.github.Areso/safe-ssh-mcp

The License

This project is licensed under the GNU AGPLv3 License.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Safe Ssh MCP

safe-ssh-mcp is an MCP server that provides scoped SSH access for curated read-only diagnostic DevOps and SysOps commands on remote hosts. It can query disk space and usage, system status, kernel messages, uptime, OS version, timers, cron tasks, and process activity. It is designed to prevent remote system modifications, but does not guarantee command output cannot be misused by external agents.

No, safe-ssh-mcp does not provide an unrestricted bash shell; it exposes carefully curated, read-only diagnostic commands intended to reduce the risk of operational harm to remote systems.

safe-ssh-mcp supports diagnostics such as disk free space, disk usage, kernel messages with dmesg, uptime, current date and time, operating-system details, systemd units, failed services, timers, crontab tasks, service status, and a one-time top process view.

safe-ssh-mcp supports SSH account-password authentication and private-key authentication. Private keys can be unprotected, protected with a passphrase supplied through the SSH_KEY_PASSPHRASE environment variable, or accessed through macOS Keychain and ssh-agent with the KEYCHAIN configuration.

No, its safety scope is specifically host safety: the server is designed to prevent modifications to the remote system and reduce operational risk. It does not guarantee that command output cannot be misused by external agents.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSafe Ssh MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/safe-ssh-mcp?style=directory)](https://allmcps.com/mcp/safe-ssh-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/safe-ssh-mcp"><img src="https://allmcps.com/api/badge/safe-ssh-mcp?style=directory" alt="Safe Ssh MCP on AllMCPs" /></a>