
Mac Health MCP 发布:让 Claude 用通俗语言诊断 Mac 变慢原因
来源标题:Mac Health MCP – ask Claude why your Mac is slow
Mac Health MCP 是一个基于 Model Context Protocol 的服务器,可让 Claude Desktop 等 MCP 客户端读取 Mac 的运行时长、内存、磁盘、电池等信息。用户询问“为什么我的 Mac 变慢”时,Claude 会按可能性排序给出原因,并附上通俗解释、对应数据和可操作建议。该工具本地运行、只读且零依赖。
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Asks your Mac what's wrong and tells you in plain English.
The explanation comes first, then the numbers behind it.
A Model Context Protocol server that lets Claude Desktop, Claude Code and other MCP clients check your Mac's health: uptime, memory, disk, busy processes, Spotlight, heat, battery and startup items. Ask "Why is my Mac slow?" and Claude gets a ranked list of likely causes, each with a plain explanation, the number behind it and what you can do. Local, read-only, zero dependencies.
The same kind of conversation as text (made-up example values):
You: Why is my Mac slow?
Claude: I found 3 likely causes, most likely first:
- It has been a long time since the last restart (uptime 23 days). Apps and macOS slowly pile up memory and background work over time. Restart the Mac when it suits you.
- Memory is tight (memory pressure: warning, 4.2 GB swap). macOS is moving memory out to the disk, which is much slower. The apps using the most memory are ExampleBrowser (3.1 GB) and DemoApp (1.8 GB). Closing tabs or apps you don't need will help.
- One app is keeping the processor busy (DemoApp at 145 % CPU in both measurements). Quit it if you don't need it right now.
Free disk space, Spotlight, heat, battery health and startup items look fine.
Install
Option A: Claude Desktop, one click (recommended)
Download mac-health-x.y.z.mcpb from the latest release on GitHub.
Double-click the file (or drag it into Claude Desktop, or use Settings → Extensions → Install Extension…).
Click Install, then ask Claude: "Why is my Mac slow?"
Claude Desktop runs the extension with its own built-in Node.js, so nothing else needs to be installed.
Download or clone the repository to a permanent folder. No npm install is needed (there are no dependencies). Replace /path/to/mac-health-mcp below with the real folder.
git clone https://github.com/Swedishwizards/mac-health-mcp.git
Claude Desktop: open Settings → Developer → Edit Config (the file ~/Library/Application Support/Claude/claude_desktop_config.json) and add:
{ "mcpServers": { "mac-health": { "command": "node", "args": ["/path/to/mac-health-mcp/server/index.js"] } } }
Restart Claude Desktop afterwards. If Claude Desktop cannot find node, use the full path from which node (for example /opt/homebrew/bin/node or /usr/local/bin/node) as command.
claude mcp add mac-health -- node /path/to/mac-health-mcp/server/index.js
Any other MCP client: run node /path/to/mac-health-mcp/server/index.js as a stdio server.
All tools are read-only and local. Every answer starts with a short plain-language summary, followed by the numbers as structured data. The built-in summaries and grades are in Swedish (Bra = good, Okej = OK, Behöver åtgärd = needs attention, Okänd = unknown); Claude answers you in your own language.
Answers "why is my Mac slow?" with a ranked list of likely causes, each with a plain explanation, the number behind it and what you can do.
Every command runs once and is shared between the checks. A check is only called "looks good" if it could actually be made; checks that could not run are listed as unknown. Causes are likely, not certain, and nothing is ever changed.
A health check of the whole Mac, each part graded, with advice when something is off:
If a command is missing, fails or times out, that part is reported as Okänd (unknown) instead of the whole tool failing.
Local only. Everything runs on your Mac with built-in macOS tools (sysctl, sw_vers, vm_stat, memory_pressure, df, du, top, ps, pmset, ioreg). No network requests.
No telemetry. Nothing is collected, stored or sent anywhere; the only output is the answer to your MCP client.
Read-only. Never deletes, closes or changes anything. No admin password. startup_items only lists folder contents and disk_report only reads sizes.
Identifiers are filtered out. Only whitelisted values are parsed, and a final filter on every answer removes serial numbers, UUIDs, hardware IDs, MAC addresses, your user name, your computer name and home folder paths (shown as ~) before anything is sent to Claude.
Safe commands. Commands run without a shell, with absolute paths, a fixed locale and a timeout.
Requirements
macOS. The tools rely on built-in macOS commands; on other systems every tool answers that it only works on macOS.
Node.js 18 or newer. With the .mcpb install (option A) Claude Desktop provides Node.js itself; for manual configuration (option B) Node.js 18+ must be installed.
No npm install, no dependencies.
Development
npm test # runs on any OS (macOS and Linux in CI) with made-up command output from test/fixtures npm run pack # builds dist/mac-health-<version>.mcpb with the official packer (downloads it the first time) npm start # runs the MCP server over stdio
Quick manual check without a client:
printf '%s\n'
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}'
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
| node server/index.js
Project layout:
server/index.js MCP server (JSON-RPC over stdio), tool definitions, privacy filter on every answer server/lib/collect.js runs the read-only macOS commands (no shell, timeouts) server/lib/parse.js parses command output (whitelisted fields only) server/lib/overview.js get_mac_overview: sections and grades server/lib/diagnose.js diagnose_slowness: the eight checks server/lib/reports.js the other tools server/lib/explain.js plain-language names for macOS processes server/lib/privacy.js removes identifiers before anything leaves test/ tests with saved, made-up command output (fixtures) and a fake backend
CI runs the tests on macOS (main runner) and Ubuntu with Node 18 and 22, plus a stdio smoke test, and builds the .mcpb as a downloadable artifact. Nothing is published from CI.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。