Skip to main content
Glama
windirstat-mcp

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.

Inputs: path (required), top, min_mb.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      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 an AI assistant to measure macOS disk usage, investigate unfamiliar files and folders, identify cleanup candidates, and prepare numbered cleanup proposals that move approved items to the Trash only after server-side path checks.
      16 npm
      1
      MIT