diskdiet for AI assistants (MCP)¶
diskdiet mcp runs diskdiet as a Model Context Protocol
server, so an AI coding assistant can tell you what is using disk space and free it
when you ask. Ask things like "my disk is almost full, what's taking space?" or
"clear old package caches, but keep Docker".
Set up¶
Use diskdiet mcp if diskdiet is installed (see Install),
or npx -y diskdiet mcp to run it with nothing installed but Node.js.
Claude Code: the plugin adds the tools and a skill:
or just the tools:
VS Code (Copilot)
Cursor, Windsurf and others use the same server definition in their MCP settings
file (for Cursor, ~/.cursor/mcp.json):
Tools¶
| Tool | What it does |
|---|---|
scan_disk_usage |
Measures every cache diskdiet knows and what is removable: things unused for older_than_days (default 30). Optional: sources to limit it, projects folders to search for node_modules and target, include_docker_volumes. Changes nothing. |
free_disk_space |
Removes what the last scan reported as removable, for the sources you choose. keep_projects leaves individual node_modules or target folders alone; move_projects_to_trash sends them to the Trash instead of deleting them. |
Safety¶
- Nothing is removed without a scan you've seen.
free_disk_spaceonly works within 15 minutes of ascan_disk_usage, removes exactly what that scan listed, and each scan is good for one clean. - You're asked. The tool is marked destructive, so assistants ask your permission before calling it. When the assistant supports MCP confirmations (elicitation), diskdiet also asks you directly, for example "Free about 12.3 GB from npm cache, Go caches?", and removes nothing unless you accept.
- The same rules as
diskdiet clean: never outside a cache folder; the tool's own prune command for pnpm, uv and Docker; Docker volumes only when asked; a cache is skipped while its package manager is installing or building.