# ssh

This MCP server connects an AI agent to a remote host over SSH for commands, directory browsing, and SFTP transfers. It can use an SSH agent.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 81
- Author: pulsemcp
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pulsemcp/mcp-servers/tree/HEAD/experimental/ssh
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/mcp/ssh

## What it does

The server exposes an SSH connection to an AI agent. It can report connection details, list remote directories, download and upload files through SFTP, and run shell commands on the remote host. `SSH_HOST` and `SSH_USERNAME` are required for a connection.

Authentication uses the SSH agent through `SSH_AUTH_SOCK` first. If the agent is unavailable, the server can use `SSH_PRIVATE_KEY_PATH` instead. A startup health check tests the connection and reports common configuration problems. Set `ENABLED_TOOLGROUPS` to limit access: `readonly` permits browsing and downloads, `write` adds uploads, and `admin` includes command execution. The server runs with `npx -y ssh-agent-mcp-server`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `SSH_HOST`, `SSH_USERNAME`, `SSH_PORT`, `SSH_AUTH_SOCK`, `SSH_PRIVATE_KEY_PATH`, `SSH_PASSPHRASE`, `SSH_TIMEOUT`, `SSH_COMMAND_TIMEOUT`, `ENABLED_TOOLGROUPS`, `SKIP_HEALTH_CHECKS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env SSH_HOST=<SSH_HOST> --env SSH_USERNAME=<SSH_USERNAME> --env SSH_PORT=<SSH_PORT> --env SSH_AUTH_SOCK=<SSH_AUTH_SOCK> --env SSH_PRIVATE_KEY_PATH=<SSH_PRIVATE_KEY_PATH> --transport stdio ssh -- npx -y ssh-agent-mcp-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add ssh --env SSH_HOST=<SSH_HOST> --env SSH_USERNAME=<SSH_USERNAME> --env SSH_PORT=<SSH_PORT> --env SSH_AUTH_SOCK=<SSH_AUTH_SOCK> --env SSH_PRIVATE_KEY_PATH=<SSH_PRIVATE_KEY_PATH> -- npx -y ssh-agent-mcp-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "ssh": {
            "command": "npx",
            "args": [
                "-y",
                "ssh-agent-mcp-server"
            ],
            "env": {
                "SSH_HOST": "<SSH_HOST>",
                "SSH_USERNAME": "<SSH_USERNAME>",
                "SSH_PORT": "<SSH_PORT>",
                "SSH_AUTH_SOCK": "<SSH_AUTH_SOCK>",
                "SSH_PRIVATE_KEY_PATH": "<SSH_PRIVATE_KEY_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "ssh": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "ssh-agent-mcp-server"
            ],
            "env": {
                "SSH_HOST": "<SSH_HOST>",
                "SSH_USERNAME": "<SSH_USERNAME>",
                "SSH_PORT": "<SSH_PORT>",
                "SSH_AUTH_SOCK": "<SSH_AUTH_SOCK>",
                "SSH_PRIVATE_KEY_PATH": "<SSH_PRIVATE_KEY_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e SSH_HOST=<SSH_HOST> -e SSH_USERNAME=<SSH_USERNAME> -e SSH_PORT=<SSH_PORT> -e SSH_AUTH_SOCK=<SSH_AUTH_SOCK> -e SSH_PRIVATE_KEY_PATH=<SSH_PRIVATE_KEY_PATH> ssh npx -y ssh-agent-mcp-server
```
Replace <…> with your own values. 6 more environment variables are in the server README

## When to use it
- connect an agent to a remote SSH host
- run a shell command on a remote machine
- browse a remote directory
- download a file through SFTP
- upload a file to the server

## Example prompts
- Check the connection and report the result with `ssh_connection_info`.
- List the contents of the remote directory with `ssh_list_directory`.
- Run `git status` on the remote host with `ssh_execute`.

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Oh My Posh Validator](https://affpapa.org/en/nevibecode/mcp/oh-my-posh-validator.md) — MCP server · ★ 23643
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17160
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12109

From the same set: [pulsemcp/mcp-servers](https://affpapa.org/en/nevibecode/by/pulsemcp/mcp-servers.md) — 17 cards

---
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
