# safe-ssh-mcp

This MCP server connects to remote hosts over SSH and exposes scoped read-only diagnostics. Use it to inspect disks, systemd, cron, and system state.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8
- Author: Areso
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Areso/safe-ssh-mcp
- Updated: 2026-08-19
- HTML: https://affpapa.org/en/nevibecode/mcp/safe-ssh-mcp

## What it does

safe-ssh-mcp gives an agent a curated set of SSH tools rather than an unrestricted shell. Available checks cover disk capacity and usage, `dmesg`, uptime, time, `/etc/os-release`, `systemd` units and timers, `crontab`, and a one-shot `top` view.

The server accepts an SSH account password or a private key. Passphrase handling is configured in `mcp_config.ini`: `ENV_VAR` reads `SSH_KEY_PASSPHRASE`, while `KEYCHAIN` uses signatures from `ssh-agent`. The project is tested with Python 3.11, 3.12, 3.13, and 3.14, including a remote Ubuntu server.

Its safety boundary is host-side: the exposed commands are intended to avoid remote modifications. It does not ensure that an external agent will use command output safely, so sensitive diagnostics still need care.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add safe-ssh-mcp -- uvx safe-ssh-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from safe-ssh-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add safe-ssh-mcp -- uvx safe-ssh-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from safe-ssh-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "safe-ssh-mcp": {
            "command": "uvx",
            "args": [
                "safe-ssh-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from safe-ssh-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "safe-ssh-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "safe-ssh-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from safe-ssh-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add safe-ssh-mcp uvx safe-ssh-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from safe-ssh-mcp <command>

## When to use it
- inspect free space on a remote host
- locate directories consuming disk space
- find failed `systemd` units
- review timers and `cron` jobs
- capture a one-shot system load snapshot

## Example prompts
- Check disk space on `myserver.mydomain.pro` through `safe-ssh-mcp` and report the largest paths.
- List failed `systemd` units on the remote host and show their statuses.
- Inspect `/root/` usage over SSH with the key at `~/.ssh/id_rsa`.

## Similar
- [ssh](https://affpapa.org/en/nevibecode/skills/dicklesworthstone-ssh.md) — skill · 703 installs
- [ssh-configuration](https://affpapa.org/en/nevibecode/skills/ssh-configuration.md) — skill · 451 installs
- [mcp-ssh-manager](https://affpapa.org/en/nevibecode/mcp/mcp-ssh-manager.md) — MCP server · ★ 520
- [SSH — policy-gated remote access](https://affpapa.org/en/nevibecode/mcp/ssh-policy-gated-remote-access.md) — MCP server · ★ 834
- [infrabroker](https://affpapa.org/en/nevibecode/mcp/infrabroker.md) — MCP server · ★ 13

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
