/ 目錄 / 演練場 / mcp-ssh-manager
● 社群 bvisible ⚡ 即開即用

mcp-ssh-manager

作者 bvisible · bvisible/mcp-ssh-manager

37 SSH tools for managing fleets of Linux servers via Claude — execute, upload, download, backup, monitor health — with SSH-key + agent auth.

mcp-ssh-manager is a Node SSH wrapper exposing 37 tools for DevOps-style ops across multiple remote servers. Beyond raw exec/upload/download, it adds opinionated backup, health-monitoring, and DB-operation helpers. Configure via .env or TOML for named hosts.

為什麼要用

核心特性

即時演示

實際使用效果

ssh-manager.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "ssh-manager": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ssh-manager"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "ssh-manager": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ssh-manager"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "ssh-manager": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ssh-manager"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "ssh-manager": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-ssh-manager"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "ssh-manager",
      "command": "npx",
      "args": [
        "-y",
        "mcp-ssh-manager"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "ssh-manager": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "mcp-ssh-manager"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add ssh-manager -- npx -y mcp-ssh-manager

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: mcp-ssh-manager

Triage a fleet of VPS servers from chat

👤 Solo ops, small team SREs ⏱ ~15 min intermediate

何時使用: You manage 5-20 VPS boxes and need to eyeball them all quickly.

前置條件
  • SSH key in agentssh-add ~/.ssh/id_ed25519
  • Named host list — TOML config with name → host/user/key path
步驟
  1. Run health checks in parallel
    For each server in my fleet, run: uptime, df -h, free -h, last error in journalctl. Summarize anything concerning.✓ 已複製
    → Per-host summary + flagged issues
  2. Drill into problems
    On server X where disk is 95% full, find the top 10 largest directories under /var.✓ 已複製
    → du output
  3. Fix or escalate
    Is it safe to delete /var/log/old-*.gz? Confirm with me before running.✓ 已複製
    → Plan + waits for confirm

結果: Fleet-wide triage in 5 minutes.

注意事項
  • Command timeouts are advisory — a hung command can leave processes running — Use timeout 30 <cmd> explicitly for anything that could hang

Take a one-shot backup from a remote server

👤 Home-lab admins, solo devs ⏱ ~15 min intermediate

何時使用: You realize your important VPS has no backup and need one now, manually.

步驟
  1. Identify backup targets
    On server 'homelab', list directories under /home and /var that I should back up. Exclude logs and caches.✓ 已複製
    → Target list
  2. Create and download archive
    Tar+gzip those into /tmp/backup-$(date +%F).tgz, then download to my local ~/Backups/.✓ 已複製
    → Archive landed locally

結果: Ad-hoc backup in one conversation.

注意事項
  • Large backups blow remote /tmp — Stream directly: ssh host 'tar cz ...' > local.tgz (arrange via exec + download)
搭配使用: filesystem

Deploy a small app to a VPS without leaving chat

👤 Solo devs shipping side projects ⏱ ~10 min intermediate

何時使用: No Coolify, no Dokku — just a bare VPS and your code.

步驟
  1. Upload code
    Upload my ./dist/ directory to server 'myvps' at /opt/myapp/, preserving perms.✓ 已複製
    → Upload complete
  2. Restart service
    On myvps, sudo systemctl restart myapp and then check status. Send me the status output.✓ 已複製
    → active (running) or error

結果: Deploy done in 2 minutes.

注意事項
  • sudo password required — Configure NOPASSWD for the specific service in /etc/sudoers.d/

組合

與其他 MCP 搭配,撬動十倍槓桿

ssh-manager + filesystem

Download a remote file + edit locally + upload back

Download /etc/nginx/sites-enabled/example.conf, edit to add gzip_comp_level 6, upload and restart nginx.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
execute host, command, timeout?: int Any remote shell command free
upload host, local_path, remote_path Send a file or directory free
download host, remote_path, local_path Pull a file from a server free
sync host, local, remote, delete?: bool Bulk dir sync via rsync free
health_check host Quick pulse free

成本與限制

運行它的成本

API 配額
None
每次呼叫 Token 數
Exec output can be huge — | tail -50 is your friend
費用
Free, MIT
提示
Cap long output: cmd | head -100, never cat whole log files.

安全

權限、密鑰、影響範圍

最小權限: SSH key with only the needed remote permissions
憑證儲存: Private keys in ~/.ssh; use SSH agent for passphrases
資料出站: Traffic to the hosts you configure
切勿授予: Root-equivalent keys to an agent that can also reach the internet

故障排查

常見錯誤與修復

Permission denied (publickey)

Key not in agent, or remote ~/.ssh/authorized_keys wrong. ssh-add -l to verify.

驗證: ssh -i key host 'echo ok' directly first
Command timeout but process still running remotely

Wrap command with timeout: execute('host', 'timeout 30 long-command').

驗證: ssh in and `ps aux`
rsync needs sshpass

Either install sshpass on local or switch to SSH key auth for that host.

替代方案

mcp-ssh-manager 對比其他方案

替代方案何時用它替代權衡
Raw ssh via terminalYou're not using an LLM for opsManual, but well-understood
AnsibleYou manage 50+ hosts with reproducible playbooksHeavier; chat-driven ad-hoc not its strength

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills