Disk Usage MCP Server (Demo)

Disk Usage MCP Server (Demo)

mcp-server-disk-usage•byu1i

A demo MCP server that lets Claude check the Mac system disk's usage in real time via a get_disk_usage tool.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides a get_disk_usage tool that returns disk information such as device, total space, used space, available space, reserved space, usage percentage, mount point, and a summary.
  • •Uses Python's subprocess module to run the df command and looks specifically at the /System/Volumes/Data partition on macOS.
  • •Parses the command output and returns structured data including total, used, available, and reserved space, usage percentage, and mount point and device information.

BEST FOR

  • •Answering questions about current Mac disk usage in Claude Desktop, such as total, used, available space and usage percentage.
  • •Getting a human-readable disk usage summary along with device and mount point details.
  • •Demonstrating how to build a simple Python MCP server that wraps a system command as a tool.

ABOUT MCP-SERVER-DISK-USAGE

Disk Usage MCP Server (Demo) is cataloged as an MCP server attributed to u1i. A demo MCP server that lets Claude check the Mac system disk's usage in real time via a get_disk_usage tool. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Disk Usage MCP Server (Demo) are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does this server work on operating systems other than macOS?

No. The server is specifically designed for the Mac disk structure and looks for the /System/Volumes/Data partition; the README states it will not work on other operating systems.

What does the get_disk_usage tool return?

It returns a dictionary with device, total_gb, used_gb, available_gb, reserved_gb, percent_used, mount, and a human-readable summary.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 5c973345ee38 · 采集于 2026-11-13 11:22:07 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Disk Usage MCP Server (Demo)

What is MCP?

Model Context Protocol (MCP) is a protocol that enables AI models like Claude to interact with external tools and services. It allows Claude to access real-time system information and perform actions on your behalf.

Learn more about MCP:

What You Get

When integrated with Claude Desktop, this demo MCP server enables Claude to check your disk usage (on the Mac) in real-time. Here's an example interaction:

User: "What is my current disk usage?"

Claude: "Let me check your current disk usage for you."

[approval to use disk-usage tool, user gives consent]

View result from ```get_disk_usage``` from ```disk-usage``` (local)
{
    "device": "/dev/disk3s5",
    "total_gb": "228.0GB",
    "used_gb": "177.0GB",
    "available_gb": "27.0GB",
    "reserved_gb": "24.0GB",
    "percent_used": "87%",
    "mount": "/System/Volumes/Data",
    "summary": "Total: 228.0GB | Used: 177.0GB | Available: 27.0GB | Reserved: 24.0GB | Usage: 87%"
}

Claude: "Here's your current disk usage information:

Total Disk Space: 228.0GB
Used Space: 177.0GB
Available Space: 27.0GB
Reserved Space: 24.0GB
Usage Percentage: 87%
Mount Point: /System/Volumes/Data
Device: /dev/disk3s5

Your disk is currently at 87% capacity, with 27.0GB of space still available. If you're concerned about the high usage, you might want to consider cleaning up some files to free up more space."

How It Works

Server Capabilities

When the server starts, it advertises its capabilities to Claude through the MCP protocol. Here's what Claude sees:

@mcp.tool()
def get_disk_usage() -> Dict[str, str]:
    """Get current disk usage information for the system disk
    
    Returns:
        A dictionary containing disk usage information with fields:
        - device: Device name
        - total_gb: Total size in GB
        - used_gb: Used space in GB
        - available_gb: Available space in GB
        - reserved_gb: Space reserved by system in GB
        - percent_used: Usage percentage
        - mount: Mount point
        - summary: Human-readable summary of disk usage
    """

This tells Claude that:

  1. The server provides a tool called get_disk_usage
  2. The tool returns a dictionary with detailed disk information
  3. The docstring explains what each field means

The Complete Claude-MCP Interaction Flow

  1. Initial System Prompt to Claude:
You are Claude, an AI assistant. You have access to these tools:

get_disk_usage() -> Dict[str, str]
    "Get current disk usage information for the system disk"

To use this tool, respond with a <tool_call> XML block:
<tool_call>
<name>get_disk_usage</name>
<reason>Explain why you need disk usage information</reason>
</tool_call>
  1. User Query:
User: What is my current disk usage?
  1. Claude's Tool Selection Response:
I'll check your disk usage information.

<tool_call>
<name>get_disk_usage</name>
<reason>User has requested current disk usage information. This tool will provide detailed statistics about disk space utilization.</reason>
</tool_call>
  1. Claude Desktop App → MCP Server:
// HTTP POST to MCP Server
{
    "jsonrpc": "2.0",
    "method": "invoke",
    "params": {
        "tool": "get_disk_usage",
        "args": {}
    },
    "id": 1
}
  1. MCP Server → Claude Desktop App:
{
    "jsonrpc": "2.0",
    "result": {
        "device": "/dev/disk3s5",
        "total_gb": "228.0GB",
        "used_gb": "177.0GB",
        "available_gb": "27.0GB",
        "reserved_gb": "24.0GB",
        "percent_used": "87%",
        "mount": "/System/Volumes/Data",
        "summary": "Total: 228.0GB | Used: 177.0GB | Available: 27.0GB | Reserved: 24.0GB | Usage: 87%"
    },
    "id": 1
}
  1. New Request to Claude (with tool output as context):
User: What is my current disk usage?

Tool Response:
{
    "device": "/dev/disk3s5",
    "total_gb": "228.0GB",
    "used_gb": "177.0GB",
    "available_gb": "27.0GB",
    "reserved_gb": "24.0GB",
    "percent_used": "87%",
    "mount": "/System/Volumes/Data",
    "summary": "Total: 228.0GB | Used: 177.0GB | Available: 27.0GB | Reserved: 24.0GB | Usage: 87%"
}

