# SSH MCP Server

Manages keys and background agent processes, inspects connection errors, and runs commands or SFTP transfers on remote servers. Helpful when Git or deploy steps fail inside agent subshells.

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

## What it does

AI coding agents running in background subprocesses frequently fail on network tasks. Stale agent sockets, changed host fingerprints, and missing credentials break `git clone`, package installations, or remote deployments. This server manages background credentials, verifies repository access, and clears invalid `known_hosts` entries directly through MCP tool calls.

For remote machines, the package provides execution tools like `ssh_exec` and parallel runs via `ssh_multi_exec`. File handling relies on SFTP for directory creation, metadata checks, and transfers up to 10 MB with chunk offsets. The SFTP implementation avoids shell expansion, so paths like `~` are not parsed, and directory deletion only removes empty folders. When any remote operation fails, built-in diagnostic tools run automatically and attach the fix to the error output.

On Windows systems running Node 20 or higher, configuration entries must invoke `cmd /c` before `npx`, because the runtime cannot spawn `.cmd` binaries directly.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add ssh-mcp -- npx -y @yawlabs/ssh-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add ssh-mcp-server -- npx -y @yawlabs/ssh-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "ssh-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@yawlabs/ssh-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "ssh-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@yawlabs/ssh-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add ssh-mcp-server npx -y @yawlabs/ssh-mcp
```

## When to use it
- start ssh-agent and load private keys inside agent subprocesses
- fix host key verification errors after server recreation
- transfer and inspect files over SFTP with structured metadata parsing
- run parallel shell commands across several remote hosts at once

## Example prompts
- Check our SSH connection to GitHub and start the agent if the socket is missing
- Inspect the systemd unit status on prod-app using `ssh_service_status`
- Fetch the last 50 lines from the staging log file with `ssh_tail`

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [Oh My Posh Validator](https://affpapa.org/en/nevibecode/mcp/oh-my-posh-validator.md) — MCP server · ★ 23654
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18779
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17191
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12110

## Other versions with the same name
- [SSH MCP Server · hypnosis](https://affpapa.org/en/nevibecode/mcp/hypnosis-ssh-mcp-server.md) — ★ 6

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