Skip to main content
Glama
dissectmac-mcp

dissectmac-mcp

by nocodegeeks
README.md
# dissectmac-mcp

[![npm version](https://img.shields.io/npm/v/dissectmac-mcp.svg)](https://www.npmjs.com/package/dissectmac-mcp)
[![CI](https://github.com/nocodegeeks/dissectmac-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/nocodegeeks/dissectmac-mcp/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Let your AI agent find what is filling your Mac's disk, then move it to the Trash after you say yes.

It is an MCP server and a CLI for macOS. It needs Node 22.12 or later.

## Install

### Claude Desktop

Download `dissectmac-mcp.mcpb` from the [latest release](https://github.com/nocodegeeks/dissectmac-mcp/releases/latest) and open it. Claude Desktop installs it as an extension.

Or add this to `~/Library/Application Support/Claude/claude_desktop_config.json` and restart Claude Desktop:

```json
{"mcpServers":{"dissectmac":{"command":"npx","args":["-y","dissectmac-mcp"]}}}
```

### Claude Code

```bash
claude mcp add dissectmac -- npx -y dissectmac-mcp
```

Or install it as a plugin. The plugin runs the npm package through `npx`, so Node 22.12 or later must be on your PATH.

```bash
claude plugin marketplace add nocodegeeks/dissectmac-mcp
claude plugin install dissectmac@dissectmac
```

### Cursor

Add this to `~/.cursor/mcp.json`:

```json
{"mcpServers":{"dissectmac":{"command":"npx","args":["-y","dissectmac-mcp"]}}}
```

### Windsurf

Add this to `~/.codeium/windsurf/mcp_config.json`:

```json
{"mcpServers":{"dissectmac":{"command":"npx","args":["-y","dissectmac-mcp"]}}}
```

## Tools

| Tool | What it does | Writes? |
| --- | --- | --- |
| `storage_overview` | Free and used space (used is total minus free, so it covers the whole disk and not only the system volume), local Time Machine snapshots and known caches, each tagged safe or caution | No |
| `scan_folder` | Largest subfolders and files under a path | No |
| `find_large_files` | Large files with size, modified and last-used dates | No |
| `list_apps` | Apps in `/Applications` and `~/Applications` with size, version and last used | No |
| `find_app_leftovers` | Support files, caches, preferences and launch agents an app left behind | No |
| `move_to_trash` | Moves the paths you chose to the Trash | Yes, only with `confirm: true` |

The server also ships a `free_up_space` prompt. It walks the agent through a scan, a shortlist and your confirmation.

Over MCP each tool call stops after 45 seconds, inside the 60 second limit most clients use. If a scan runs out of time you get what it measured so far, marked partial. The CLI allows longer scans.

## Safety

- Everything runs on your Mac. The server makes no network calls and sends no telemetry.
- Five of the six tools only read. Only `move_to_trash` changes anything.
- `move_to_trash` never deletes. Without `confirm: true` it returns a preview of what would move and how big it is.
- Items go to the Trash through macOS's file manager API. They stay recoverable in the Trash, but Finder's "Put Back" may not work for them.
- A path guard refuses protected locations. It never touches `/System`, `~/Library/Keychains`, Mail, Messages, Photos, Calendars, Contacts, Notes, Safari data, iCloud Drive, cloud storage folders under `~/Library/CloudStorage` or `.git` internals.
- Whole top-level folders such as `~/Documents` cannot be trashed. Their contents can.
- External drives under `/Volumes` are supported.
- If one path in a call is refused, nothing in that call is moved.
- Some folders are protected by macOS. Give your AI client app Full Disk Access in System Settings > Privacy & Security so scans can include them.
- `DISSECTMAC_MCP_TIMEOUT_MS` overrides every tool timeout. It is a testing knob. A value below 2000 disables trashing.

## CLI

The same tools work from the terminal. Add `--json` to any command for the raw result.

```bash
npx dissectmac-mcp overview
npx dissectmac-mcp scan ~/Library --depth 2 --min 100 --limit 20
npx dissectmac-mcp large ~ --min 500 --older 180
npx dissectmac-mcp apps
npx dissectmac-mcp leftovers "Google Chrome"
npx dissectmac-mcp trash ~/Downloads/old.dmg            # preview only
npx dissectmac-mcp trash ~/Downloads/old.dmg --confirm  # move to the Trash
npx dissectmac-mcp capabilities --json
```

`capabilities` lists every tool with its JSON Schema, the exit codes and the environment variables.

| Exit code | Meaning |
| --- | --- |
| 0 | Complete |
| 1 | Error, invalid input, or `trash` without `--confirm` |
| 2 | Path refused by the path guard |
| 3 | Partial result (a probe timed out or some items failed) |

Run with no arguments and it starts the MCP server on stdio.

## Why not the app?

This server gives an agent the raw numbers and a confirm-first way to trash things. [Dissect Mac](https://dissectmac.com/?utm_source=github&utm_medium=readme) shows the same disk as a treemap you can click through, with an uninstaller and a preview before you empty the Trash.

## License

MIT. See [LICENSE](LICENSE).