tufantunc/ssh-mcp
An MCP-to-SSH gateway with policy checks, approvals, and audit logs
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
client-tool profiles, the destructive tool call is itself the approval; review MCP client behavior before enabling that mode.defaults.transferRoot; streaming upload refuses to overwrite by default, unlike context-based upload./health exposes configured.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.
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.
Quick Start & Installation
npm install -g ssh-mcp
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| ssh-mcp ★ | 923 | +14 | TypeScript | MIT | An MCP-to-SSH gateway with policy checks, approvals, and audit logs |
| rea | 488.8k | +7.6k | TypeScript | MIT | A local CLI and MCP server for evidence-backed app and binary analysis |
| chrome-devtools-mcp | 60.4k | +801 | TypeScript | Apache-2.0 | Chrome DevTools via MCP and CLI for live browser debugging and performance analy |
| OpenSpec | 76.4k | +495 | TypeScript | MIT | A CLI and agent-skill layer for keeping AI coding aligned with versioned specs |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/tufantunc/ssh-mcp.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about ssh-mcp
How does Claude Code connect, and when can it make SSH calls?
ssh-mcp executable over stdio with claude mcp add --transport stdio ssh-mcp -- ssh-mcp. Put hosts, roles, and approval settings in the TOML configuration. MCP discovery works before configuration, but operational calls are refused; use reload-config or restart after creating the file.Does it require a GPU, and what drives resource usage?
Can a company self-host it, and does the license address compliance?
When should I choose this over direct SSH or a fixed runbook?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy