# Safe Ssh MCP

> Safe Ssh MCP is an open-source MCP server for cloud and infrastructure. Read-only SSH diagnostics for AI agents: disk, processes, logs, Docker and Kubernetes. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** macOS, Linux, CLI
- **Repository:** https://github.com/areso/safe-ssh-mcp
- **MCP Registry name:** io.github.Areso/safe-ssh-mcp
- **Categories:** [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

The design choice here is what is left out. Instead of handing an agent a shell, the server exposes only curated commands, each mapped to a fixed read-only command line with validated parameters, such as df -h, journalctl, ss -tulpn or docker logs. The README is careful about meaning: safe refers to host safety, preventing modification of the remote system, and does not guarantee that command output can't be misused by an agent.

Tools are grouped by area. Disk and filesystems, CPU and memory, systemd and logs, network checks including DNS lookup and TCP connect tests, Docker, Kubernetes with kubectl and crictl, and system information such as OS version, installed packages, failed logins and core dumps. The README gives only a partial list, with the full list in tools.md.

Authentication supports an account password, an unprotected key by path, a passphrase-protected key via the SSH_KEY_PASSPHRASE variable, or ssh-agent through the macOS Keychain, the recommended option for Cursor launched from the Dock. The package is on PyPI, tested manually on macOS against Ubuntu and automatically on Python 3.11 to 3.14, and licensed under AGPLv3, which the README says does not restrict connecting proprietary clients.

## Features

- **Curated read-only commands:** Each tool maps to a fixed command with validated parameters.
- **Systemd and journal checks:** Lists failed units, service status and recent warnings.
- **Container diagnostics:** Reads Docker and Kubernetes logs, events and container state.
- **Network probes:** Shows listening sockets, routes, DNS lookups and TCP reachability.
- **Flexible SSH auth:** Works with password, key file, passphrase variable or ssh-agent.
- **Login and crash checks:** Shows failed logins and core dump lists.

## Good for

- Ask an assistant why disk space is running low on a server
- Check failed systemd services after a deploy
- Read recent container logs without giving shell access
- Test whether a host can reach another port
- Review warnings in the journal

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add safe-ssh-mcp -- uvx safe-ssh-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add safe-ssh-mcp -- uvx safe-ssh-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.safe-ssh-mcp]
command = "uvx"
args = ["safe-ssh-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user safe-ssh-mcp uvx -- safe-ssh-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "safe-ssh-mcp": {
      "command": "uvx",
      "args": [
        "safe-ssh-mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, all 24 tools only read data. From the server's own tool labels and tool names; not verified by us.

- `get_disk_free` (name suggests: reads): Runs df -h.
- `get_disk_usage` (name suggests: reads): Lists the largest items in a directory.
- `get_mounts` (name suggests: reads): Lists mounts.
- `get_top` (name suggests: reads): Shows a top snapshot.
- `get_vmstat` (name suggests: reads): Shows vmstat output.
- `get_pressure` (name suggests: reads): Reads pressure stall information.
- `get_systemd_list_failed` (name suggests: reads): Lists failed systemd units.
- `get_systemd_status` (name suggests: reads): Shows the status of a daemon.
- `get_journal_errors` (name suggests: reads): Shows recent journal warnings and errors.
- `get_dmesg` (name suggests: reads): Shows kernel messages.
- `get_listening_sockets` (name suggests: reads): Lists listening sockets.
- `get_ip_route` (name suggests: reads): Shows IPv4 and IPv6 routes.
- `get_dns_lookup` (name suggests: reads): Resolves a name.
- `check_tcp_connect` (name suggests: reads): Tests a TCP connection to a host and port.
- `get_docker_ps_all` (name suggests: reads): Lists all Docker containers.
- `get_docker_logs` (name suggests: reads): Shows recent container logs.
- `get_docker_stats` (name suggests: reads): Shows a Docker stats snapshot.
- `get_kubectl_events` (name suggests: reads): Lists Kubernetes events.
- `get_kubectl_logs` (name suggests: reads): Shows pod logs.
- `get_crictl_ps` (name suggests: reads): Lists containers via crictl.
- `get_distroname_version` (name suggests: reads): Reads the OS release.
- `get_installed_packages` (name suggests: reads): Lists installed packages.
- `get_failed_logins` (name suggests: reads): Lists failed logins.
- `get_coredumps` (name suggests: reads): Lists core dumps.

## FAQ

### Can an agent change the remote server?

The design allows only read-only diagnostic commands, though the README says safe refers to host safety, not output misuse.

### How does authentication work?

It supports an SSH password, a key by path, a passphrase from SSH_KEY_PASSPHRASE or ssh-agent via the macOS Keychain.

### What licence is Safe Ssh MCP under?

GNU AGPLv3. The README says this does not restrict connecting closed-source MCP clients.

### What Python versions are tested?

Python 3.11, 3.12, 3.13 and 3.14 automatically, and 3.11 on macOS manually.

### Is Safe Ssh MCP free?

Yes. Safe Ssh MCP is open source, so you can use and self-host it for free.

### How do I add Safe Ssh MCP to Claude Code?

Run this command in your terminal: claude mcp add safe-ssh-mcp -- uvx safe-ssh-mcp

### What are the best alternatives to Safe Ssh MCP?

The closest alternatives to Safe Ssh MCP are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/safe-ssh-mcp
