Server Ops MCP

io.github.GT-dinuo由 GitHub 帳號 GT-dinuo 發布v1.0.3更新於 Oct 24, 2026

Server ops MCP: logs, monitoring, code edit, Nginx & certs. Local + SSH, confirmations & redaction.

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 AI 助理透過本機或 SSH 檢查並維運專案或遠端伺服器:日誌、資源、檔案、Nginx 與憑證。

可以做什麼
檢查系統資源:CPU、記憶體、磁碟、負載、程序、服務狀態與系統日誌,並提供記憶體與磁碟分析工具。處理專案日誌:列出、讀取和搜尋專案日誌與多通道日誌。讀寫程式碼:讀取、列出、搜尋、寫入、修補和刪除檔案,皆限制在專案根目錄內。管理 Nginx 與憑證:測試和讀取設定、重新載入 Nginx、安裝與續期憑證。執行白名單指令並稽核設定中外洩的密鑰,待執行操作需經確認。
適用情境
適合讓助理排查正式環境問題、做例行伺服器巡檢、搜尋日誌、做小幅程式碼修改,或在本機專案及透過 SSH 連線的遠端主機上處理 Nginx 與憑證工作。
執行需求
需要 Node.js 18 以上版本,透過 npx 或建置後的進入點在本機執行。必須設定 OPS_PROJECT_ROOT。遠端模式另需 OPS_SSH_HOST、OPS_SSH_PORT、OPS_SSH_USER,以及 OPS_SSH_KEY 或 OPS_SSH_PASSWORD 其中之一;受保護的密鑰另需 OPS_SSH_PASSPHRASE。可選用 OPS_CONFIG_PATH 指向設定檔,用於日誌通道、指令白名單和讀取上限。
安裝前請注意
寫入、刪除、指令執行、Nginx 重新載入和憑證操作需兩步確認,但仍會變更目標系統。SSH 憑證和私鑰口令以環境變數傳入;私鑰檔案權限應設為 600,切勿把含密碼的 .mcp.json 或 config.json 提交到儲存庫。遠端存取應使用唯讀或權限受限的帳號。日誌和設定中的密鑰會自動遮蔽,但不應只依賴此機制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Server Ops MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Server Ops MCP

English | 简体中文

[npm version] [License: MIT] [Node.js] [MCP] [GitHub stars]

A general-purpose server-ops MCP Server. Let AI tools like Claude Code / Cursor / Codex manage multiple projects or servers through .mcp.json — log troubleshooting, system resource inspection, code read/write, and Nginx / certificate management.

Supports local and remote (SSH) modes, with built-in two-step confirmation, command whitelisting, path-traversal protection, and automatic secret redaction.

Features

  • 🔍 Log troubleshooting: list / read / search project logs, multi-channel logs & system logs
  • 📊 Resource monitoring: CPU / memory / disk / load / processes / service status at a glance
  • 📁 Code operations: read, write, patch, delete, and search files — all sandboxed to the project root
  • 🌐 Nginx & certificates: config test & read, safe reload, certificate install & renewal
  • 🔒 Secure by design: two-step confirmation for writes, command whitelist, path-traversal protection, auto redaction

Installation

Requires Node.js 18+. No clone or build needed — npx fetches and runs the published npm package on first use (see the config below).

To build from source instead (e.g. for development):

bash
git clone https://github.com/GT-dinuo/server-ops-mcp.gitcd server-ops-mcpnpm installnpm run build

Build output goes to dist/; the entry point is dist/index.js.

Configuration

In each project where you want to use this tool, create (or append to) .mcp.json and declare an MCP Server per environment. Local mode only needs OPS_PROJECT_ROOT; remote mode adds the SSH variables.

json
{  "mcpServers": {    "myproject-server": {      "command": "npx",      "args": ["-y", "server-ops-mcp"],      "env": {        "OPS_PROJECT_ROOT": "/www/wwwroot/your-project",        "OPS_SSH_HOST": "<server-ip-or-domain>",        "OPS_SSH_PORT": "22",        "OPS_SSH_USER": "ubuntu",        "OPS_SSH_KEY": "~/.ssh/id_rsa"      }    }  }}

If you built from source, point the command at the local build instead: "command": "node", "args": ["/absolute/path/to/server-ops-mcp/dist/index.js"].

