Disk Inventory MCP

io.github.LemmaLemming由 GitHub 帳號 LemmaLemming 發布v0.1.0更新於 Oct 24, 2026

Read-only macOS disk analysis with bounded scans, size queries, and extension breakdowns.

已驗證STDIO僅桌面檔案與儲存資料與分析

概覽

AI 產生的概覽

一個唯讀的 macOS 磁碟分析工具,讓助理掃描已授權目錄、找出大檔案與大資料夾,並依副檔名統計用量。

可以做什麼
列出啟動時授權的目錄,並啟動、查詢進度或取消有上限的背景中繼資料掃描,回報進度、總計與略過的路徑。對掃描結果排序、篩選、分頁或下鑽到某個目錄,並檢視分頁的副檔名分組。回報掃描不完整、邏輯位元組與配置位元組、略過的檔案系統等統計說明。
適用情境
適合讓助理協助查明特定 macOS 資料夾的空間用量、比較大檔案或子資料夾、了解哪些檔案類型佔最多,同時不給它任何寫入或刪除能力。
執行需求
在 macOS 13 或更新版本上以本機 stdio 程序執行,可透過 Homebrew 安裝(需要 Xcode Command Line Tools 與 Swift 5.9 以上),也可使用發行版二進位檔或 MCP 套件。啟動時必須至少指定一個明確的絕對根目錄;不需要帳號、API 金鑰或網路存取。
安裝前請注意
授權的根目錄應限於你打算分析的範圍,因為路徑、大小與錯誤細節會回傳給 MCP 用戶端,用戶端可能轉送給模型供應商或保留日誌。檔名應視為不可信資料。可下載的二進位檔僅做臨時簽章,未經公證。結果是即時觀察而非快照,也不能證明任何檔案可以安全刪除。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Disk Inventory MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Disk Inventory MCP

A local, read-only disk analyzer for macOS, with a CLI and an MCP server in one native executable. Find large files and folders, inspect file-extension breakdowns, and see exactly where a scan was incomplete.

v0.1.0 is a read-only preview. It has no deletion, Trash, cleanup execution, or content-reading tools. Requires macOS 13 or later. No runtime dependencies beyond macOS frameworks.

Install

Recommended: install from the project's Homebrew tap (builds from source; requires Xcode Command Line Tools with Swift 5.9 or later):

sh
brew install LemmaLemming/tap/disk-inventory-mcpdisk-inventory --version

GitHub Releases also provides a universal Intel/Apple Silicon .tar.gz, an MCP bundle (.mcpb), corresponding source, and SHA256SUMS. Downloadable binaries are ad-hoc signed, not Developer ID signed or Apple notarized. Homebrew builds from source. MCP bundle import depends on client support and may be subject to macOS security checks.

CLI

sh
disk-inventory scan ~/Downloadsdisk-inventory scan ~/Downloads --jsondisk-inventory scan ~/Downloads --json --limit 50 --max-entries 200000 --max-seconds 60

JSON output includes summary, top_children, and file_types. Byte counts are decimal strings to preserve 64-bit precision. Top children are immediate children of the root; directory totals include their descendants. CLI exit codes: 0 complete, 2 invalid invocation, 3 incomplete (JSON remains usable).

MCP setup

Configure any MCP client that launches local stdio servers. Replace the example paths with absolute paths on your computer; use command -v disk-inventory to find the installed executable. The example below uses the usual Apple Silicon Homebrew location:

json
{  "mcpServers": {    "disk-inventory": {      "command": "/opt/homebrew/bin/disk-inventory",      "args": ["mcp", "--root", "/Users/YOU/Downloads"]    }  }}

Add more --root, PATH pairs to grant additional directories. The server refuses to launch without an explicit root and rejects scan paths outside those roots, including symlink escapes. An MCPB-compatible client can instead import the release bundle and prompt for one allowed directory.

Example prompts:

  • “Show the largest folders in my Downloads directory and tell me whether the scan missed anything.”
  • “Within that scan, find the largest .zip files.”
  • “Break down the observed files by extension and explain the difference between logical and allocated bytes.”
