Skip to main content
Glama
sykin7

mcp-vps-monitor

by sykin7

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: Secure VPS Operations MCP Server

🛠️ 核心功能列表 (Tools)

工具名称

功能描述

特性与安全防护

示例输入参数

get_system_metrics

获取 CPU 占用、精准可用内存(Available)、Swap 交换分区以及磁盘容量信息

具备 3 秒 In-Memory 缓存,防止智能体高频调用打爆 CPU

check_network_ping

测试 VPS 到指定目标 IP 或域名的网络延迟与连通性

内置严格正则匹配校验,防范命令行注入攻击

{"host": "1.1.1.1"}

get_top_processes

获取当前系统 CPU 或内存占用最高的前 N 个进程

经过字段精简脱敏,减少 Token 消耗

{"limit": 5}

get_docker_status

获取 VPS 上运行的 Docker 容器列表及其运行状态

快速提取容器 ID、名称、镜像与 Up/Exited 状态


🚀 部署与初始化步骤

环境要求

  • Node.js:v18.0.0 或更高版本

  • npm:随 Node.js 一起安装


途径一:在 Linux / VPS 环境部署(推荐)

  1. 上传项目文件: 将 mcp-vps-monitor 文件夹上传至 VPS 的任意目录(例如 /opt/mcp-vps-monitor)。

  2. 运行一键部署脚本: 进入项目目录并执行 setup.sh 脚本,自动安装依赖并完成编译:

cd /opt/mcp-vps-monitor
bash setup.sh
  1. 运行结果校验: 脚本执行完成后,会在项目根目录下生成 dist/index.js 文件。


途径二:在 Windows 本地电脑部署

  1. 打开项目目录: 进入 mcp-vps-monitor 根目录。

  2. 双击运行脚本: 直接双击运行 init.bat 脚本。

  3. 运行结果校验: 脚本会自动唤起命令行界面进行 npm installnpx tsc 编译,完成后按下任意键退出即可。


🤖 智能体(Agent)接入配置

接入 OpenClaw(小龙虾)

OpenClaw 与 MCP 服务部署在同一台 VPS 环境下时,建议采用 STDIO 管道传输 模式接入。

  1. 打开 OpenClaw 的配置文件(例如 openclaw.json 或 Agent 配置文件)。

  2. mcpServers 字段中添加以下配置节点:

{
  "mcpServers": {
    "vps-monitor": {
      "command": "node",
      "args": [
        "/opt/mcp-vps-monitor/dist/index.js"
      ]
    }
  }
}

注意:请确保 /opt/mcp-vps-monitor/dist/index.js 为您 VPS 上的实际绝对路径。

  1. 保存配置文件并重启 OpenClaw 服务。


❓ 常见问题与注意事项

  1. Docker 容器列表获取失败

  • 原因:运行 MCP 服务或 OpenClaw 的系统用户缺乏读取 Docker Daemon 的权限。

  • 解决方案:请使用 root 用户运行,或将当前非 root 用户加入 docker 用户组:

sudo usermod -aG docker $USER
  1. 网络 Ping 测试提示格式非法

  • 原因check_network_ping 增加了正则安全过滤,仅支持标准的 IP 地址(如 1.1.1.1)或域名(如 google.com),不支持带空格或管道符的复杂字符串。

Available Tools

4 tools
check_network_pingA

测试 VPS 到指定目标 IP 或域名的网络延迟与连通性(带防注入与超时保护)

ParametersJSON Schema
NameRequiredDescriptionDefault
hostYes目标域名或 IP 地址,如 1.1.1.1

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions anti-injection and timeout protection, which are useful behavioral traits. However, it does not clarify whether the operation is read-only, what side effects occur, or return value details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the purpose and includes key behavioral notes. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema), the description covers purpose and safety but omits return format or specific output details. It is adequate but not fully comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter, so the description adds little extra beyond what the schema provides. The tool description mentions anti-injection but does not change parameter meaning. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool tests network latency and connectivity from a VPS to a target host. It uses a specific verb ('测试') and resource ('网络延迟与连通性'), and it is distinct from sibling tools which deal with system metrics, processes, and Docker status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for network testing but does not explicitly state when to use this tool versus alternatives, nor does it mention exclusions or prerequisites. It provides general context but lacks explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_docker_statusA

