SSH MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SSH MCP Server connect to 192.168.1.100 as root and run df -h"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SSH MCP Server
高效的 SSH 远程运维 MCP 服务。让 AI 工具通过 MCP 协议管理 SSH 连接、执行命令、传输文件。
功能
Tool | 说明 |
| 建立 SSH 连接(支持跳板机) |
| 断开连接 |
| 执行单条命令 |
| 执行多行脚本 |
| 读取远程文件 |
| 写入远程文件 |
| 列出远程目录 |
| 查看所有连接状态 |
| 查询操作历史日志 |
| 一键诊断远程服务器 |
| 日志查询与增量监控(file/journalctl/docker) |
| 保存服务器配置(支持备注和标签) |
| 删除已保存的服务器 |
| 列出所有已保存的服务器 |
| 更新服务器备注/标签(AI 知识积累) |
核心特性
连接池管理 — 持久化连接,避免重复建连
跳板机支持 — 通过 jump host 连接内网服务器
多认证方式 — 密码 / 私钥
SFTP 文件操作 — 读写文件、浏览目录
空闲超时清理 — 30 分钟无活动自动断开
多行脚本执行 — 通过
bash -s执行复杂脚本持久化操作日志 — 所有操作记录到
~/.ssh-mcp/logs/operations.jsonl,支持 AI 溯源一键服务器诊断 — 系统信息、资源、网络、Docker、GPU 全面检查
Related MCP server: Simple SSH MCP Server
安装
npm install -g @honwee/ssh-mcp-server或者直接通过 npx 使用(无需全局安装):
npx @honwee/ssh-mcp-server配置
Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["-y", "@honwee/ssh-mcp-server"]
}
}
}Cursor
在 Cursor Settings → MCP 中添加:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["-y", "@honwee/ssh-mcp-server"]
}
}
}Gemini CLI / Antigravity
在 settings.json 中添加:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["-y", "@honwee/ssh-mcp-server"]
}
}
}使用示例
直连服务器
1. ssh_connect(host="192.168.1.100", username="root", password="xxx", alias="web-server")
2. ssh_exec(connectionId="web-server", command="uptime")
3. ssh_exec(connectionId="web-server", command="df -h")
4. sftp_list(connectionId="web-server", remotePath="/var/log")
5. sftp_read(connectionId="web-server", remotePath="/etc/nginx/nginx.conf")
6. ssh_disconnect(connectionId="web-server")通过跳板机连接
ssh_connect(
host="10.0.0.50",
username="deploy",
privateKey="-----BEGIN OPENSSH PRIVATE KEY-----\n...",
alias="internal-db",
jumpHost={
host="bastion.example.com",
username="admin",
password="xxx"
}
)执行多行脚本
ssh_exec_script(
connectionId="web-server",
script="#!/bin/bash\necho '--- Disk Usage ---'\ndf -h\necho '--- Memory ---'\nfree -h\necho '--- Top Processes ---'\nps aux --sort=-%mem | head -10"
)License
MIT
Available Tools
17 toolssftp_downloadA
Download a remote file or directory to the local machine via SFTP. Automatically detects file vs directory. For directories, recursively downloads all contents.
Inputs: localPath (required), remotePath (required), connectionId (required).
sftp_listB
List files and directories in a remote path via SFTP.
Inputs: remotePath (required), connectionId (required).
sftp_readC
Read the contents of a file on a connected remote host via SFTP.
Inputs: remotePath (required), connectionId (required).
sftp_uploadA
Upload a local file or directory to a connected remote host via SFTP. Automatically detects file vs directory. For directories, recursively uploads all contents.
Inputs: localPath (required), remotePath (required), connectionId (required).
sftp_writeA
Write content to a file on a connected remote host via SFTP. Creates or overwrites the file.
Inputs: content (required), remotePath (required), connectionId (required).
ssh_analyzeA
Run a comprehensive diagnostic on a connected remote server. Collects system info, resource usage (CPU/memory/disk), network ports, recent errors, Docker containers, and GPU status in one shot.
Inputs: connectionId (required).
ssh_connectA
Establish an SSH connection to a remote host. Supports jump hosts (bastion) for connecting to internal networks. Returns a connectionId for subsequent operations.
Inputs: host, port, alias, jumpHost, +3 more.
ssh_disconnectA
Disconnect an existing SSH connection.
Inputs: connectionId (required).
ssh_execA
Execute a single command on a connected remote host. Returns stdout, stderr, and exit code.
Inputs: command (required), connectionId (required), timeout.
ssh_exec_scriptA
Execute a multi-line bash script on a connected remote host. The script is passed via stdin to bash -s.
Inputs: script (required), connectionId (required), timeout.
ssh_historyA
Query the persistent operation log. Returns past SSH operations (connect, exec, sftp, etc.) for traceability. Useful for reviewing what was done on a server.
Inputs: limit, operation, connectionId.
ssh_host_addA
Save an SSH host configuration for quick access. After saving, use ssh_connect with just the alias to connect without re-entering credentials.
Inputs: host (required), alias (required), username (required), port, +5 more.
ssh_host_listA
List all saved SSH host configurations. These can be used with ssh_connect by alias.
Inputs: tag.
ssh_host_removeA
Remove a saved SSH host configuration.
Inputs: alias (required).
ssh_host_updateA
Update notes, description, or tags for a saved host. Use this to record findings, document issues, or enrich the host profile based on what you learn during operations. No credentials needed.
Inputs: alias (required), tags, notes, description.
ssh_logsA
Query logs from a remote server. Supports file tailing, journalctl, and Docker container logs. Use follow=true to enable incremental tracking — subsequent calls return only NEW log lines (simulates tail -f).
Inputs: source (required), target (required), connectionId (required), grep, +4 more.
ssh_statusA
Show the status of all active SSH connections, including host, uptime, and command count.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool targets a clearly distinct operation: connection lifecycle, command execution, SFTP file operations, host configuration, logs, and diagnostics. Even similar tools like ssh_exec and ssh_exec_script are unambiguously separated by single command vs. multi-line script, and sftp_read vs. sftp_download by read-only vs. transfer semantics.
Names follow a consistent snake_case pattern with recurring prefixes (ssh_, sftp_) and verb-noun combinations such as ssh_connect, ssh_exec, sftp_upload, and ssh_host_add. Minor deviations like ssh_history, ssh_status, and ssh_logs use noun-only names instead of verb_noun, but the overall convention remains predictable.
At 17 tools, the server is slightly above the ideal 3-15 range, but the count is justified by the broad domain covering connection management, command execution, SFTP file operations, host configurations, logging, and diagnostics. Each tool has a distinct role, so the set does not feel bloated.
The tool surface covers the core SSH lifecycle well: connect/disconnect, command execution, script execution, SFTP file operations, host CRUD, logs, status, history, and diagnostics. Minor gaps exist, such as no SFTP delete/rename or explicit port-forwarding tool, but these are workable and do not severely impact the server's usefulness.
Related MCP Connectors
Secure and manage MCP servers through the Speakeasy AI Control Plane from your agent.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables remote SSH command execution and bidirectional file transfers through a standardized interface. It allows AI assistants to securely manage remote servers while keeping credentials isolated and applying command-level security controls.ISC
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI assistants full SSH/SFTP remote operations — session management, command execution, interactive shells, file transfers, port forwarding, and system diagnostics.2MIT
- AlicenseNot gradedqualityCmaintenanceMCP server enabling AI assistants to securely operate remote servers via persistent SSH sessions, with tools for command execution, file transfer, directory listing, and system monitoring.4MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform comprehensive SSH operations including command execution, file transfers, port forwarding, and key management through a stateless, Docker-ready MCP server.15MIT