Skip to main content
Glama
Disk Usage MCP
by Ahmad-1276
README.md
# Disk Usage MCP

Find what is using disk space and how healthy the filesystems are.

![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python&logoColor=white)
![MCP](https://img.shields.io/badge/MCP-Model%20Context%20Protocol-000000)
![License](https://img.shields.io/badge/license-MIT-green)

## Tools

| Tool | Description |
| --- | --- |
| `list_partitions` | Mounted partitions with capacity, usage, and free space |
| `get_disk_usage` | Usage for a specific path |
| `get_disk_io` | Disk read/write counters, optionally per disk |
| `find_largest_files` | Largest files under a path, with a minimum-size filter |
| `find_largest_directories` | Largest immediate subdirectories under a path |

## Requirements

- Python 3.10+
- `pip install -e .`

## Install

```bash
git clone https://github.com/Ahmad-1276/disk-usage-mcp.git
cd disk-usage-mcp

python3 -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

pip install -e .
```

## Run

```bash
disk-usage-mcp
# or
python -m disk_usage_mcp.server
```

The server speaks the MCP stdio protocol and waits for a client.

## Connect an MCP client

Add this to your client's MCP config (Claude Desktop, Cursor, VS Code, etc.):

```json
{
  "mcpServers": {
    "disk-usage": {
      "command": "/absolute/path/to/.venv/bin/disk-usage-mcp",
      "args": []
    }
  }
}
```

Use the absolute path to the executable inside your virtual environment. On Windows the path is `.venv\Scripts\disk-usage-mcp.exe`.

## Example prompts

- Which partitions are nearly full?
- What are the 20 largest files under /var/log?
- How much space is /home using?
- Show disk I/O totals.

## Notes

Read-only. Scans skip permission errors, do not follow symlinks, and cap the number of files inspected so a huge tree cannot run forever.

## Development

```bash
pip install -e ".[dev]"
pytest -q
```

## License

MIT — see [LICENSE](LICENSE).

TDQS

B3.4/5.0

Scored across 5 tools

Disambiguation4/5

Each tool has a distinct focus: partition inventory, path-level usage, I/O counters, largest files, and largest directories. The only mild overlap is between list_partitions (which already reports usage/capacity per mount) and get_disk_usage (scoped to a specific path), but the path argument and descriptions make the boundary clear enough.

Naming Consistency5/5

All five tools follow a consistent snake_case verb_noun pattern (list_partitions, get_disk_usage, get_disk_io, find_largest_files, find_largest_directories). Verbs are used predictably: list/get for retrieval of known resources, find for searches.

Tool Count5/5

Five tools is a well-scoped surface for a read-only disk diagnostics server. Each tool covers a distinct inspection angle (partitions, path usage, I/O, files, directories) with no filler.

Completeness4/5

The core disk-inspection workflows (capacity, usage by path, I/O, space hogs) are all covered. Minor gaps exist for edge diagnostics such as inode usage or filesystem type/health, but agents can generally work around these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues