
Diff Anything
io.github.MartinGryner由 GitHub 帳號 MartinGryner 發布v0.1.0更新於 Oct 29, 2026
Compare local files, folders and API schemas through the installed Diff Anything CLI.
概覽
包裝本機已安裝的 Diff Anything 命令列工具,讓助理比較本機檔案、資料夾與 API schema,並讀取差異報告。
- 可以做什麼
- 檢視已安裝 CLI 的版本、支援的參數、已設定的根目錄與包裝層限制
- 依絕對路徑比較兩個檔案,回傳 CLI 自動辨識的差異報告
- 比較兩個資料夾,回傳預設的資料夾比較報告
- 比較兩個 API schema 檔案,檢查相容性並標出破壞性變更
- 適用情境
- 適合想讓助理檢查本機文件、JSON 檔、目錄樹或 API schema 之間的差異、又不想把內容貼進對話的情境,前提是已在使用 Diff Anything 桌面應用程式。
- 執行需求
- macOS 或 Windows 上的 Node.js 22 或更新版本,以及已安裝且含命令列的 Diff Anything 應用程式(macOS 需另裝命令列輔助工具,Windows 需啟用商店應用程式的執行別名)。必須設定 DIFF_ANYTHING_ROOTS:由既有絕對目錄組成的 JSON 陣列,作為允許比較的範圍。資料夾與 API schema 比較需要 Diff Anything Pro。可用 DIFF_ANYTHING_CLI 指定執行檔路徑。安裝 npm 套件需要連線至套件來源。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Diff Anything,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Diff Anything MCP
Use the installed Diff Anything command line from an MCP client to compare local files, folders, and API schemas. The optional npm package runs over stdio as a child process of your client.
Requirements and setup
- Node.js 22 or newer on macOS or Windows.
- An installed Diff Anything app with its command line. Install the app from the product page. On Windows, the Microsoft Store version provides the command line through its
diff-anything.exeapp execution alias. On a Mac, the Mac App Store version is sandboxed and cannot read files named on a command line, so install the free Diff Anything command-line helper, which installs/usr/local/bin/diff-anything. - Folder and API schema comparisons require Diff Anything Pro. The CLI checks the app's locally cached entitlement; open the desktop app to purchase or restore Pro. The Free CLI permits plain-text and JSON comparisons, subject to its daily and file-size limits.
check_api_compatibilityrequires a CLI whose help includes--fail-on breaking. Discovery checks the installed binary; an older app returnsupdate_requiredfor this tool.
Your MCP client starts the server with npx, which downloads the pinned version on first use; nothing else needs installing. In Claude Code:
In clients configured with JSON, the server entry is:
To run without fetching from npm at startup, install a pinned version globally and use the diff-anything-mcp command instead:
Set DIFF_ANYTHING_ROOTS in your client's server configuration to a JSON array of existing absolute directories that the server may compare. Until this is configured, only discovery works. Start with a dedicated directory containing files you intend to share with your client.
macOS discovery checks the command-line helper at /usr/local/bin/diff-anything, then /Applications/Diff Anything.app/Contents/MacOS/diff-anything, the same bundle in ~/Applications, and absolute entries on PATH. A Mac App Store copy of the app is skipped, because its own executable cannot read the files; without the helper, tools return helper_required with the helper's download page. Windows discovery checks %LOCALAPPDATA%\Microsoft\WindowsApps\diff-anything.exe and PATH. The Microsoft Store package declares that app execution alias; enable it in Windows settings if it is disabled. For a direct install or another location, set DIFF_ANYTHING_CLI to the absolute executable path. Never use a shell command or arguments in that variable.
VS Code
For a workspace configuration, create .vscode/mcp.json:
If your client cannot find the global command, use the absolute path to Node as command and the absolute path to the installed package's src/index.mjs as the single entry in args. This also avoids Windows clients that cannot directly launch npm's .cmd shim. npm root --global identifies the global package directory.
Clients using mcpServers
For a client such as Claude Code that accepts a project .mcp.json, use the same server entry under mcpServers. This Windows example launches Node directly:
Replace example paths with your actual installation and comparison directories. Restart or reload the server in your client, then call discover_capabilities first. Setup references: VS Code MCP configuration and MCP SDK host setup.
Tools
Example input:
Exit 1 is a completed comparison result, not a server failure. For file and folder comparisons it sets countedDifferences; for API checks it makes compatibilityCheckPassed false. Review the CLI report and its warnings: a failed compatibility check can mean a breaking or unclassified change. A comparison is not proof that a backup is complete or an API is compatible in every respect.
The wrapper returns the CLI report without rewriting its values or removing its masking. There are no tool arguments for raw CLI flags, disabling masking, overriding Pro, merging, batch manifests or writing report files. Errors use isError with a code such as missing_app, helper_required, pro_required, update_required, outside_roots, timeout or output_limit and the CLI's explanation where available.
Local processing and permissions
Diff Anything performs its comparisons locally and sends none of your data to an AI model. The npm wrapper has no hosted runtime, account, API key, HTTP listener or required network connection at runtime. Installing packages requires registry access; launching the installed package directly avoids an npm fetch at startup.
Your MCP client controls what happens to returned tool output. Comparison results can include filenames, paths, document content and changed values. A client may send that output to its model provider or store it. Configure that client's data handling and tool approvals before comparing sensitive files. Existing CLI masking is not a universal secret scanner.
Tools leave compared files unchanged. The CLI can update its local free-comparison usage ledger and read its cached Pro entitlement. The server inherits your process permissions and environment. Allowed roots validate resolved input paths, including symlinks. Folder inputs are scanned before comparison and reject nested symbolic links, junctions and special files, because the CLI can follow links. This validation is capped at 100,000 entries and 60 seconds per tree. These are application-level guards, not an OS sandbox or protection against another process changing files during a comparison. Use local, stable directories; network mounts or cloud placeholders may perform I/O through the operating system.
Each CLI invocation has a 60-second timeout and a combined stdout/stderr limit of 1 MiB. Output beyond the limit is discarded and the process is stopped; a partial report is never presented as complete. One tool request runs at a time; overlapping requests return busy. Client cancellation stops the active CLI child. Large comparisons should be narrowed into smaller pairs.
Development
Tests exercise the actual MCP stdio transport with a fixture CLI, argument validation, platform discovery paths, allowed roots, symlink escape rejection, Pro errors, cancellation and output limits. A real installed app is needed to verify platform packaging and entitlement behavior end to end.
來源:README.md,提交 8d1a4e8
工具
0版本歷史
1- v0.1.0最新Oct 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分