Skip to main content
Glama

mac-cleaner-mcp

A conservative macOS developer/storage cleaner exposed through the official Model Context Protocol TypeScript SDK. It is not a full disk optimizer: it reports first, refuses broad destructive locations, and supports dry runs.

Tools

  • scan_junk: DerivedData, iOS DeviceSupport, Gradle/Android cache, Homebrew cache, Node package cache, Docker reclaimable space, ~/Library/Caches, large Downloads files (>100 MB), and discovered node_modules.

  • clean_junk: accepts categories and defaults to dryRun: true. Only DerivedData, DeviceSupport, Android/Gradle, Homebrew, and Docker can be cleaned. Downloads, node_modules, and broad cache roots are intentionally refused.

  • get_disk_usage: runs df for a selected path.

Related MCP server: mcp-local-sandbox-cleaner

Install and run

Requires macOS, Node.js 20+, and optionally Docker. Do not run as root.

git clone https://github.com/FFFames/mac-cleaner-mcp.git
cd mac-cleaner-mcp
npm install
npm run build
node dist/index.js

MCP uses stdio, so the process should be launched by the MCP client. Cleaning can delete files; inspect the dry-run output and keep backups before setting dryRun: false.

Claude Desktop / Cursor

Add the absolute path to dist/index.js in the client's MCP configuration:

{"mcpServers":{"mac-cleaner":{"command":"node","args":["/ABSOLUTE/PATH/mac-cleaner-mcp/dist/index.js"]}}}

Restart the client, call scan_junk, then call clean_junk with selected categories and dryRun: true. Use false only after reviewing the result. Cursor supports the same stdio MCP server configuration through its MCP settings.

Poke / remote bridge

For a local Poke-compatible bridge, run this server as a child process and proxy MCP JSON-RPC stdin/stdout over an authenticated HTTPS endpoint. A simple option is an SSH/HTTP bridge or ngrok in front of your own bridge process:

ngrok http 8787

Configure the bridge's upstream command as node /ABSOLUTE/PATH/mac-cleaner-mcp/dist/index.js, then register the HTTPS ngrok URL with your Poke/MCP connection. Never expose an unauthenticated endpoint; use an ngrok auth token, allowlist callers, and rotate the URL/token. The cleaner itself is local-only and has no network listener.

Safety

The implementation uses explicit category allowlists, no shell wildcard expansion, dry-run by default, and refuses Downloads, node_modules, and the entire user cache root. Review source and test on a noncritical account before use.

Available Tools

3 tools
clean_junkA

Safely remove selected caches. Always dry-run first.

Inputs: categories (required), dryRun.

get_disk_usageC

Report disk capacity and free space.

Inputs: path.

scan_junkD

Scan macOS developer/system caches and reclaimable space.

Inputs: categories.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose: scanning for junk, cleaning junk, and reporting disk usage. No overlap or ambiguity between them.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern (scan_junk, clean_junk, get_disk_usage), making them predictable and readable.

    Tool Count5/5

    With only 3 tools, the set is minimal but well-scoped for its intended purpose. The count is within the ideal 3-15 range and each tool contributes to the core workflow.

    Completeness4/5

    The set covers the essential lifecycle: scan to find junk, clean to remove it, and get_disk_usage for context. Minor gaps like granular junk category selection or detailed scan reports are absent but not critical.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      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.
      58 npm
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents to audit and sweep away transient scratch directories, bloated test caches, and forgotten probe scripts in a workspace, with dry-run previews to guarantee nothing tracked or production-related is touched. It also detects zombie background dev servers still holding common ports like 3000, 5173, and 8000.
      3
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Read-only disk analysis and reversible cleanup for macOS 13 and later. Scans the Mac and shows what is actually taking space, then moves only the items you approve to the Trash — no rm -rf, and every operation is undoable.
      34
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to scan a Mac for reclaimable disk space and safely move selected items to the Trash, with dry-run defaults, protected paths, and confirmation before permanent deletion.
      12
      MIT