- SSH MCP Tool — Production-Grade SSH Automation for AI Agents
SSH MCP Tool — Production-Grade SSH Automation for AI Agents
Production-grade MCP server that opens persistent SSH sessions and exposes safe, structured tools for command execution, file operations, transfers, tunnels, package and service management, metrics, resources, and guided prompts. Secure by default: strict host-key verification, root login disabled, raw sudo policy-gated, destructive commands denied unless explicitly allowed.
Overview
SSH MCP Tool
Production-grade MCP server for SSH automation. Opens persistent SSH sessions and exposes safe, structured tools to MCP clients (Claude Desktop, Cursor, VS Code, ChatGPT, custom agents).
Why this server
- Trust: central policy engine, structured audit events, redacted logs, strict host keys, machine-readable errors.
- MCP quality: stdio for local clients, Streamable HTTP for remote clients, legacy SSE only behind an explicit compatibility flag.
- AI-friendly tools: stable output schemas,
structuredContent, annotations for read-only / destructive / idempotent behavior, resources, and curated prompts. - Operations: session TTL/eviction, command timeouts, transfer checksum verification, real SSH forwarding, Prometheus metrics, OpenTelemetry hooks.
- Portability: SFTP first, POSIX/BusyBox-aware shell fallbacks, explicit support boundaries.
Quick Start
npm install -g mcp-ssh-tool
Add to your MCP client configuration:
{
"mcpServers": {
"ssh-mcp": {
"command": "npx",
"args": ["-y", "mcp-ssh-tool"]
}
}
}
Use it from your AI client:
Open a safe SSH session to prod-1 as deploy, inspect host capabilities, then show disk usage.
Security defaults
- Strict host-key verification is on
- Root login is off
- Raw sudo is policy-gated
- Destructive commands and filesystem mutations are denied unless policy allows them
- Remote HTTP starts on loopback only unless bearer auth and allowed origins are configured
Available tools
ssh.session.open/ssh.session.close— persistent session lifecyclessh.exec— run commands with timeout, structured output, audit logssh.file.read/ssh.file.write/ssh.file.list— safe file operationsssh.transfer.upload/ssh.transfer.download— SFTP with checksum verificationssh.tunnel.open— local/remote port forwardingssh.package.install/ssh.service.restart— package and systemd managementssh.metrics— host metrics (CPU, RAM, disk, network)- Plus resources and guided prompts
Requirements
- Node.js 22.22.2+ or 24.14.1+ (LTS only)
- SSH access to target hosts
- Populated
known_hostsfile or explicit per-session host-key policy
Links
- GitHub: https://github.com/oaslananka/mcp-ssh-tool
- npm: https://www.npmjs.com/package/mcp-ssh-tool
- MCP Registry: https://registry.modelcontextprotocol.io/v0.1/servers/io.github.oaslananka%2Fmcp-ssh-tool
- Documentation: https://github.com/oaslananka/mcp-ssh-tool#readme
License
MIT
Server Config
{
"mcpServers": {
"ssh-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-ssh-tool"
],
"env": {
"MCP_SSH_KNOWN_HOSTS": "~/.ssh/known_hosts",
"MCP_SSH_LOG_LEVEL": "info"
}
}
}
}Project Info
Created At
2 days agoUpdated At
2 days agoAuthor Name
oaslanankaStar
-Language
-License
-Recommend Servers
View AllAmap Maps
@amap
高德地图官方 MCP Server
a year ago
Playwright Mcp
@microsoft
Playwright MCP server
TypeScript
9 months ago