# ssh MCP server

> Provides a centralized HTTP gateway for AI agents to perform controlled SSH commands and SFTP file transfers with audit logging and command policies.

- Repository: https://github.com/gelse/ssh-mcp
- Page: https://hostedmcp.org/servers/gelse/ssh-mcp
- Transport: remote
- Stars: 8
- License: MIT
- Latest version: 0.3.0

## Install

### Claude Code

```sh
claude mcp add --env CONFIG_API_TOKEN=<YOUR_CONFIG_API_TOKEN> ssh-mcp -- docker run -i --rm ghcr.io/gelse/ssh-mcp:0.3.0
```

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

```json
{
  "mcpServers": {
    "ssh-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gelse/ssh-mcp:0.3.0"
      ],
      "env": {
        "CONFIG_API_TOKEN": "<YOUR_CONFIG_API_TOKEN>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "ssh-mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gelse/ssh-mcp:0.3.0"
      ],
      "env": {
        "CONFIG_API_TOKEN": "<YOUR_CONFIG_API_TOKEN>"
      }
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "ssh-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gelse/ssh-mcp:0.3.0"
      ],
      "env": {
        "CONFIG_API_TOKEN": "<YOUR_CONFIG_API_TOKEN>"
      }
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.ssh-mcp]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/gelse/ssh-mcp:0.3.0"]

[mcp_servers.ssh-mcp.env]
CONFIG_API_TOKEN = "<YOUR_CONFIG_API_TOKEN>"
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "ssh-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/gelse/ssh-mcp:0.3.0"
      ],
      "env": {
        "CONFIG_API_TOKEN": "<YOUR_CONFIG_API_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CONFIG_API_TOKEN` | no | yes | Bearer token for the configuration API |
| `CONFIG_API_ENABLED` | no | no | Enable the configuration REST API and web dashboard |
| `CONFIG_DIR` | no | no | Directory containing ssh-mcp-config.json |
| `LOG_DIR` | no | no | Directory for JSONL audit logs |

## Tools (6)

- `ssh_list_servers`
- `ssh_list_allowed_commands`
- `ssh_execute_command`
- `ssh_check_connection`
- `ssh_download_file`
- `ssh_upload_file`

## FAQ

### How do MCP clients connect?

Clients connect to the server using the Streamable HTTP transport at the specified host and port, passing an API key in the header.

### Does it support interactive shells?

No, the server is not an interactive shell; commands are executed individually with structured output.

### How does hot reload work?

The configuration file is polled every 15 seconds with a 2-second debounce, allowing changes to take effect without a restart.
