cacheout-mcp
OfficialAllows cleaning of Brave browser cached content.
Allows cleaning of Bun package manager cache.
Allows cleaning of CocoaPods specs and pods cache.
Allows cleaning of Docker virtual disk (images and containers).
Allows cleaning of shared Electron framework cache.
Allows cleaning of Gradle build cache.
Allows cleaning of Homebrew downloaded bottles and tarballs cache.
Allows cleaning of iOS simulator data and device debug symbols.
Allows cleaning of Next.js SWC cache (part of TypeScript cache).
Allows cleaning of Node.js native addon headers cache (node-gyp).
Allows cleaning of npm package cache.
Allows cleaning of pnpm content-addressable store.
Allows cleaning of Prisma ORM query engine binaries cache.
Allows cleaning of pip cache (Python packages from PyPI).
Allows cleaning of Python pip cache.
Allows cleaning of PyTorch model cache (torch hub).
Allows cleaning of SWC compiler cache (part of TypeScript cache).
Allows cleaning of Swift Package Manager cache.
Allows configuration of Telegram notifications for alerts.
Allows cleaning of TypeScript compiler cache.
Allows cleaning of Xcode derived data and device support caches.
Allows cleaning of Yarn package cache.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cacheout-mcp free up 10GB of disk space"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cacheout-mcp
MCP server for macOS disk cache management — lets AI agents free disk space on demand.
Why
When you run AI agents (OpenClaw, Claude Code, etc.) on a Mac Mini or any macOS machine, disk pressure can silently degrade performance. Swap thrashing, failed builds, Docker OOM — all from running out of space that's locked up in developer caches.
cacheout-mcp gives your agent a set of tools to detect and fix disk pressure in real-time:
Agent detects 2 GB free → calls cacheout_smart_clean(target_gb=15) → 15 GB freed in 3 secondsRelated MCP server: nucleus-apple-mcp
Three Execution Modes
Mode | When | How it works |
Socket | Cacheout daemon running with Unix socket | Connects to daemon for real-time data, trend analysis, health scores |
App | Cacheout.app installed, no running daemon | Delegates to Cacheout CLI binary ( |
Standalone | No Cacheout.app (headless servers) | Cleans caches directly via Python, reads sysctl for memory stats |
Mode is auto-detected at startup (socket → app → standalone). Override with CACHEOUT_MODE=standalone or CACHEOUT_MODE=app.
Install
# From PyPI (when published)
pip install cacheout-mcp
# From source
cd cacheout-mcp
pip install -e .MCP Configuration
Claude Code / Claude Desktop
Add to ~/.claude/claude_desktop_config.json or your project's .mcp.json:
{
"mcpServers": {
"cacheout": {
"command": "cacheout-mcp",
"env": {}
}
}
}OpenClaw / Custom Agents
{
"mcpServers": {
"cacheout": {
"command": "python",
"args": ["-m", "cacheout_mcp.server"],
"env": {
"CACHEOUT_MODE": "standalone"
}
}
}
}With uv (no install needed)
{
"mcpServers": {
"cacheout": {
"command": "uvx",
"args": ["cacheout-mcp"]
}
}
}Tools
cacheout_get_disk_usage
Check current disk space. No parameters.
→ {"total": "500.1 GB", "free": "23.4 GB", "used_percent": 95.3}cacheout_scan_caches
Scan all cache directories and report sizes. Optional filters:
categories: List of slugs to scan (omit for all)min_size_mb: Only show categories above this size
→ {"total_cleanable": "45.2 GB", "categories": [{"slug": "xcode_derived_data", "size_human": "15.0 GB", ...}]}cacheout_clear_cache
Clear specific categories by slug. Requires explicit category list.
categories: Required list of slugsdry_run: Preview without deleting
← {"categories": ["xcode_derived_data", "homebrew_cache"], "dry_run": false}
→ {"total_freed": "18.2 GB", "results": [...]}cacheout_smart_clean
The primary tool for agents. Specify how much space you need; it clears safest caches first.
target_gb: Required — how many GB to freedry_run: Preview modeinclude_caution: Include Docker and other high-risk categoriesfree_memory: Also run memory purge after disk cleanup (addsmemory_freed,purge_resultto response)
← {"target_gb": 10.0}
→ {"target_met": true, "total_freed_human": "12.3 GB", "disk_after": {"free_gb": 17.5}}cacheout_status
Server status, mode, and available categories.
cacheout_get_memory_stats
Check RAM, swap, memory pressure, and memory tier. No parameters.
→ {"total_physical_mb": 16384.0, "memory_tier": "comfortable", "estimated_available_mb": 6096.0, ...}cacheout_get_process_memory
List top memory-consuming processes. Optional top_n and sort_by parameters.
Returns envelope: {mode, capabilities, data: {processes, count, sort_by_applied}, partial}.
cacheout_get_compressor_health
Check macOS memory compressor ratio, compression/decompression rates, and thrashing detection. No parameters.
Returns envelope: {mode, capabilities, data: {compressor_ratio, thrashing, ...}, partial}.
cacheout_memory_intervention
Run memory interventions. Required parameters:
intervention_name: Canonical name (e.g.,"purge")confirm:falsefor dry-run preview,trueto execute
Returns envelope: {mode, capabilities, data: {dry_run, intervention, ...}, partial}.
cacheout_system_health
Combined disk + memory + alert health check with a 0-100 score. No parameters. In socket mode, fetches from daemon. In standalone, computes locally.
cacheout_check_alerts
Read watchdog alerts (near-zero cost file read). Optional acknowledge parameter.
cacheout_get_recommendations
Get predictive memory/disk recommendations. Socket mode includes trend-based types
(exhaustion_imminent, compressor_degrading). Standalone returns snapshot types only.
cacheout_configure_autopilot
Validate and apply autopilot/watchdog configuration. Required config parameter (dict with
version, enabled, optional rules/webhook/telegram). This is a write/validate/apply tool.
Cache Categories (23 total)
Slug | Risk | What it cleans |
| Safe | Build artifacts, indexes |
| Safe | Fast Python installer cache |
| Safe | Downloaded bottles/tarballs |
| Safe | npm package cache |
| Safe | Yarn package cache |
| Safe | pnpm content-addressable store |
| Safe | Bun package manager cache |
| Safe | TypeScript compiler + Next.js SWC cache |
| Safe | Playwright browser binaries |
| Safe | CocoaPods specs and pods |
| Safe | Native Node.js addon headers |
| Safe | Prisma ORM query engine binaries |
| Safe | Swift Package Manager cache |
| Safe | Gradle build cache |
| Safe | Python pip cache |
| Safe | ChatGPT desktop app cache |
| Safe | VS Code updates and extensions |
| Safe | Shared Electron framework cache |
| Review | Brave/Chrome cached web content |
| Review | iOS device debug symbols |
| Review | iOS/watchOS simulator data (uses xcrun) |
| Review | PyTorch models (slow to re-download) |
| Caution | Docker virtual disk (all images/containers) |
Smart Clean Priority
When smart_clean is called, categories are cleaned in this order:
Safe categories, sorted by clean_priority (build artifacts first)
Review categories (browser caches, device support)
Caution categories (Docker) — only if
include_caution=true
Stops as soon as target_gb is freed.
Environment Variables
Variable | Default | Description |
| auto-detect | Force |
| auto-detect | Path to Cacheout binary |
Adding the CLI to Cacheout.app
If you maintain the Cacheout Swift app, add the CLIHandler.swift file to your Sources
and update CacheoutApp.swift to check CLIHandler.shouldHandleCLI() on init.
This enables Cacheout --cli scan, Cacheout --cli clean, etc. for app-mode integration.
License
MIT
Available Tools
13 toolscacheout_check_alertsA
Check if the Cacheout watchdog has raised any disk/swap/memory alerts. This is a near-zero-cost check (reads a small JSON file). Use this at the start of tasks, before builds, or after errors — NOT on a polling loop. Returns null if no alert is active. If an alert exists, review it and take action with smart_clean, then call again with acknowledge=true to clear it.
Inputs: params (required). Returns: result
cacheout_clear_cacheADestructiveIdempotent
Clear specific cache categories to free disk space.
Removes the contents of the specified cache directories. The directories themselves are preserved — only their contents are deleted. All cleared caches will regenerate automatically when their respective tools are used.
IMPORTANT: Use cacheout_scan_caches first to see sizes, then pass the slugs of categories you want to clear. Use dry_run=true to preview.
Args: params: Categories to clear and whether to dry-run.
Returns: str: JSON report of what was cleaned and total space freed. { "total_freed": "12.3 GB", "total_freed_bytes": 13204889600, "dry_run": false, "results": [ { "slug": "xcode_derived_data", "name": "Xcode DerivedData", "bytes_freed": 8500000000, "freed_human": "8.5 GB", "success": true, "error": null } ] }
Inputs: params (required). Returns: result
cacheout_configure_autopilotAIdempotent
Configure the autopilot policy for the headless daemon.
Uses a validate-then-write flow:
Writes candidate config to autopilot.candidate.json (0600)
If daemon running: validates via socket; else validates locally
Invalid: deletes candidate, returns errors
Valid: atomically renames candidate to autopilot.json
If daemon: sends SIGHUP and polls for config generation increment
The local validator mirrors the daemon's shared validator exactly:
version must be 1
enabled must be boolean
Rules: actions must be 'pressure-trigger' or 'reduce-transparency'
Webhook (if present): url required, format = 'generic', timeout_s 1-60
Telegram (if present): bot_token + chat_id required, timeout_s 1-60
Args: params: Config object to validate and apply.
Returns: str: JSON with success status, validation errors, and any warnings.
Inputs: params (required). Returns: result
cacheout_get_compressor_healthARead-onlyIdempotent
Get macOS memory compressor health metrics.
Returns compressor ratio, compression/decompression rates (via dual-sample), thrashing detection, pressure level, and trend information.
Takes two samples ~1 second apart to compute instantaneous rates. Thrashing is flagged when decompression_rate > 100/sec AND > 2x compression_rate (aligned with CompressorTracker.swift thresholds).
Trend requires multiple invocations over time — a single call returns "unknown" with partial=true.
In standalone mode, reads vm_stat and sysctl directly.
In app mode, delegates to --cli memory-stats.
Returns: str: JSON envelope with mode, capabilities, data (ratio, rates, thrashing), partial.
Inputs: params (required). Returns: result
cacheout_get_disk_usageARead-onlyIdempotent
Get current disk space on the boot volume.
Returns total, used, and free disk space with human-readable sizes. Use this to check if disk pressure exists before deciding to clean.
Returns: str: JSON with total, free, used space and percentages. { "total": "500.1 GB", "free": "23.4 GB", "used": "476.7 GB", "free_gb": 23.4, "used_percent": 95.3 }
Inputs: params (required). Returns: result
cacheout_get_memory_statsARead-onlyIdempotent
Get current system memory statistics on macOS.
Returns physical RAM breakdown (free, active, inactive, wired, compressed), swap usage, compressor ratio, memory pressure level, and an actionable memory tier classification.
Use this to check memory health before builds, heavy tasks, or when investigating performance issues. The memory_tier field provides a quick assessment: abundant > comfortable > moderate > constrained > critical.
In app mode, delegates to CacheOut CLI. In standalone mode, reads sysctl values directly (no CacheOut.app needed).
Returns: str: JSON with memory statistics. { "total_physical_mb": 8192.0, "free_mb": 512.3, "active_mb": 3200.1, "inactive_mb": 1024.5, "wired_mb": 2048.7, "compressed_mb": 800.2, "compressor_ratio": 2.5, "swap_used_mb": 256.0, "pressure_level": 1, "memory_tier": "moderate", "estimated_available_mb": 1536.8, "mode": "standalone" }
Inputs: params (required). Returns: result
cacheout_get_process_memoryARead-onlyIdempotent
Get top processes by memory usage on macOS.
Returns a ranked list of the top N processes sorted by memory consumption.
In standalone mode, uses RSS from ps (labeled as an estimate).
In app mode, uses physical footprint from the Cacheout CLI.
Sort keys are mode-dependent:
standalone: 'rss' (default)
app: 'phys_footprint' (default)
The capabilities map in the response shows which sort keys are available.
sort_by_pageins is gated to false in all modes this phase.
Args: params: top_n (default 10) and optional sort_by key.
Returns: str: JSON envelope with mode, capabilities, data (processes + sort info), partial.
Inputs: params (required). Returns: result
cacheout_get_recommendationsARead-onlyIdempotent
Get predictive memory recommendations from the Cacheout engine.
Returns advisory recommendations about memory health, including compressor degradation, swap pressure, high-growth processes, Rosetta-translated processes, and agent memory pressure.
Mode-dependent behavior:
socket: Full recommendations from daemon (all 7 types when conditions apply)
app: Snapshot-only recommendations from CLI (no trend-based types)
standalone: Basic recommendations from sysctl (compressor_low_ratio, swap_pressure only)
The partial flag in _meta indicates degraded results:
Always true in app/standalone modes (no trend data)
True in socket mode only when daemon's process scan was incomplete
Returns: str: JSON with recommendations array and _meta. { "recommendations": [ { "type": "compressor_low_ratio", "message": "Compression ratio 1.5 is below 2.0", "process": null, "pid": null, "impact_value": 1.5, "impact_unit": "ratio", "confidence": "low", "source": "standalone" } ], "_meta": { "mode": "standalone", "count": 1, "partial": true, "source": "standalone" } }
Inputs: no named parameters. Returns: result
cacheout_memory_interventionADestructive
Execute a memory reclamation intervention on macOS.
IMPORTANT: Always call with confirm=false first to preview what will happen, then call again with confirm=true to execute.
Available interventions:
purge: Flush the Unified Buffer Cache (UBC) to reclaim purgeable memory. Works in both standalone and app modes.
trigger_pressure_warn: Manual pressure event (app only, not yet available)
reduce_transparency: Toggle transparency setting (app only, not yet available)
delete_sleepimage: Remove sleepimage file (app only, not yet available)
cleanup_snapshots: Clean orphaned APFS snapshots (app only, not yet available)
flush_compositor: Display mode toggle (app only, not yet available)
In standalone mode, only 'purge' is supported. In app mode, only 'purge' is currently wired; other interventions will unlock as the CLI surface grows.
The response always includes a capabilities map showing which
interventions are available in the current mode.
Args: params: intervention_name, confirm flag, and optional target_pid.
Returns: str: JSON envelope with mode, capabilities, data, partial.
Inputs: params (required). Returns: result
cacheout_scan_cachesARead-onlyIdempotent
Scan macOS cache directories and report their sizes.
Scans developer tool caches (Xcode, Homebrew, npm, pip, Docker, etc.) and reports the size of each. Results are sorted by size (largest first).
Use this to understand what's consuming disk space before cleaning.
Args: params: Optional filters — specific category slugs or minimum size.
Returns: str: JSON array of cache categories with sizes, sorted largest first. [ { "slug": "xcode_derived_data", "name": "Xcode DerivedData", "size_bytes": 15032000000, "size_human": "15.0 GB", "item_count": 4230, "risk_level": "safe", "description": "Build artifacts...", "rebuild_note": "Xcode rebuilds on next build" } ]
Inputs: params (required). Returns: result
cacheout_smart_cleanADestructive
Intelligently free disk space by clearing caches in priority order.
This is the PRIMARY tool for agents managing disk pressure. Specify how many GB you need freed, and the server clears the safest caches first:
Build artifacts (Xcode DerivedData) — always regenerates
Package manager caches (Homebrew, npm, pip) — re-downloads as needed
Browser caches — rebuilds on browsing
Docker (only if include_caution=true) — destructive, last resort
The server stops as soon as the target is met. Use dry_run=true to preview which categories would be cleaned and how much space would be freed.
Typical use: An agent detects low disk space (or needs room for swap/builds) and calls smart_clean(target_gb=10.0) to free 10 GB immediately.
Args: params: Target GB to free, dry_run flag, and caution inclusion.
Returns: str: JSON report with before/after disk state and what was cleaned. { "target_gb": 10.0, "target_met": true, "total_freed_human": "12.3 GB", "dry_run": false, "disk_before": {"free_gb": 5.2, ...}, "disk_after": {"free_gb": 17.5, ...}, "cleaned": [...], "skipped": [...] }
Inputs: params (required). Returns: result
cacheout_statusARead-onlyIdempotent
Get cacheout-mcp server status, mode, and available categories.
Returns the execution mode (standalone or app), the Cacheout binary path if in app mode, and a list of all available cache category slugs.
Use this to verify the server is running and understand its capabilities.
Returns: str: JSON with mode, binary path, and category list.
Inputs: params (required). Returns: result
cacheout_system_healthARead-onlyIdempotent
Get overall system health score with alerts.
Returns a health score (0-100, -1 if no data), the data source, and any active alerts from the daemon.
In socket mode (daemon running), fetches health data directly from the daemon's Unix socket for <1ms latency. In CLI/standalone mode, computes the health score locally using the canonical formula.
The health score formula: base = 100 critical pressure: -50, warn pressure: -25 swap penalty: min(50, swap_used_percent / 2) compressor penalty: min(30, max(0, (3.0 - ratio) * 10)) score = max(0, base - penalties)
Returns: str: JSON with score (Int, -1 if no data), source, and alerts array.
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool targets a distinct function: alerts, memory stats, disk usage, cache scanning, cache clearing, smart cleaning, etc. Even similar tools like clear_cache and smart_clean are clearly differentiated by purpose and usage pattern.
All tools use the 'cacheout_' prefix with an underscore-separated verb_noun structure. While most follow verb_noun (e.g., check_alerts, get_disk_usage), a few like memory_intervention and system_health use noun_noun, causing minor inconsistency.
13 tools is well-scoped for a system health and cache management server. Each tool covers a necessary operation without being too numerous or too few, balancing comprehensiveness with simplicity.
The tool surface covers monitoring (disk, memory, alerts, health score), cache scanning and cleaning (specific and smart), memory intervention, recommendations, and configuration. No obvious gaps for the intended domain of macOS cache and resource management.
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
An MCP memory server. One memory your agents share — across models, devices and apps.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP server with intelligent memory management and file monitoring that enables context-aware AI assistance across multiple LLM providers (Grok, OpenAI, Claude, Ollama) with persistent memory of interactions and real-time file system changes.-
- AlicenseBqualityDmaintenanceA macOS MCP server that provides AI agents with secure access to Calendar, Reminders, Notes, and Health data via native Apple APIs.3023MIT
- AlicenseNot gradedqualityAmaintenanceA lightweight MCP server that bridges AI agents and macOS, enabling automation of file navigation, application control, UI interaction, browser automation, and system operations.244MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Apple container to manage, build, inspect, and diagnose Linux containers on macOS directly from AI agents.Apache 2.0