Skip to main content

System Monitor MCP

System Monitor MCP 是一个基于 Model Context Protocol (MCP) 的系统监控服务,可以提供系统资源信息,包括 CPU、内存、磁盘、网络和进程等。

版本更新 (v1.1.3)

  • 🐛 修复了内存信息获取功能中的 cached 和 buffers 属性错误
  • ✅ 优化了内存监控的兼容性,支持不同操作系统
  • 🔧 改进了错误处理机制
  • 📊 所有功能已通过完整测试验证

功能特点

  • 实时监控系统资源使用情况
  • 提供 CPU 详细信息,包括使用率、频率等
  • 提供内存详细信息,包括物理内存和交换内存
  • 提供磁盘详细信息,包括分区和 I/O 统计
  • 提供网络详细信息,包括接口和流量统计
  • 提供进程详细信息,包括 CPU 使用率、内存使用率等
  • 支持资源监控,定期返回资源数据

安装

pip install system-monitor-mcp

使用方法

作为 MCP 服务器

在 AI 助手配置中添加以下 MCP 服务器配置:

{
  "mcpServers": {
    "system-monitor-mcp": {
      "timeout": 60,
      "type": "stdio",
      "command": "python",
      "args": [
        "-m",
        "system_monitor_mcp"
      ]
    }
  }
}

可用工具

  • get_system_info: 获取系统基本信息,包括 CPU、内存、操作系统等
  • get_cpu_info: 获取 CPU 详细信息,包括使用率、频率等
  • get_memory_info: 获取内存详细信息,包括物理内存和交换内存
  • get_disk_info: 获取磁盘详细信息,包括分区和 I/O 统计
  • get_network_info: 获取网络详细信息,包括接口和流量统计
  • get_processes_info: 获取进程详细信息,包括 CPU 使用率、内存使用率等
  • monitor_resource: 监控系统资源使用情况,定期返回资源数据

示例

获取系统信息

# 使用 MCP 工具获取系统信息
result = await use_mcp_tool(
    server_name="system-monitor-mcp",
    tool_name="get_system_info",
    arguments={}
)
print(result)

监控 CPU 使用率

# 监控 CPU 使用率,每 2 秒采集一次,持续 30 秒
result = await use_mcp_tool(
    server_name="system-monitor-mcp",
    tool_name="monitor_resource",
    arguments={
        "resource_type": "cpu",
        "interval": 2,
        "duration": 30
    }
)
print(result)

依赖

  • Python >= 3.8
  • psutil >= 5.9.0
  • mcp >= 1.0.0
  • pydantic >= 2.0.0

更新日志

v1.1.3 (2024-12-19)

  • 修复内存信息获取功能的兼容性问题
  • 优化了 Windows 系统下的内存监控
  • 改进了错误处理和异常捕获
  • 完善了测试覆盖率

v1.1.2

  • 基础功能实现
  • 支持系统、CPU、内存、磁盘、网络、进程监控

许可证

MIT

Metadata

Release files for system-monitor-mcp 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for system-monitor-mcp 1.1.4
File Size Uploaded Provenance
system_monitor_mcp-1.1.4.tar.gz 11.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for system-monitor-mcp 1.1.4
File Interpreter ABI Platform
system_monitor_mcp-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / system_monitor_mcp-1.1.4.tar.gz

Download URL system_monitor_mcp-1.1.4.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
61ef828cb21b92e52494f9482f66c533861e668f836f709724c35f90e9e77fa1
BLAKE2b-256 checksum
How to use checksums
d8d102da9fb58b050263437da79e49c5684e7a3f228f3fc347f4ef607d46a48b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.6

Release files / system_monitor_mcp-1.1.4-py3-none-any.whl

Download URL system_monitor_mcp-1.1.4-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1825ce740d8473920d3de93152e40802ca2dd34f8a18cee156858a8a841345db
BLAKE2b-256 checksum
How to use checksums
9c8d18e43837d3c054456a293df335cb2d3beb2d7d7b55004d23dac83780e796
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.6

Security for system-monitor-mcp 1.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page