{
  "markdown": "# Safe SSH MCP Server\nA secure and scoped SSH MCP server for executing read-only diagnostic commands over SSH.  \nIn 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.\n\n## Badges\n[![Snyk Vulnerability Database report](https://snyk.io/advisor/images/snyk-poweredby.svg)](https://security.snyk.io/package/pip/safe-ssh-mcp) - security check  \n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/safe-ssh-mcp?period=total&units=ABBREVIATION&left_color=BLACK&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/safe-ssh-mcp)  \n\n## Overview\n\nThe 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.\n\n## Available Tools (Partial List)\n1. get_disk_free : `df -h`\n2. get_disk_usage : `find <path> -mindepth 1 -maxdepth 1 -exec du -sh -- {} + 2>/dev/null | sort -rh | head -n 20`\n3. get_dmesg : `dmesg`\n4. get_uptime : `uptime`\n5. get_current_datetime : `date`\n6. get_distroname_version : `cat /etc/os-release`\n7. get_systemd_list_all : `systemctl list-units --all --no-pager`\n8. get_systemd_list_failed : `systemctl list-units --state=failed --no-pager`\n9. get_systemd_list_timers : `systemctl list-timers --no-pager`\n10. get_crontab_tasks: `crontab -l`\n11. get_systemd_status : `systemctl status {daemon}`\n12. get_top : `top -b -n 1 -c`\n\nClick to open [full list of available tools](tools.md)  \n\n## Example of invocation\n`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?`\n\n## Means of connection\nThe server supports SSH account-password authentication and private-key\nauthentication. Configure the private-key passphrase source in\n`mcp_config.ini`:\n\n```ini\n# ENV_VAR (SSH_KEY_PASSPHRASE) or KEYCHAIN (ssh-agent)\nssh_key_passphrase_method=ENV_VAR\n```\n\n1. SSH account password: provide `password` to the MCP tool. Do not use this\n   for a private-key passphrase.\n2. Unprotected SSH key: use `key_path`. The default `ENV_VAR` setting also\n   supports unprotected keys; `SSH_KEY_PASSPHRASE` is not required.\n3. Passphrase-protected SSH key from an environment variable: leave\n   `ssh_key_passphrase_method=ENV_VAR`, set `SSH_KEY_PASSPHRASE` in the\n   environment that starts the MCP server, and provide `key_path`.\n\n   ```bash\n   export SSH_KEY_PASSPHRASE='your-key-passphrase'\n   safe-ssh-mcp\n   ```\n\n4. macOS Keychain / SSH agent: set\n   `ssh_key_passphrase_method=KEYCHAIN`, then unlock the key in the same user\n   session that starts the MCP server. The server receives SSH signatures from\n   `ssh-agent`; it does not read the key passphrase or the `key_path`.\n\n   ```bash\n   ssh-add --apple-use-keychain ~/.ssh/id_ed25519\n\n   # Optional: make the loaded identity expire after one hour.\n   ssh-add -t 1h ~/.ssh/id_ed25519\n\n   # Remove one identity, or clear every loaded identity.\n   ssh-add -d ~/.ssh/id_ed25519\n   ssh-add -D\n   ```\n\n5. Cursor launched from the macOS Dock: use `KEYCHAIN` (recommended). You can\n   run `ssh-add` from any Terminal window; it updates the SSH agent for your\n   macOS login session, so Cursor does not need to be started from that\n   Terminal.\n\n   ```bash\n   ssh-add --apple-use-keychain ~/.ssh/id_ed25519\n   ssh-add -l\n   ```\n\n   After changing `mcp_config.ini`, restart the MCP server in Cursor (or fully\n   quit and reopen Cursor). When invoking a tool in `KEYCHAIN` mode, omit\n   `key_path`; the agent selects from its loaded identities.\n\n   If you must use `ENV_VAR`, set it in the macOS launchd session before\n   opening Cursor from the Dock, then fully quit and reopen Cursor:\n\n   ```bash\n   launchctl setenv SSH_KEY_PASSPHRASE 'your-key-passphrase'\n   ```\n\n   This value lasts only for the current login session, and putting a\n   passphrase directly in a command may save it in shell history. Prefer\n   `KEYCHAIN`.\n\nFor `KEYCHAIN`, the MCP server must inherit `SSH_AUTH_SOCK` from that user\nsession. This is normally automatic for a stdio server started from a desktop\napplication. `ENV_VAR` stores the passphrase in the server process environment,\nso restrict access to the process and avoid putting it in source control.\n\n## [Changelog](CHANGELOG.md)\n\n## Project Contents\n1. mcp_ssh.py - the SSH MCP server\n2. mcp_config.ini - the server's config\n3. check_health_sse.py - check the server's tools and either it's up (sse transport)\n4. check_health_stdio.py - check the server's tools and either it's up (stdio transport)\n\n## Compatibility\nTested manually on Python3.11 running on MacOS against remote Ubuntu server  \nAutotested with Python 3.11 3.12 3.13 3.14  \n\n## The MCP Registry\nmcp-name: io.github.Areso/safe-ssh-mcp\n\n## The License\nThis project is licensed under the GNU AGPLv3 License.\n\n### Why AGPL?\nThis 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.\n\n### Note for Client Developers \nBecause 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.   \nYou 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.\n",
  "bytes": 5724,
  "sha": "30b185f746f777bf24a6a67c66d1884566fe35ac1d48fe6b4c260e66fab19b6d",
  "repo_slug": "areso/safe-ssh-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_areso_safe_ssh_mcp_8b0e0b20/readme"
}