Skip to main content
Glama
sandhyayadavalli

disk-space-monitor

磁盘空间监视器 — MCP 服务器

一个小的模型上下文协议服务器,允许AI助手检查其运行所在机器的磁盘使用情况。将其指向Claude Desktop(或任何MCP客户端),你就可以问*"我的磁盘快满了吗?"*并获得真实的答案,而不是猜测。

跨平台(Windows / macOS / Linux),无需配置文件,无需网络访问,无遥测。


工具

工具

参数

功能

check_disk_space

threshold: float = 50.0

扫描每个已挂载的分区,并标记任何超过阈值的内容。

check_single_path

path: str, threshold: float = 50.0

针对一个路径或驱动器的详细报告,附带建议。

disk_summary

threshold: float = 50.0

所有分区的单行健康状态总结。

状态级别

级别

触发条件

标记

OK

低于threshold

🟢

WARNING

达到或超过threshold(默认50%)

🟠

CRITICAL

达到或超过90%

🔴

SKIPPED

无法读取或超时


Related MCP server: Hardware Monitor MCP Server

示例输出

disk_summary()

🟢 ALL GOOD — All partitions below 50.0%. System is healthy.

check_single_path("C:\\")

💽  DISK USAGE: C:\
    Windows 11  │  2026-08-17 19:08:44  │  Threshold: 50.0%
─────────────────────────────────────────────────────────────────
  Status  : 🟠 WARNING
  Usage   : [██████████████░░░░░░░░] 63.4%
  Used    :    301.2 GB
  Free    :    173.8 GB
  Total   :    475.0 GB
─────────────────────────────────────────────────────────────────
⚠️  Above 50.0%. Consider archiving old files or clearing caches.

check_disk_space(threshold=70)

💽  DISK SPACE REPORT
    Windows 11  │  2026-08-17 19:08:44  │  Threshold: 70.0%
─────────────────────────────────────────────────────────────────
  🟢 OK        C:\  [NTFS]
           [██████████████░░░░░░░░] 63.4%
           Used     301.2 GB  │  Free     173.8 GB  │  Total     475.0 GB

  🔴 CRITICAL  D:\  [NTFS]
           [████████████████████░░] 92.7%
           Used     927.0 GB  │  Free      73.0 GB  │  Total    1000.0 GB
─────────────────────────────────────────────────────────────────
⚠️  1 critical, 0 warning:
   🔴 D:\ (92.7%)

系统要求

  • Python 3.10 或更新版本(在3.12上开发)

  • mcppsutil

安装

git clone https://github.com/<your-username>/disk-space-monitor.git
cd disk-space-monitor

python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate

pip install -r requirements.txt

将其连接到Claude Desktop

将服务器添加到你的Claude Desktop配置文件中:

  • Windows%APPDATA%\Claude\claude_desktop_config.json

  • macOS~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "disk-monitor": {
      "command": "/absolute/path/to/disk-space-monitor/.venv/bin/python",
      "args": ["/absolute/path/to/disk-space-monitor/main.py"]
    }
  }
}

在Windows上,路径看起来像C:/path/to/disk-space-monitor/.venv/Scripts/python.exeC:/path/to/disk-space-monitor/main.py。两个路径都必须是绝对路径——服务器是直接启动的,而不是通过shell。

之后重启Claude Desktop。三个工具会自动出现,你可以问类似的问题:

我的磁盘快满了吗? 检查驱动器 D:,如果超过80%就警告我。 给我一行磁盘健康摘要。

独立运行

python main.py

服务器通过stdio使用MCP协议进行通信,因此直接运行它只会阻塞等待客户端——这是预期行为,不是挂起。


工作原理

分区发现。 psutil.disk_partitions(all=False)列出真实挂载的分区,然后跳过那些通常会导致挂起或没有有意义使用数据的伪文件系统:squashfstmpfsdevtmpfsoverlayautofs以及没有文件系统类型的条目。

超时保护。 每个分区在一个0.5秒截止时间的守护线程中读取。断开的网络驱动器或休眠的外部磁盘可能导致shutil.disk_usage()长时间阻塞;如果截止时间已过,该分区将报告为⚪ SKIPPED,扫描继续。这可以防止单个坏挂载点冻结整个工具调用。

格式化。 大小在1000 GB以下显示为GB,以上显示为TB。使用率条宽22个字符,并限制在该范围内,因此格式错误的百分比不会导致失控的输出。

项目结构

disk-space-monitor/
├── main.py            # the entire server — helpers + three tools
├── requirements.txt   # mcp, psutil
├── .gitignore
├── LICENSE
└── README.md

隐私

服务器仅读取本地磁盘使用数据——每个分区的总字节数、已用字节数和空闲字节数,以及报告头中的操作系统名称和版本。它不发出网络请求,不写入文件,不读取文件内容,也不在调用之间存储任何内容。

许可证

MIT — 参见 LICENSE

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Exposes Windows system information and control tools including hardware stats, network details, and process monitoring. It enables AI applications to retrieve real-time data about CPU, memory, drives, and active system processes.
    12
    GPL 3.0
  • F
    license
    -
    quality
    B
    maintenance
    Enables AI assistants to monitor real-time CPU, RAM, and disk usage on the local machine.
  • A
    license
    A
    quality
    A
    maintenance
    Provides Claude with read-only access to PC diagnostics including hardware specs, live performance metrics, disk usage, network checks, and more, enabling natural language queries about PC health and performance.
    15
    MIT

View all related MCP servers

Related MCP Connectors

  • Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.

  • Live status, API pricing and rate limits for ChatGPT, Claude, Gemini, Cursor and 42+ AI tools.

  • Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.

View all MCP Connectors

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/sandhyayadavalli/disk-space-monitor'

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