Environment Variables

VariableRequiredDescription
OPS_PROJECT_ROOTYesProject root path; all file operations are sandboxed here
OPS_SSH_HOSTNoRemote server IP / domain; leave empty to run locally
OPS_SSH_PORTNoSSH port, default 22
OPS_SSH_USERNoSSH username
OPS_SSH_KEYNoPath to SSH private key (choose either key or password)
OPS_SSH_PASSWORDNoSSH password (choose either key or password)
OPS_SSH_PASSPHRASENoPrivate key passphrase
OPS_CONFIG_PATHNoPath to an extra config file — see "Custom Configuration"

Usage

Once configured, just give ops instructions in natural language in your AI tool. The AI picks and calls the right tool automatically.

Read-only operations (run directly)

Check the server's CPU, memory, and disk usageSearch for error-level logs from the last hourList the project's log filesRead the Nginx config and check for problemsFind every place in the code that calls sendSms

Write operations (require confirmation)

For writes, deletes, command execution, Nginx reload, certificate install, and similar, the tool first returns a confirmationId. The AI shows you exactly what will run, and it only executes after you confirm:

You: Reload nginxAI: (calls nginx_reload, returns the pending action + confirmationId)    About to run: nginx -s reload. Confirm?You: ConfirmAI: (calls confirm_execute to run it)

file_write, file_patch, file_delete, command_exec, and similar all follow the same confirmation flow.

Typical scenarios

  • Production troubleshooting: "Why is the server memory full?" → memory_analysis + log_search working together
  • Routine inspection: "Is the disk almost full? Which directory uses the most?" → disk_analysis
  • Security audit: "Audit the project config for leaked secrets" → config_audit (output is auto-redacted)

Tool List

System Ops

ToolDescription
system_infoCPU / memory / disk / load / processes
memory_analysisMemory usage analysis
disk_analysisDisk usage analysis
service_statusService status
log_search_systemSearch system logs
nginx_config_testTest Nginx config
nginx_config_readRead Nginx config
nginx_reloadReload Nginx (requires confirmation)
certbot_installInstall certificate (requires confirmation)
certbot_renewRenew certificate (requires confirmation)

Project Code

ToolDescription
log_listList project logs
log_readRead a log
log_searchSearch logs
file_readRead a file
file_listList a directory
file_searchSearch code
file_writeWrite a file (requires confirmation)
file_patchPatch a file (requires confirmation)
file_deleteDelete a file (requires confirmation)
command_execRun whitelisted commands
project_overviewProject overview
config_auditAudit config (auto-redacted)
confirm_executeConfirm and run a pending action

Security

  1. Read-only tools run directly.
  2. Writes, command execution, Nginx reload, certificate install require two-step confirmation (confirm_execute).
  3. Command execution uses a whitelist — dangerous operations like rm -rf, sudo, and piping into a shell are rejected.
  4. File operations are sandboxed to OPS_PROJECT_ROOT; path traversal is blocked.
  5. Passwords, tokens, and other secrets in .env files and logs are automatically redacted.

Custom Configuration

Download config.example.json as config.json, then point OPS_CONFIG_PATH at it to customize log channels, the command whitelist, read limits, and more.

bash
curl -o config.json https://raw.githubusercontent.com/GT-dinuo/server-ops-mcp/main/config.example.json# (if you cloned the repo: cp config.example.json config.json)# After editing config.json, set in the .mcp.json env:# "OPS_CONFIG_PATH": "/absolute/path/to/config.json"

Main fields of config.example.json:

  • logChannels: channel name → log directory path (relative to project root)
  • maxReadLines / maxReadBytes: per-read line / byte limits
  • commandWhitelist.direct: commands that run directly
  • commandWhitelist.confirm: commands that require confirmation

Development

bash
npm run dev    # watch mode, recompiles on changenpm run build  # build to dist/npm run clean  # remove dist/npm start      # run the built Server

Notes

  • Remote operations rely on SSH — use a read-only account or a tightly-scoped command whitelist for the AI.
  • Private key files should have permission 600 (chmod 600 ~/.ssh/id_rsa).
  • Never commit .mcp.json or config.json containing passwords to a repository.

License

MIT © 2026 server-ops-mcp

來源:README.md,提交 16c2f8b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分