Provide a helpful response to the user based on this disk usage information.
  1. Claude's Final Response:
Here's your current disk usage information:

Total Disk Space: 228.0GB   
Used Space: 177.0GB   
Available Space: 27.0GB   
Reserved Space: 24.0GB   
Usage Percentage: 87%   
Mount Point: /System/Volumes/Data   
Device: /dev/disk3s5

Your disk is currently at 87% capacity, with 27.0GB of space still available. If you're concerned about the high usage, you might want to consider cleaning up some files to free up more space.

This shows the complete flow:

  1. Claude starts with knowledge of available tools
  2. User asks a question
  3. Claude recognizes the need for disk info and proposes using the tool
  4. After approval, tool response is injected into the conversation
  5. Claude processes the raw data into a helpful response

Technical Implementation

# Tool advertisement from server
{
  "tools": [
    {
      "name": "get_disk_usage",
      "description": "Get current disk usage information for the system disk",
      "parameters": {},  # No parameters needed
      "returns": {
        "type": "object",
        "properties": {
          "device": {"type": "string"},
          "total_gb": {"type": "string"},
          "used_gb": {"type": "string"},
          "available_gb": {"type": "string"},
          "reserved_gb": {"type": "string"},
          "percent_used": {"type": "string"},
          "mount": {"type": "string"},
          "summary": {"type": "string"}
        }
      }
    }
  ]
}
  1. User Query:

    User: "What is my current disk usage?"
    
  2. Claude's Tool Selection: Claude recognizes this query requires disk information and decides to use the get_disk_usage tool.

    Claude: "Let me check your current disk usage for you."
    [approval to use disk-usage tool, user gives consent]
    
  3. Tool Invocation and Response:

    // Raw tool response
    {
      "device": "/dev/disk3s5",
      "total_gb": "228.0GB",
      "used_gb": "177.0GB",
      "available_gb": "27.0GB",
      "reserved_gb": "24.0GB",
      "percent_used": "87%",
      "mount": "/System/Volumes/Data",
      "summary": "Total: 228.0GB | Used: 177.0GB | Available: 27.0GB | Reserved: 24.0GB | Usage: 87%"
    }
    
  4. Claude's Natural Response: Claude processes the raw data and provides a human-friendly response:

    Here's your current disk usage information:
    
    Total Disk Space: 228.0GB   
    Used Space: 177.0GB   
    Available Space: 27.0GB   
    Reserved Space: 24.0GB   
    Usage Percentage: 87%   
    Mount Point: /System/Volumes/Data   
    Device: /dev/disk3s5
    
    Your disk is currently at 87% capacity, with 27.0GB of space still available. If you're concerned about the high usage, you might want to consider cleaning up some files to free up more space."
    

Communication Protocol

Under the hood, MCP uses a bidirectional JSON-RPC protocol over WebSocket. Here's how it works:

  1. Initialization:

    // Claude -> Server
    {
      "jsonrpc": "2.0",
      "method": "initialize",
      "params": {
        "protocolVersion": "2024-11-05",
        "capabilities": {},
        "clientInfo": {
          "name": "claude-ai",
          "version": "0.1.0"
        }
      },
      "id": 0
    }
    
  2. Tool Advertisement: The server responds with its capabilities, including the get_disk_usage tool and its schema.

  3. Tool Invocation:

    // Claude -> Server
    {
      "jsonrpc": "2.0",
      "method": "invoke",
      "params": {
        "tool": "get_disk_usage",
        "args": {}
      },
      "id": 1
    }
    
  4. Server Response:

    // Server -> Claude
    {
      "jsonrpc": "2.0",
      "result": {
        "device": "/dev/disk3s5",
        "total_gb": "228.0GB",
        "used_gb": "177.0GB",
        ...
      },
      "id": 1
    }
    

This WebSocket-based protocol allows for:

  • Persistent connections
  • Bidirectional communication
  • Structured type information
  • Tool discovery and documentation

Implementation

  1. The MCP server (disk_usage_server.py) uses Python's subprocess module to run the df command
  2. It specifically looks at the /System/Volumes/Data partition (disk3s5 on macOS)
  3. The server parses the output and returns structured data including:
    • Total disk space
    • Used space
    • Available space
    • Reserved space (space reserved by the system)
    • Usage percentage
    • Mount point and device information

Requirements

  • macOS (this tool is specifically designed for Mac's disk structure)
  • Python 3.11+
  • pip (Python package manager)

Running the Server

  1. Clone this repository

  2. Install dependencies:

pip install -r requirements.txt
  1. Run the server:
python disk_usage_server.py

Note: This server specifically looks for the /System/Volumes/Data partition (disk3s5) on macOS. It will not work on other operating systems.

Claude Desktop Integration

  1. Create a claude-config.txt file in your Claude Desktop configuration directory (usually ~/.config/claude-desktop/ on macOS) with:
{
  "mcpServers": {
    "disk-usage": {
      "command": "python3",
      "args": [
        "<path-to-your-directory>/disk_usage_server.py"
      ]
    }
  }
}
  1. Replace <path-to-your-directory> with the actual path to where you saved the server files

  2. Restart Claude Desktop

Learning Outcomes

This project demonstrates:

  1. How to create a simple MCP server using Python
  2. How to integrate system commands into an MCP tool
  3. How to structure data for AI consumption
  4. How to handle system-specific details (like disk partitions)
  5. How to provide clear, human-readable summaries of technical data

Files

  • disk_usage_server.py: The main MCP server implementation
  • requirements.txt: Python dependencies
  • claude-config.txt: Example Claude Desktop configuration

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Disk Usage MCP Server (Demo) from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-server-disk-usage)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools