Skip to main content
Glama
Kate941-su

Disk Clean MCP Server

by Kate941-su

Disk Clean MCP Server

日本語 | English

Ask Claude or another AI assistant to "clean up my disk". This MCP server finds the files that eat your disk space and moves them to the trash.

  • Nothing is deleted. Items go to the OS trash, so you can restore them later

  • You always see a list first, and only the items you approve are moved

  • System folders are never touched

Supported OS: macOS / Linux / Windows

What it finds

Type

Examples

Developer caches

node_modules, __pycache__, Rust target/, build/ and dist/, Python virtual environments (.venv), ~/.gradle/caches, ~/.cargo/registry

Large, unused videos

.mp4, .mov, .mkv and other videos over 100 MB that have not been opened or changed in 90 days

Old logs

.log and .log.gz files not updated in 30 days

You can change the size and age limits when you ask (for example "videos over 500 MB" or "logs older than a year").


Related MCP server: mac-disk-cleaner

Install

Claude Desktop (easiest)

  1. Download the latest diskclean-mcp-server-*.mcpb from Releases

  2. Double-click the file, or drag it into Claude Desktop's Settings → Extensions

  3. Click Install

Claude Desktop sets up Python and everything else for you.

Other apps (Claude Code, Cline, manual setup)

These use uv to download and run the server. You do not need to install Python yourself.

Step 1. Install uv

macOS / Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Open a new terminal and check that uv --version works.

Step 2. Add the server to your app

Claude Code

claude mcp add --scope user diskclean -- uvx diskclean-mcp-server

--scope user makes it available in every project.

Optional: install the skill that teaches Claude the safe cleanup steps.

mkdir -p ~/.claude/skills/disk-cleanup
curl -fsSL https://raw.githubusercontent.com/Kate941-su/diskcleaner-mcp/main/.claude/skills/disk-cleanup/SKILL.md \
  -o ~/.claude/skills/disk-cleanup/SKILL.md

Claude Desktop (manual setup)

Open the config file:

OS

Config file

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Add the following and restart Claude Desktop:

{
  "mcpServers": {
    "diskclean": {
      "command": "uvx",
      "args": ["diskclean-mcp-server"]
    }
  }
}

Cline (VS Code)

Open the config file from Cline's MCP Servers screen and add the same entry as above.


How to use

Ask your assistant in plain words:

My disk is full. Find files I don't need in my home folder.
Clean up all the node_modules folders under ~/projects.
Find videos in ~/Movies over 1 GB that I haven't watched in six months.
Show me what is using space in ~/Library/Caches, two levels deep.

What happens

  1. The assistant looks at the folder and tells you what is using the space

  2. You get a list of candidates (path, type, size, last modified) and the total space you can free. Nothing has been moved yet

  3. You say what to move ("all of them", "only node_modules", "everything except #3")

  4. Only the approved items go to the trash, and you get a report

Restoring files

Everything goes to the trash, so you can bring it back at any time.

  • macOS: open the Trash in Finder, right-click the item and choose Put Back

  • Windows: open the Recycle Bin, right-click the item and choose Restore

  • Linux: open the trash in your file manager and choose Restore (stored in ~/.local/share/Trash)

Disk space is actually freed when you empty the trash.

What is never moved

  • OS system folders (/usr, /System, C:\Windows, C:\Program Files, and so on)

  • Your home folder itself, and folders directly under the disk root

  • Anything that was not in the list you were shown

  • Symbolic links (and the files they point to)

  • node_modules and virtual environments that belong to tools and apps, not to your projects: the pnpm store, Node.js installed by nvm, VS Code extensions, and anything inside ~/Library, ~/AppData or hidden folders in your home folder. Removing these would break the tool

build/ and dist/ only count as caches when a build file such as package.json sits next to them, so normal folders with the same name are not picked up by mistake.


Updating

The Claude Desktop extension: download the new .mcpb from Releases and install it again.

With uvx: uv keeps a cached copy. To get the latest version, run the following and restart your app.

uv cache clean diskclean-mcp-server

To always start the newest version, use "args": ["diskclean-mcp-server@latest"] instead. This checks for updates every time the server starts.


Troubleshooting

The tools don't show up in my assistant

  • Restart the app after changing settings

  • Claude Desktop may not find uvx. Put the full path in "command". Find it with which uvx on macOS / Linux or where uvx on Windows

  • In Claude Code, check with claude mcp list

"Some folders could not be read" (skipped_errors)

  • Folders you don't have permission to read are skipped. On macOS, giving the app Full Disk Access may help (System Settings → Privacy & Security)

The scan stopped early (timed_out)

  • One scan runs for up to 60 seconds. Ask for a smaller folder, such as ~/projects


For developers

See docs/DESIGN.md for the design, tool specs, development setup and release process (in Japanese).

License

MIT

Available Tools

4 tools
analyze_disk_usageA
Read-only

指定ディレクトリ配下の容量内訳を返す(読み取りのみ)。 カテゴリ別合計(dev_cache/video/log/other)と、深さ max_depth までのエントリのうち 大きい順の上位を含む。各エントリのサイズは配下の合計なので、親子のサイズは重複する。 どこが大きいか分かったら、そのパスを指定して再度呼ぶと効率よく掘り下げられる。

NameRequiredDescriptionDefault
max_depthNo内訳を出す階層の深さ(1=直下の子のみ)
target_pathYes調査するディレクトリの絶対パス(~ 可)

Output Schema

NameRequiredDescription
total_mbYes
timed_outYes
entry_countYes
target_pathYes
by_category_mbYes
skipped_errorsYes
largest_childrenYes

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=true and openWorldHint=false, and the description's 読み取りのみ is consistent with them rather than contradictory. It adds genuinely useful behavior beyond the annotations: the fixed category buckets and the caveat that entry sizes include their subtree, so parent and child sizes overlap. It says nothing about cost, performance, or traversal limits (e.g. symlinks, permission errors, unreadable dirs), which matters for a filesystem walk.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences with no filler: purpose, then payload contents, then the size-overlap caveat, then the drill-down workflow. The most decision-relevant facts (what it returns, and that sizes double-count across levels) are front-loaded.

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?

An output schema exists, so the description doesn't need to enumerate return fields, and the annotations carry the safety profile. Given only two parameters and high schema coverage, the description is nearly complete; the only gap is the absence of any note on error or edge behavior (inaccessible paths, symlinks, large trees).

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 coverage is 100%, so both parameters are already documented in the schema (including max_depth as 1=直下の子のみ and target_path as an absolute path allowing ~). The description's mention of max_depth and of reusing a discovered path adds only light framing on top of that. Baseline 3 applies when the schema carries the parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a concrete verb+resource: it returns a capacity breakdown (容量内訳) for a specified directory, and explicitly notes 読み取りのみ. It also states what the payload contains (カテゴリ別合計 dev_cache/video/log/other plus top entries by size). It does not name or contrast with its siblings (scan_cleanup_targets, get_os_env_paths), so differentiation is left to the reader.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The final sentence gives concrete operational guidance: after finding a large path, call again with that path to drill down efficiently, describing an iterative workflow. It gives no explicit when-not-to-use rule and never names an alternative sibling tool for the cleanup/environment-inspection case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_os_env_pathsA
Read-only

OSに応じた代表的なキャッシュ・ログディレクトリのうち、実在するものを返す。 掃除対象の場所をユーザーが指定していないときの候補探しに使う。

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription
osYes
homeYes
cache_pathsYes

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint=false, so the description adds real value by disclosing two behavioral traits: results are OS-dependent and filtered to directories that actually exist on disk. It stops short of saying whether existence is checked live or what happens when nothing is found, so not a 5.

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 short sentences with no filler: the behavior comes first and the usage condition second. Every clause carries information an agent needs.

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?

With no params, an output schema, and read-only annotations, the description only needs to convey behavior and trigger, which it does. It could add one line on what the returned paths are suitable for (candidates, not confirmed cleanup targets), but nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters and the description correctly says nothing about inputs, matching the empty schema. Baseline 4 applies for a no-argument tool with full schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: returns the representative cache/log directories that actually exist for the current OS. Scope (OS-dependent, existence-filtered, no arguments) is clear enough to separate it from scan_cleanup_targets, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states the triggering condition: use it to find candidate locations when the user has not specified what to clean. That gives a clear when-to-use, but it never says when not to use it (e.g. after targets are already known) or names the alternative tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

move_to_trashA
DestructiveIdempotent

指定パスをOSのゴミ箱(Trash/Recycle Bin)へ移動する。完全削除はしない。 必ずユーザーの明示的な同意を得てから実行すること。 スキャン結果にないパスや保護パスは skip される。

NameRequiredDescriptionDefault
pathsYesゴミ箱へ移動するパス。そのスキャン結果に含まれるもののみ
scan_idYesscan_cleanup_targets が返した scan_id

Output Schema

NameRequiredDescription
movedYes
failedYes
skippedYes
moved_mbYes

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true), the description adds the crucial nuance that deletion is recoverable via the OS trash, mandates user consent before execution, and discloses that non-scan and protected paths are silently skipped. These are exactly the behavioral facts an agent cannot infer from the boolean hints.

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?

Four short lines, front-loaded with the action and its non-destructive nature, followed by the consent precondition and the skip rule. No redundant restatement of the tool name or schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, rich annotations, and fully documented parameters, the description covers everything else an agent needs: recoverability, consent requirement, and skip semantics. Nothing material is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds a filtering rule not in the schema: paths outside the scan result and protected paths are skipped rather than rejected. That changes how an agent should interpret partial success from the paths array.

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?

States a specific verb and resource (move to OS Trash/Recycle Bin) and immediately disambiguates it from permanent deletion ('完全削除はしない'), which is the key distinction an agent must make among cleanup-related siblings. The reference to scan results ties it to scan_cleanup_targets.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit precondition ('必ずユーザーの明示的な同意を得てから実行すること') and implies the tool is used on paths produced by a prior scan. It does not name an alternative tool or describe a case where a different sibling should be chosen instead, so it falls short of a full when/when-not specification.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scan_cleanup_targetsA
Read-only

条件に一致する削除候補をサイズの大きい順に列挙する(Dry-Run。何も削除しない)。 返された scan_id は move_to_trash に必要。結果はユーザーに提示して同意を得ること。

NameRequiredDescriptionDefault
max_resultsNo返す候補の最大件数
min_size_mbNo動画の最小サイズ(MB)
target_pathYesスキャンを開始するディレクトリの絶対パス
target_typeYesdev_cache=node_modules等の開発キャッシュ, large_videos=大容量で未使用の動画, old_logs=更新のない古いログ, all=すべて
unused_daysNo動画の未アクセス・未更新日数の閾値
older_than_daysNoログの未更新日数の閾値

Output Schema

NameRequiredDescription
itemsYes
scan_idYes
timed_outYes
truncatedYes
found_countYes
target_pathYes
target_typeYes
returned_countYes
skipped_errorsYes
total_reclaimable_mbYes

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false; the description reinforces this with an explicit 'Dry-Run, deletes nothing' statement rather than contradicting it. It also discloses the cross-tool contract (scan_id feeds move_to_trash) and the human-consent step, which annotations cannot convey. It does not cover scan duration or result volume, keeping it below 5.

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?

Three short sentences, front-loaded with what the tool returns and ordered by size, followed by the dry-run guarantee and the downstream requirement. No filler.

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?

An output schema exists so return-value explanation is unnecessary, and the description still flags the key output (scan_id) and the required consent step. What is missing is disambiguation from analyze_disk_usage for an agent choosing between the two scanning tools.

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%, including an enum explanation for target_type and per-field descriptions for size and day thresholds, so the schema carries the parameter burden. The description only gestures at 'conditions' without adding format or default guidance, which is the expected baseline when the schema is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource ('enumerate deletion candidates matching conditions, ordered by size descending') and immediately marks the operation as dry-run. It clearly separates itself from move_to_trash by noting nothing is deleted, though it does not articulate how it differs from the sibling analyze_disk_usage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives real workflow guidance: the returned scan_id is required by move_to_trash, and results should be presented to the user for consent. It stops short of naming when to prefer analyze_disk_usage or which target_type to pick, so selection among scan modes is left to the schema.

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. 4 tool updatesv0.1.0
    • First observedanalyze_disk_usage
    • First observedget_os_env_paths
    • First observedmove_to_trash
    • First observedscan_cleanup_targets

TDQS

A4/5.0

Scored across 4 tools

Disambiguation4/5

Each tool targets a distinct stage: env-path discovery, read-only size analysis, dry-run candidate scanning, and the actual trash move. analyze_disk_usage and scan_cleanup_targets both traverse directories and return sizes, which could be momentarily confused, but the descriptions clearly separate breakdown analysis from deletion-candidate listing with the required scan_id.

Naming Consistency5/5

All four tools follow the same snake_case verb_noun convention (get_os_env_paths, analyze_disk_usage, scan_cleanup_targets, move_to_trash). Verb choice is descriptive and consistent across the set.

Tool Count4/5

Four tools is on the lean side but each maps to a necessary step in the cleanup workflow with no redundancy. A slightly richer surface (e.g. trash listing/restore) would round it out, but nothing here feels superfluous.

Completeness4/5

The core lifecycle (discover candidate locations → analyze sizes → scan for deletable items → move to trash with consent) is fully covered, including a safety-first dry-run step. Gaps exist around undo/restore-from-trash and inspection of what was moved, but agents can work around these with OS-level operations.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Official server for the ShieldFive end-to-end encrypted vault. Moves files off your computer into the vault, reading each copy back and verifying it before the original goes to a local trash folder (nothing deleted). Also finds duplicates by content and tidies folders. Decrypts on your machine; access is scoped, expiring, revocable and undoable.
    74 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables natural-language management of macOS disk cleanup by scanning large files, AI model weights, and caches, identifying duplicates, and safely moving files to Trash or permanently deleting them with confirmation.
    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
  • 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.
    MIT