获取 VPS 上运行的 Docker 容器列表及其运行状态

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries full burden; it indicates a read operation but lacks details on permissions, error handling, or what 'status' includes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words, making it highly concise and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete for a simple tool with no parameters or output schema, though it could specify the exact fields included in the container list.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters and 100% schema coverage, the description is not expected to add parameter details; it meets the baseline adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves a list of Docker containers and their status, which is specific and distinct from sibling tools like system metrics or network ping.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives; usage is only implied by the tool name and context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_system_metricsA

获取 VPS 的 CPU 占用、精准可用内存、Swap 交换分区以及磁盘容量信息

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the burden. It implies a read-only operation via 'get', but does not explicitly disclose side effects, authentication needs, or rate limits. Adequate but not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that is concise and front-loaded with the core purpose. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple parameterless tool, the description covers the main outputs. However, it omits details like units or how metrics are returned (e.g., percentages, MB). Nearly complete but missing some specificity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so schema coverage is 100%. The description adds value by listing the specific metrics returned (CPU, memory, swap, disk), which goes beyond the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb '获取' (get) and the resource 'VPS系统指标' with specific metrics (CPU, memory, swap, disk). It differentiates from sibling tools like check_network_ping and get_top_processes by focusing on system resource metrics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving system metrics but does not explicitly state when to use it over alternatives or provide exclusions. Sibling tools help clarify distinction, but the description alone lacks guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_top_processesB

获取当前系统 CPU 或内存占用最高的前 N 个进程

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo返回的进程数量,默认为 5

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must convey behavioral traits. It states the tool retrieves top processes by CPU or memory, but it does not disclose whether it returns both resources or allows selection, the sorting order, the output format, or any potential side effects. This is insufficient for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently states the core purpose. It is appropriately front-loaded but could potentially include a bit more detail without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema, the description should explain what the return value contains (e.g., process IDs, names, resource usage details). It lacks this information, making it incomplete for an agent to fully understand the tool's behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers the single parameter 'limit' with 100% coverage, describing its type and default. The description adds no additional meaning beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool gets the top N processes by CPU or memory usage on the current system. It uses a specific verb ('获取') and resource ('进程'), and distinguishes from sibling tools which target different aspects (system metrics, network ping, Docker status).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when top resource-consuming processes are needed, but it does not provide explicit guidance on when to use this tool versus siblings, nor does it mention when not to use it or any prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.0
    • First observedcheck_network_ping
    • First observedget_docker_status
    • First observedget_system_metrics
    • First observedget_top_processes

TDQS

A3.9/5.0
Disambiguation5/5

Each tool targets a distinct monitoring function: system metrics, network ping, top processes, and Docker status. There is no overlap.

Naming Consistency5/5

All tools use consistent snake_case verb_noun naming (get_system_metrics, check_network_ping, get_top_processes, get_docker_status).

Tool Count5/5

Four tools are well-scoped for a VPS monitor, covering essential aspects without being too few or too many.

Completeness4/5

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

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Provides tools to monitor host system health including CPU load, disk usage, and network status while enabling file system management tasks like searching and moving files. It includes built-in safety guards to prevent operations on critical system directories.
    11
    -
  • A
    license
    A
    quality
    C
    maintenance
    Provides 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.
    3
    MIT
  • F
    license
    B
    quality
    B
    maintenance
    Enables 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
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sykin7/mcp-vps-monitor'

If you have feedback or need assistance with the MCP directory API, please join our Discord server