ToolPurpose
list_rootsShow directories granted at launch
scan_startStart a bounded background metadata scan; return a scan ID
scan_statusProgress, final totals, skipped paths, and accounting caveats
scan_cancelCooperatively stop the active scan
query_usageSort/filter results, paginate, or drill into a directory ID
file_typesPaginated file-extension groups

The server implements newline-delimited JSON-RPC over stdio, initialization, ping, and tools. It negotiates protocol versions 2025-11-25, 2025-06-18, and 2025-03-26. Tool results include both structured JSON and serialized text. Scan jobs are application-level IDs; this release does not advertise the optional MCP Tasks capability. Poll status at sensible intervals (for example once per second).

Accounting and limits

  • Default budget: 100,000 entries and 30 seconds. Maximum per scan: 500,000 entries and 300 seconds. Directory traversal depth is capped at 128. Time and cancellation checks occur between filesystem calls; an OS call blocked on a filesystem can delay either.
  • One active scan and the two latest finished scans are retained in memory. Starting further scans evicts older finished results. Restarting the process discards all scans. There is no persistent database or scan comparison yet.
  • Queries return at most 200 entries per page. The root has ID 0. IDs are meaningful only within their scan. parent_id returns immediate children; omitting it considers all descendants. Avoid summing directory totals with their children.
  • Logical bytes count each observed regular-file or symlink path. Allocated bytes use st_blocks * 512, with device/inode deduplication for hard links. Shared hard-link storage is assigned to the first encountered path, so per-folder attribution can vary with enumeration order.
  • Directory metadata is excluded. APFS clones and snapshot-retained blocks are not deduplicated; allocated bytes are not reclaimable bytes. Nothing here establishes that a file is safe to delete.
  • Descendant symlinks are measured without following them. Other filesystems are skipped and reported. The root path is canonicalized at launch; traversal opens components without following symlinks. Disk Inventory X's special firmlink traversal is not copied into this implementation.
  • Permission errors, vanished entries, limits, mount boundaries, and invalid UTF-8 names set complete=false. Totals then describe only observed data. Up to 100 issue details are returned, with a full issue count. Entries can report zero observed bytes and complete=false; that does not mean empty.
  • Scans are live observations, not atomic filesystem snapshots. Contents and directories may change during traversal. The tool does not request elevated privileges or bypass macOS privacy protections.
  • File types are inferred only from filename extensions, not content or application ownership. The scanner makes no file-content reads; browsing cloud-provider directories can still involve provider metadata activity.

Privacy

The executable makes no network requests, contains no telemetry, and writes no scan cache. It returns paths, sizes, and error details to the invoking CLI or MCP client. That client may send tool results to its model provider or retain logs according to its own settings. Treat filenames as untrusted data. Keep granted roots limited to what you intend to analyze.

Development

sh
swift build -c releaseDISK_INVENTORY_BIN="$PWD/.build/release/disk-inventory" python3 tests/integration.pybash scripts/package.sh

The integration tests use generated temporary fixtures: regular files, hard links, sparse files, symlink loops/escapes, unreadable directories, hostile filenames, pagination, cancellation, CLI exit codes, and MCP protocol errors. They do not scan personal directories. Optional interoperability tests use the official Python MCP SDK; see tests/sdk_interop.py.

License and provenance

GPL-3.0-or-later; see LICENSE. This is a new Swift implementation informed by the assessment of Tjark Derlien's Disk Inventory X and TreeMapView. It does not bundle their Objective-C source, artwork, TreeMapView, Omni frameworks, or CocoaTech components, and is not an official release of Disk Inventory X. The GPL license text is reproduced from the public Disk Inventory X checkout. Original upstream ownership and notices remain in their respective repositories.

Planned follow-ups: persistent scan comparisons, evidence-based cleanup previews, then separately reviewed cleanup execution. These are not features of v0.1.0.

來源:README.md,提交 eed7fe5

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分