Skip to main content
Glama
s0shaw

windirstat-mcp

by s0shaw

windirstat-mcp

An MCP server that lets an AI assistant scan Windows drives with WinDirStat and report what can be cleaned up.

  • Read-only. It reports; it never deletes anything.

  • Zero dependencies. One Python file, standard library only.

  • Uses WinDirStat 2.x's headless /saveto switch, so no window opens during a scan.

How it works

WinDirStat 2.x has an undocumented command-line mode (found by inspecting the binary's strings):

WinDirStat.exe /saveto out.csv C:\

It scans the path, writes one CSV row per file and folder, and exits. The server runs this, then:

  • matches paths against known-safe-to-clean patterns (temp folders, browser/app caches, package-manager caches, crash dumps, Windows Update downloads, node_modules, *.old/*.tmp files, ...)

  • reports only the outermost match, so nested caches aren't double counted

  • lists the largest individual files

Related MCP server: WinDirStat MCP Server

Install

Requirements: Windows, Python 3.9+, WinDirStat 2.x.

pip install git+https://github.com/s0shaw/windirstat-mcp

The server finds WinDirStat.exe in this order: WINDIRSTAT_EXE env var, next to the script, PATH, %ProgramFiles%\WinDirStat\.

Claude Code

claude mcp add windirstat --scope user -e WINDIRSTAT_EXE="C:\path\to\WinDirStat.exe" -- windirstat-mcp

Claude Desktop / other clients

{
  "mcpServers": {
    "windirstat": {
      "command": "windirstat-mcp",
      "env": { "WINDIRSTAT_EXE": "C:\\path\\to\\WinDirStat.exe" }
    }
  }
}

Tool

windirstat_scan(path, top=30, min_mb=100)

{
  "root": "C:\\",
  "total_mb": 417204.5,
  "cleanup_candidates_mb": 81234.0,
  "cleanup_candidates": [
    { "path": "C:\\Users\\me\\AppData\\Local\\uv\\cache", "mb": 20098.6, "reason": "package cache" }
  ],
  "largest_files": [
    { "path": "C:\\pagefile.sys", "mb": 18432.0 }
  ]
}

Candidates are heuristics. Review before deleting: a .cache folder may hold downloaded ML models, and some caches belong to running programs. Prefer each tool's own command (pip cache purge, uv cache clean, npm cache clean --force) over deleting folders by hand.

CLI

windirstat-mcp D:\

prints the same JSON without starting the server.

Notes

  • A full scan of a large drive takes a few minutes. Run as administrator to see system folders.

  • WinDirStat is GPL-2.0 and is not bundled; this project only invokes it.

Development

python -m unittest -v

License

MIT

Available Tools

1 tool
windirstat_scanA

Scan a drive or folder with WinDirStat (read-only). Returns cleanup candidates (temp, caches, crash dumps, node_modules, ...) and the largest files. Never deletes anything.

NameRequiredDescriptionDefault
topNoHow many largest files to return
pathYesDrive or folder, e.g. C:\ or D:\Projects
min_mbNoIgnore cleanup candidates smaller than this

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well: it declares the operation read-only and explicitly says 'Never deletes anything,' which is exactly the safety signal an agent needs before touching C:\. It also discloses the two classes of output (cleanup candidates and largest files). It stops short of disclosing performance characteristics – a full-drive scan is likely slow – or any permission requirements.

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?

Two sentences, both earning their place: the first states what happens, the second states the payoff and the safety guarantee. The read-only assurance is front-loaded as a parenthetical so the agent sees it before the return-value detail.

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 3-parameter, no-output-schema tool with zero annotations, the description covers safety (read-only, never deletes), the two result categories, and the target resource. What's missing is any hint about scan duration or scaling on large drives, which an agent scheduling work would want. Overall sufficient to call correctly, shy of exemplary.

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%, so all three parameters (path, top, min_mb) are already fully documented in the schema, including defaults and an example path format. The description only loosely gestures at them ('cleanup candidates', 'largest files') without adding new semantics. Baseline 3 is correct when the schema does the heavy lifting.

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?

Names a specific verb ('scan'), a specific resource ('a drive or folder'), and the underlying engine (WinDirStat), then states what the caller gets back: cleanup candidates and largest files. This is far more than a restatement of the tool name and lets an agent decide instantly whether this tool matches the task.

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?

Usage is implied rather than stated: the tool scans drives/folders and surfaces cleanup candidates, which suggests 'use when looking for space to reclaim.' There is no explicit when-not guidance, no prerequisites (permissions, admin rights), and no mention of cost/time for scanning an entire drive versus a subfolder. Adequate but with real gaps.

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.

  1. 1 tool updatev0.1.0
    • First observedwindirstat_scan

TDQS

A3.9/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of confusion with a sibling tool. Its purpose (read-only disk scan returning cleanup candidates and largest files) is unambiguous.

Naming Consistency4/5

The name follows a clear server-prefixed verb_noun pattern (windirstat_scan), which is readable and predictable. With only one tool there is no broader convention to verify, so it cannot be a full 5.

Tool Count3/5

A single tool is borderline thin; the server has one capability and no supporting operations. It is not egregiously mismatched, but the surface feels under-scoped for a disk-analysis server.

Completeness3/5

Scanning is the core operation and returns useful analysis, but there is no way to target a re-scan of specific paths, list available drives, or export results. Deletion is explicitly out of scope, which is defensible, but other read-only follow-ups are missing.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables local AI assistants to inspect Windows disk usage with treemap and folder X-ray views, retrieve cleanup previews, and receive application removal guidance, while exposing only non-destructive commands through MCP.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to scan a developer machine for disk space hogs, audit git worktrees for stale or orphaned ones, re-check individual findings, and run allowlisted cleanup actions as dry runs unless explicitly confirmed. Risky items are reported with warnings and refused by default.
    MIT