# Repository Briefing: tufantunc/ssh-mcp
> Source: https://repoforai.com/repo/tufantunc/ssh-mcp (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/tufantunc/ssh-mcp
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A+ (94/100 · Maintenance 35/35 · Adoption 19/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v2.30.0 (2026-12-01) — https://github.com/tufantunc/ssh-mcp/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP, CLI
- **Momentum**: 923 ★ total (+1 24h / +14 7d) · 146 forks
- **When to Use**: Best for: Platform and operations teams that want Claude Code or another MCP client to inspect logs, run approved commands, or transfer files on managed hosts through least-privilege SSH profiles. Skip if: Your automation is already a fixed runbook, you need stateful Windows shell sessions, or your security model requires eliminating agent-driven remote shell access rather than constraining it.

## Overview
```text
### Architecture & Core Mechanics
ssh-mcp is a TypeScript MCP-to-SSH gateway with a `ssh-mcp` CLI entry point. `@modelcontextprotocol/sdk` provides the MCP layer, `ssh2` handles remote connections, and the manifest includes `smol-toml`, `zod`, `@napi-rs/keyring`, and OpenTelemetry libraries with an OTLP HTTP trace exporter.

For remote actions, the gateway classifies commands before execution, evaluates authorization using a role × host-group policy, applies the configured approval mode, and audits the decision whether or not the action runs. TOML profiles define the host, SSH identity, and policy context. Unknown keys, duplicate profile names, and unresolved role or group bindings are rejected, including on reload. That makes policy configuration part of the execution boundary rather than a convention left to the model.

### Key Capabilities & Differentiators
The 16 MCP tools span allowlisted reads, general shell commands, separate sudo and destructive-action entry points, SFTP, process signaling, session management, and configuration reload. Interactive sessions preserve the working directory and environment but require POSIX shell semantics. Windows OpenSSH supports command execution, background sessions, and basic SFTP, but neither interactive sessions nor the documented streaming file tools are supported there.

Inline SFTP puts file contents in the model context and overwrites an existing destination on upload. The streaming tools move bytes directly between local disk and the remote host under an explicitly configured `transferRoot`; a streaming upload requires explicit opt-in to overwrite. Operators can also bound session counts, command output, daily command volume, and transfer sizes. These controls help limit operational impact; they do not make remote output trusted.

### Trade-offs & Limitations
Compared with direct OpenSSH, ssh-mcp adds a model-facing interface that can authorize, approve, and audit actions before sending them to a host. The cost is another policy surface to configure and test. A fixed automation runbook is simpler when actions are known in advance and an agent does not need to choose among them. Self-hosting controls where the gateway runs, but inline file contents and command responses can still cross into the client’s model context.

Command classification and approval reduce blast radius; they do not solve prompt injection or replace remote account permissions. In particular, `client-tool` treats the dedicated tool call as approval, not as an independent human challenge. Check how the client mediates that call before using it. Keep production access on least-privilege accounts and validate policy and audit behavior on representative hosts before widening access.

### Hardware & Deployment Guide
Install the CLI with `npm install -g ssh-mcp` on Node.js `^18.19.0 || >=20.6.0`, then register it with a local MCP client over stdio or use the HTTP transport. The root Dockerfile uses `node:22-slim`; the displayed Compose SSH service is a digest-pinned integration-test fixture, not evidence of a production topology. Put `config.toml` in the platform-specific location. On Linux and macOS, the server enforces owner-only access to both the file and its directory. For HTTP readiness, verify `configured` at `/health`: a successful handshake alone does not mean remote tools are enabled.

Use non-root SSH accounts and do not enable `auto` approval on production profiles. The recent release sequence widened compatibility: v2.28.0 added `client-tool` approval, v2.29.0 added opt-in keyboard-interactive authentication handling and a configurable connection timeout, and v2.30.0 let profiles import host, port, user, key, connection timeout, and jump-host settings from a named SSH config alias.
```

## Key Capabilities
```text
- Authorization: Command classification feeds a configurable role × host-group policy; strict TOML validation rejects unknown keys, duplicate profiles, and unresolved bindings.
- Approvals: On `client-tool` profiles, the destructive tool call is itself the approval; review MCP client behavior before enabling that mode.
- SSH profiles: Configure bastion routing, optional host-key pins, and agent, key, password, or keychain authentication.
- Transfer boundary: Disk-to-host streaming requires `defaults.transferRoot`; streaming upload refuses to overwrite by default, unlike context-based upload.
- Session limits: Profiles can cap session counts and idle time, impose command quotas, and select head or tail output truncation.
- Readiness: MCP discovery can succeed with no config while operational tools reject calls; HTTP `/health` exposes `configured`.
```

## Quick Start / Clone
```bash
npm install -g ssh-mcp
```
