mcp-vps-monitor
Retrieves the list of Docker containers on the VPS and their running status (up or exited).
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., "@mcp-vps-monitorShow me the current 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.
mcp-vps-monitor
一个专为 AI 智能体(如 OpenClaw / 小龙虾、Cursor、Claude Desktop 等)设计的通用 VPS 系统监测与运维 MCP(Model Context Protocol)工具包。
本工具包采用纯只读架构,支持数据缓存防高并发打爆 CPU、正则表达式防命令注入,并提供精准的内存/Swap 统计与 Docker 容器运行状态排查。
🛠️ 项目结构
mcp-vps-monitor/
├── src/
│ └── index.ts # MCP 服务核心源码(已优化缓存与安全校验)
├── dist/ # 自动编译生成的 JavaScript 运行目录
├── package.json # 项目依赖配置
├── tsconfig.json # TypeScript 编译选项
├── setup.sh # Linux / VPS 环境一键部署脚本
├── init.bat # Windows 本地环境一键部署脚本
└── README.md # 部署使用说明文档
Related MCP server: Enterprise Infrastructure & Metrics MCP Server
🛠️ 核心功能列表 (Tools)
工具名称 | 功能描述 | 特性与安全防护 | 示例输入参数 |
| 获取 CPU 占用、精准可用内存(Available)、Swap 交换分区以及磁盘容量信息 | 具备 3 秒 In-Memory 缓存,防止智能体高频调用打爆 CPU | 无 |
| 测试 VPS 到指定目标 IP 或域名的网络延迟与连通性 | 内置严格正则匹配校验,防范命令行注入攻击 |
|
| 获取当前系统 CPU 或内存占用最高的前 N 个进程 | 经过字段精简脱敏,减少 Token 消耗 |
|
| 获取 VPS 上运行的 Docker 容器列表及其运行状态 | 快速提取容器 ID、名称、镜像与 Up/Exited 状态 | 无 |
🚀 部署与初始化步骤
环境要求
Node.js:v18.0.0 或更高版本
npm:随 Node.js 一起安装
途径一:在 Linux / VPS 环境部署(推荐)
上传项目文件: 将
mcp-vps-monitor文件夹上传至 VPS 的任意目录(例如/opt/mcp-vps-monitor)。运行一键部署脚本: 进入项目目录并执行
setup.sh脚本,自动安装依赖并完成编译:
cd /opt/mcp-vps-monitor
bash setup.sh
运行结果校验: 脚本执行完成后,会在项目根目录下生成
dist/index.js文件。
途径二:在 Windows 本地电脑部署
打开项目目录: 进入
mcp-vps-monitor根目录。双击运行脚本: 直接双击运行
init.bat脚本。运行结果校验: 脚本会自动唤起命令行界面进行
npm install与npx tsc编译,完成后按下任意键退出即可。
🤖 智能体(Agent)接入配置
接入 OpenClaw(小龙虾)
OpenClaw 与 MCP 服务部署在同一台 VPS 环境下时,建议采用 STDIO 管道传输 模式接入。
打开 OpenClaw 的配置文件(例如
openclaw.json或 Agent 配置文件)。在
mcpServers字段中添加以下配置节点:
{
"mcpServers": {
"vps-monitor": {
"command": "node",
"args": [
"/opt/mcp-vps-monitor/dist/index.js"
]
}
}
}
注意:请确保
/opt/mcp-vps-monitor/dist/index.js为您 VPS 上的实际绝对路径。
保存配置文件并重启 OpenClaw 服务。
❓ 常见问题与注意事项
Docker 容器列表获取失败:
原因:运行 MCP 服务或 OpenClaw 的系统用户缺乏读取 Docker Daemon 的权限。
解决方案:请使用
root用户运行,或将当前非 root 用户加入 docker 用户组:
sudo usermod -aG docker $USER
网络 Ping 测试提示格式非法:
原因:
check_network_ping增加了正则安全过滤,仅支持标准的 IP 地址(如1.1.1.1)或域名(如google.com),不支持带空格或管道符的复杂字符串。
Available Tools
4 toolscheck_network_pingA
测试 VPS 到指定目标 IP 或域名的网络延迟与连通性(带防注入与超时保护)
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | 目标域名或 IP 地址,如 1.1.1.1 |
get_docker_statusA
获取 VPS 上运行的 Docker 容器列表及其运行状态
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
get_system_metricsA
获取 VPS 的 CPU 占用、精准可用内存、Swap 交换分区以及磁盘容量信息
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
get_top_processesB
获取当前系统 CPU 或内存占用最高的前 N 个进程
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 返回的进程数量,默认为 5 |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
check_network_ping - First observed
get_docker_status - First observed
get_system_metrics - First observed
get_top_processes
TDQS
Scored across 4 tools
Each tool targets a distinct monitoring function: system metrics, network ping, top processes, and Docker status. There is no overlap.
All tools use consistent snake_case verb_noun naming (get_system_metrics, check_network_ping, get_top_processes, get_docker_status).
Four tools are well-scoped for a VPS monitor, covering essential aspects without being too few or too many.
The set covers CPU, memory, disk, network, processes, and Docker status. Minor gaps like uptime or per-partition disk usage exist but are not critical.
Maintenance
Related MCP Connectors
Read-only server insight: why a Linux server or K8s cluster is slow, failing or changed.
Uptime monitoring with 127 tools across 23 protocols. Tag filtering + Code Mode.
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables secure, read-only inspection of a VPS over SSH through approved operations such as system health, disk usage, container logs, and service status, without giving the AI unrestricted shell access.81MIT
- AlicenseAqualityDmaintenanceProvides read-only access to host system metrics (CPU, memory, disk), Docker container health/logs, and sandboxed log file analysis via MCP tools, enabling AI agents to monitor enterprise infrastructure safely.3MIT
- FlicenseBqualityBmaintenanceEnables safe VPS diagnostics and Docker/Docker Compose management over SSH, providing predefined read-only and mutating tools for system monitoring, container inspection, and Compose orchestration without exposing arbitrary shell execution.26-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to audit server health and operations through read-only tools, including container status, logs, alerts, and WhatsApp session status, without requiring SSH access.-