
VPS Ops
io.github.koller-nexus由 GitHub 帳號 koller-nexus 發布v0.1.0更新於 Oct 24, 2026
Stdio MCP server that inspects and (with confirmation) mutates one VPS over SSH.
概覽
讓助理透過 SSH 檢查並在確認後變更單一 VPS:主機健康、Docker、Compose、Swarm、防火牆與日誌。
- 可以做什麼
- 這是一個 stdio MCP 伺服器,對單一台 VPS 執行固定的 SSH 指令。唯讀工具涵蓋主機健康(ping、資源、journal、失敗單元、top、dmesg、監聽埠、防火牆、fail2ban、SSH 強化檢查)以及 Docker/Compose/Swarm 檢查(ps、inspect、logs、stats、service 與 node 清單、compose ps)。變更工具可重新啟動、停止、啟動或刪除容器,執行 compose up、restart 與 pull-up,以及清理 Docker。每次呼叫回傳 exit_code、stdout、stderr、duration_ms 與 truncated。
- 適用情境
- 適合讓助理在不取得自由 shell 的前提下查看或操作一台遠端伺服器:讀取日誌、容器狀態、磁碟與記憶體、防火牆狀態,或在排障時重新啟動服務。若只需唯讀存取,可關閉變更功能後再註冊。
- 執行需求
- 由用戶端(Cursor 或 Codex)啟動的本機程序,不要手動常駐執行。需要 Bun、供註冊指令碼使用的 Python 3、PATH 中的 OpenSSH 用戶端,以及可讀取的 SSH 私鑰。需設定 VPS_SSH_KEY_PATH(必填)、VPS_HOST、VPS_USER、VPS_PORT、VPS_COMPOSE_DIR、VPS_COMMAND_TIMEOUT_MS、VPS_LOG_MAX_BYTES、VPS_ALLOW_MUTATIONS。遠端主機需安裝 Docker,部分防火牆、fail2ban、sshd、ss 與 dmesg 工具還需要免密碼 sudo。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 VPS Ops,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
vps-ops-mcp
A stdio MCP server that operates one VPS over SSH. Cursor and Codex start the process with bun and call read-only tools (host health, Unix debug, Docker, Compose, Swarm, firewall) plus mutation tools (restart, stop, start, prune). Mutations require an explicit confirmation.
Transport is stdio. Do not start the server as a long-lived process by hand: the client (Cursor or Codex) launches it.
Contributing
See CONTRIBUTING.md (branches, pull requests, verification) and ISSUE.md (how to file an issue).
Requirements
- Bun
- Python 3 (used by the registration scripts)
- OpenSSH client (
sshonPATH) - A readable SSH private key with access to the remote user
- On the remote host: Docker (and passwordless
sudo -nforufw,fail2ban,sshd -T,ss, anddmesgif you use those tools)
Configuration
Edit .env. The file is gitignored.
VPS_COMPOSE_DIR must be absolute and match /^[a-zA-Z0-9/_.-]+$/ (it must start with /).
Installation
npm package (requires Bun; the MCP Registry points at this artifact):
MCP Registry name: io.github.koller-nexus/vps-ops-mcp. The registry publishes metadata only after the package exists on public npm.
Register with clients
The scripts write MCP config from variables already exported in the shell. They do not load .env themselves. If you skip the export, the scripts fall back to their defaults (host, user, port, and a local key path).
Do this once at the repository root before each script:
Each run backs up the destination file (*.bak.YYYYMMDDHHMMSS) and replaces only the vps-ops server. Other MCP servers stay in place.
Optional script variables:
VPS_COMPOSE_DIR is written into the client config only when it is set and non-empty.
Cursor
Global registration (applies in every workspace):
The script writes ~/.cursor/mcp.json in this shape:
To scope it to one project, point the script at that project's mcp.json:
Then reload the Cursor window (Command Palette → Developer: Reload Window) or restart the server under Settings → MCP. The server appears as vps-ops.
Codex
The script writes ~/.codex/config.toml:
Close and reopen the Codex session so it rereads config.toml. If the CLI is on PATH, codex mcp list should show vps-ops.
Verify
Test SSH outside MCP with the same flags the server uses:
In Cursor or Codex, ask the client to call vps_ping. The response is JSON:
A non-zero exit_code is an MCP error. If the process exits immediately with VPS_SSH_KEY_PATH is required or missing or unreadable, the variable never reached the client env — rerun the registration script with .env exported.
Tools
Every call returns exit_code, stdout, stderr, duration_ms, and truncated.
Read-only
Container, service, image, and jail names must match ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$.
Mutation
These require confirm: true. With VPS_ALLOW_MUTATIONS=false, all of them are rejected.
Security
- Remote commands are fixed. There is no free-form shell tool.
- Name and path arguments go through an allowlist and are quoted in the shell.
- SSH uses
BatchMode=yes,IdentitiesOnly=yes, andStrictHostKeyChecking=accept-new. - A mutation without
confirm: trueis rejected.docker_rmasks for the name twice. Volume prune requiresconfirm_volumes: true. - For a read-only client, register with
VPS_ALLOW_MUTATIONS=false.
來源:README.md,提交 1f4735f
工具
0版本歷史
1- v0.1.0最新Sep 23, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分