# SSH MCP Server

> SSH MCP Server is an open-source MCP server for developer tools. Fix and use SSH from an agent: manage keys, diagnose failures, run remote commands. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows
- **Website:** https://yaw.sh/mcp-servers/ssh-mcp/
- **Repository:** https://github.com/yawlabs/ssh-mcp
- **MCP Registry name:** io.github.YawLabs/ssh-mcp
- **Categories:** developer tools, cloud and infrastructure
- **Listing updated:** 2026-11-14

## About

AI coding tools often run in subprocesses where SSH quietly breaks: a stale agent socket, a key that exists but is not loaded, or a host key that changed after an instance was recreated. This server gives the agent tools to see why instead of guessing. Its worked examples include a failing git pull traced through ssh_git_check, ssh_key_list and ssh_key_load.

Environment tools start the agent, list keys with fingerprints, resolve the effective config for a host, and fix known_hosts (the one tool that writes it). Remote tools run a command, run one across many hosts in parallel, and tail the last lines of a log with an optional grep. The README also lists file transfer and key management.

It reuses your existing SSH setup, so no API key is needed. Package: @yawlabs/ssh-mcp from Yaw Labs, MIT licensed.

## Features

- **Failure diagnosis:** Full SSH environment check with actionable fix commands.
- **Agent and key handling:** Starts ssh-agent, lists and loads keys.
- **Git-over-SSH test:** Checks auth to GitHub, GitLab and Bitbucket.
- **Parallel remote commands:** Runs one command on many hosts at once.
- **Log tailing:** Reads the last N lines with optional grep.
- **Host key repair:** Removes a stale entry and re-scans.

## Good for

- Work out why git pull fails with a publickey error
- Recover from a changed host key
- Check disk space across web servers
- Tail a remote log without improvising a pipeline

## Install

### Claude Code (Terminal)

```sh
claude mcp add ssh-mcp -- npx -y @yawlabs/ssh-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "ssh-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ssh-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "ssh-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ssh-mcp"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "ssh-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ssh-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "ssh-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ssh-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "ssh-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/ssh-mcp"
      ]
    }
  }
}
```

## Tools

- `ssh_agent_ensure`: Ensures ssh-agent is running.
- `ssh_key_list`: Lists keys in ~/.ssh with type, fingerprint and agent status.
- `ssh_key_load`: Loads a key into the agent.
- `ssh_config_lookup`: Resolves effective SSH config for a host.
- `ssh_known_hosts_fix`: Removes a stale host key and re-scans.
- `ssh_git_check`: Tests Git-over-SSH auth.
- `ssh_test`: Quick connectivity test.
- `ssh_diagnose`: Full SSH environment diagnostic.
- `ssh_exec`: Runs a remote command.
- `ssh_multi_exec`: Runs one command on many hosts in parallel.
- `ssh_tail`: Reads the last lines of a remote file with optional grep.

## FAQ

### Does it need an API key?

No, it uses your existing SSH configuration.

### Which tool edits known_hosts?

Only ssh_known_hosts_fix.

### How do I pin a version?

Install globally with npm and set the command to ssh-mcp.

### What about Windows?

Wrap the npx call in cmd /c, because Node 20+ cannot spawn .cmd files directly.

### Is SSH MCP Server free?

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

### How do I add SSH MCP Server to Claude Code?

Run this command in your terminal: claude mcp add ssh-mcp -- npx -y @yawlabs/ssh-mcp

### What are the best alternatives to SSH MCP Server?

The closest alternatives to SSH MCP Server are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [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-2): 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.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/ssh-mcp-server-2
