server-ops-mcp
Server Ops MCP enables AI tools to perform server operations and project code management via natural language, supporting both local and remote (SSH) modes with robust security controls.
System Monitoring: View CPU, memory, disk, load, and process info; analyze memory/disk usage to identify high-consumption processes and large files; check status of services like Nginx, PHP-FPM, MySQL, and Redis.
Log Management: Search system logs via journalctl; list, read (with pagination), and search project logs by channel, level, or keyword.
File & Code Operations: List, read, and search files within a sandboxed project root; write, patch, and delete files (all require confirmation).
Nginx & Certificate Management: Test config syntax, read configs, reload Nginx, and install/renew Let's Encrypt certificates via certbot (destructive/reload actions require confirmation).
Command Execution: Run whitelisted shell commands; dangerous commands are blocked outright.
Project Insights & Auditing: Get a project overview (tech stack, Git status, branches, recent commits) and audit config files for leaked secrets with automatic redaction.
Security Features: Two-step confirmation for all write, delete, and reload operations; command whitelisting; path-traversal protection; automatic redaction of sensitive data in outputs and logs.
Provides tools for managing Nginx configurations, including testing, reading, and reloading.
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., "@server-ops-mcp Show me the server's CPU, memory, and disk usage."
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.
Server Ops MCP
English | 简体中文
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
Related MCP server: vps-mcp-server
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):
git clone https://github.com/GT-dinuo/server-ops-mcp.git
cd server-ops-mcp
npm install
npm run buildBuild 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.
{
"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
Variable | Required | Description |
| Yes | Project root path; all file operations are sandboxed here |
| No | Remote server IP / domain; leave empty to run locally |
| No | SSH port, default |
| No | SSH username |
| No | Path to SSH private key (choose either key or password) |
| No | SSH password (choose either key or password) |
| No | Private key passphrase |
| No | Path 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 usage
Search for error-level logs from the last hour
List the project's log files
Read the Nginx config and check for problems
Find every place in the code that calls sendSmsWrite 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 nginx
AI: (calls nginx_reload, returns the pending action + confirmationId)
About to run: nginx -s reload. Confirm?
You: Confirm
AI: (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_searchworking togetherRoutine inspection: "Is the disk almost full? Which directory uses the most?" →
disk_analysisSecurity audit: "Audit the project config for leaked secrets" →
config_audit(output is auto-redacted)
Tool List
System Ops
Tool | Description |
| CPU / memory / disk / load / processes |
| Memory usage analysis |
| Disk usage analysis |
| Service status |
| Search system logs |
| Test Nginx config |
| Read Nginx config |
| Reload Nginx (requires confirmation) |
| Install certificate (requires confirmation) |
| Renew certificate (requires confirmation) |
Project Code
Tool | Description |
| List project logs |
| Read a log |
| Search logs |
| Read a file |
| List a directory |
| Search code |
| Write a file (requires confirmation) |
| Patch a file (requires confirmation) |
| Delete a file (requires confirmation) |
| Run whitelisted commands |
| Project overview |
| Audit config (auto-redacted) |
| Confirm and run a pending action |
Security
Read-only tools run directly.
Writes, command execution, Nginx reload, certificate install require two-step confirmation (
confirm_execute).Command execution uses a whitelist — dangerous operations like
rm -rf,sudo, and piping into a shell are rejected.File operations are sandboxed to
OPS_PROJECT_ROOT; path traversal is blocked.Passwords, tokens, and other secrets in
.envfiles 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.
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 limitscommandWhitelist.direct: commands that run directlycommandWhitelist.confirm: commands that require confirmation
Development
npm run dev # watch mode, recompiles on change
npm run build # build to dist/
npm run clean # remove dist/
npm start # run the built ServerNotes
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.jsonorconfig.jsoncontaining passwords to a repository.
License
MIT © 2026 server-ops-mcp
Available Tools
23 toolscertbot_installB
为指定域名申请并安装 Let's Encrypt 证书
Inputs: domains (required), plugin.
certbot_renewC
手动触发 certbot 证书续期
Inputs: dryRun.
command_execB
执行白名单内的安全命令(只读命令直接执行,非只读命令需确认)
Inputs: command (required), cwd.
config_auditC
审计项目配置文件(自动脱敏)
Inputs: file.
confirm_executeA
确认并执行需要二次确认的操作(如 file_write、file_delete、nginx_reload 等)
Inputs: confirmationId (required).
disk_analysisC
分析磁盘占用,找出大文件和大目录
Inputs: path, depth.
file_deleteC
删除项目文件
Inputs: path (required).
file_listA
列出项目目录内容
Inputs: path.
file_patchC
对项目文件进行局部替换修改
Inputs: path (required), newString (required), oldString (required).
file_readC
读取项目文件内容
Inputs: path (required), limit, offset.
file_searchC
在项目文件中搜索内容
Inputs: keyword (required), glob, lines.
file_writeC
写入或创建项目文件
Inputs: path (required), content (required), append.
log_listB
列出项目日志文件
Inputs: channel.
log_readC
读取指定日志文件
Inputs: path (required), limit, offset.
log_searchC
在项目日志中搜索关键词
Inputs: keyword (required), level, lines, channel.
log_search_systemC
搜索系统日志(journalctl)
Inputs: service (required), lines, keyword.
memory_analysisB
分析内存占用,找出占用内存最高的进程和 OOM 风险
Inputs: no named parameters.
nginx_config_readB
读取 Nginx 配置文件
Inputs: path.
nginx_config_testB
测试 Nginx 配置文件语法
Inputs: no named parameters.
nginx_reloadB
重载 Nginx 配置
Inputs: no named parameters.
project_overviewA
查看项目概览:技术栈、Git 状态、分支、最近提交
Inputs: no named parameters.
service_statusB
查看指定服务状态(nginx、php-fpm、mysql、redis 等)
Inputs: service (required).
system_infoB
查看系统 CPU、内存、磁盘、负载和进程信息
Inputs: type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools target distinct resources and actions (file, log, nginx, certbot, system), but there is potential confusion between command_exec and confirm_execute, as both handle confirmation for certain operations. Additionally, system_info overlaps partially with memory_analysis and disk_analysis, though they offer deeper analysis.
Tool names consistently use snake_case and mostly follow an object_action pattern (e.g., file_read, log_search, nginx_reload). However, some actions are verbs (install, exec, delete) while others are nouns (analysis, overview, status, info), and 'confirm_execute' uses two verbs without a clear object, reducing consistency.
With 23 tools, the set is on the higher end of the appropriate range but still well-scoped for server operations. Each tool has a specific purpose, and the count is justified by the breadth of tasks covered (files, logs, nginx, certbot, system analysis).
The tool set covers core server operations: file CRUD, logging, nginx configuration and reload, certbot installation and renewal, and system analysis. Minor gaps exist, such as no certbot revocation, no tool for restarting services beyond nginx, and no direct git deployment tools beyond status checking.
Maintenance
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Real Linux labs your AI agent deploys, routes and runs, with domains, TLS, DBs and an audit log.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI assistants to manage remote servers via SSH with agentless command execution, file operations, and service management.9MIT
- FlicenseAqualityDmaintenanceGives AI assistants full control over a VPS via SSH, enabling command execution, file management, service control, Docker and firewall management.96-
- AlicenseAqualityDmaintenanceEnables AI agents to deploy applications and manage servers over SSH using natural language commands, with built-in tools for Python bots, Docker Compose, and SSL setup.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage remote servers via SSH, including command execution, multi-host batch operations, SFTP file transfer, background job handling, DevOps diagnostics, port tunneling, and safety guardrails like high-risk command blocking and read-only mode.MIT