mac-diagnostics
macOS diagnostic shell scripts — sleep/wake, crashes, battery, disk, network, security, backups, storage, Wi-Fi — plus an MCP server that exposes them to AI agents (Claude Desktop, Claude Code, Cursor, VS Code).
Quickstart
uvx mac-diagnostics-mcp # runs the MCP server on stdio, zero install
Point your client at it — Claude Desktop
(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"mac-diagnostics": {
"command": "uvx",
"args": ["mac-diagnostics-mcp"]
}
}
}
- Claude Code:
claude mcp add mac-diagnostics -- uvx mac-diagnostics-mcp - Cursor: same
mcpServersJSON in~/.cursor/mcp.json - VS Code: same JSON in
~/Library/Application Support/Code/User/mcp.json
Then ask your agent: "Run a quick health check on my Mac."
Scripts
All scripts live in mac_diagnostics_mcp/scripts/ and run standalone —
no Python required:
mac-quick-health.sh— fast overview: CPU, memory, disk, network, sleep blockers, battery, crashes, startup items, thermal state.mac-sleep-investigate.sh— sleep blockers, wake reasons, dark wakes, always-awake processes.mac-cpu-memory.sh— CPU usage, memory pressure, swap, thermal throttling.mac-disk-health.sh— free space, SMART status, large home directories, Time Machine state.mac-network.sh— interfaces, routes, DNS, connectivity, listening ports, HTTP latency.mac-crashes.sh— crash/hang trends: repeat offenders, panics, OOM kills, hang reports (.ips/.diag and legacy .crash).mac-battery.sh— battery health, cycle count, charging state and history.mac-startup-items.sh— launch agents/daemons, login items, startup services.mac-security.sh— FileVault, SIP, Gatekeeper, XProtect, firewall, sharing services, account hygiene, persistence spot-check.mac-backup.sh— Time Machine destination, last-backup age, snapshot usage.mac-storage.sh— what fills the disk: purgeable space, heavyweight directories (Xcode, simulators, Docker, caches, iOS backups).mac-wifi.sh— Wi-Fi RSSI, noise, SNR, channel, transmit rate.mac-software-update.sh— pending macOS updates, auto-update settings, XProtect age.
Developer environment:
mac-mcp-servers.sh— audit MCP server configs across AI clients (types, path health; env values redacted).mac-node-packages.sh— Node.js/Bun installations, global packages, available updates.mac-node-update.sh— apply npm/Bun updates (--include-mcp-venvsfor Python MCP venvs).
Machine-readable findings
Every report ends with one-line findings an agent can parse deterministically:
FINDING:WARN:disk: boot volume / is 92% full
FINDING:CRIT:network: no outbound connectivity (ping 1.1.1.1 failed) [suggest: investigate_network]
Severity is INFO / WARN / CRIT. An optional [suggest: tool(args)]
escalation hint names the recommended follow-up tool.
Conditional-depth checks
Expensive log show checks run only when a cheap trigger fires (active
sleep blocker, crash reports on disk, memory pressure) or --deep is
passed. Skips are listed as SKIPPED: ... lines — a clean machine's
crash report takes well under a second.
Tools
The server exposes 18 tools. Each returns status
(ok/info/warn/crit), a machine-readable findings list, and the
full prose report. Check findings first; read the report for detail.
Every read-only tool accepts compare_last: true — diffs findings
against the previous run and adds a delta key
(new/resolved/changed/status_change). Run history lives in
~/.local/state/mac-diagnostics/; see
docs/baselines-design.md.
| Tool | Description | Mutates? |
|---|---|---|
triage |
Map a symptom in plain language to an ordered tool plan | no |
quick_health_check |
Fast 30-second overview | no |
investigate_sleep |
Sleep blockers, wake reasons | no |
investigate_cpu_memory |
CPU usage, memory pressure | no |
investigate_disk |
SMART status, free space | no |
investigate_network |
Connectivity, DNS, routing, DNS-tamper checks | no |
check_network_addons |
Third-party tools (Little Snitch, KnockKnock, …): presence, state, conflicts | no |
investigate_crashes |
App crash/hang trends, panics, OOM kills | no |
investigate_battery |
Battery health, cycle count | no |
investigate_startup_items |
Launch agents and daemons, with code-signing assessment | no |
security_audit |
FileVault, SIP, firewall, sharing, persistence spot-check | no |
backup_audit |
Time Machine destination, last-backup age, snapshots | no |
storage_breakdown |
What is consuming the boot volume | no |
wifi_quality |
Wi-Fi RSSI, noise, SNR, channel, Tx rate | no |
check_software_updates |
Pending macOS updates, auto-update settings, XProtect age | no |
list_mcp_servers |
Audit MCP configs across AI clients | no |
inspect_node_packages |
Node/Bun ecosystem audit and update report | no |
update_node_packages |
Apply npm/bun updates (dry-run by default) | only with apply=true |
All read-only tools carry readOnlyHint annotations so clients can
auto-approve them safely.
Mutation guard
update_node_packages(apply=true) modifies the system (brew upgrade,
npm update -g, pip install --upgrade) and is refused unless the
server was started with MAC_DIAG_ALLOW_MUTATIONS=1:
{
"mcpServers": {
"mac-diagnostics": {
"command": "uvx",
"args": ["mac-diagnostics-mcp"],
"env": { "MAC_DIAG_ALLOW_MUTATIONS": "1" }
}
}
}
Without it the tool returns a structured refusal — a prompt-injected or over-eager agent cannot run upgrades.
Workflow prompts
Guided multi-tool workflows shipped with the server: diagnose_slow_mac,
investigate_sleep_issues, weekly_maintenance, security_review, and
pre_travel_check.
Example prompts
System overview
- "Run a quick health check on my Mac."
Symptoms → plan
- "My battery drains overnight — what should we check?" (uses
triage)
Change since last time
- "Run the health check and tell me what changed since last week." (uses
compare_last)
Sleep & wake
- "Investigate why my Mac isn't sleeping."
- "Check for sleep issues from the last 48 hours." (uses
sinceparam)
CPU & memory
- "Diagnose high CPU and memory pressure."
- "Check CPU and memory from the last 2 hours." (uses
sinceparam)
Disk & storage
- "Check my disk health and free space."
- "Show verbose disk info including all partitions." (uses
verboseparam) - "My disk is full — what is taking up the space?"
Network & Wi-Fi
- "Test my network connectivity and DNS."
- "Is my Wi-Fi signal any good?"
Crashes
- "Show recent app crashes and panics."
- "List crashes from the last 48 hours." (uses
sinceparam)
Battery (MacBook only)
- "Check my battery health and cycle count."
Startup items
- "List everything that launches at startup."
Security
- "Run a security audit of this Mac."
- "Are any of my startup items unsigned?"
Backups
- "When did my last Time Machine backup finish?"
Software updates
- "Are my macOS updates up to date?"
MCP server audit
- "Audit my MCP server configuration across all AI clients."
Node / Bun packages
- "Audit my Node.js and Bun global packages."
- "Check for npm and Bun package updates (dry-run)."
- "Apply npm and Bun updates, including Python MCP venvs." (uses
apply+include_mcp_venvsparams; requires the mutation guard)
Usage (standalone scripts)
./mac_diagnostics_mcp/scripts/mac-sleep-investigate.sh --since 24h
./mac_diagnostics_mcp/scripts/mac-quick-health.sh
./mac_diagnostics_mcp/scripts/mac-startup-items.sh
./mac_diagnostics_mcp/scripts/mac-crashes.sh --since 48h
./mac_diagnostics_mcp/scripts/mac-battery.sh
./mac_diagnostics_mcp/scripts/mac-cpu-memory.sh --since 2h
./mac_diagnostics_mcp/scripts/mac-disk-health.sh
./mac_diagnostics_mcp/scripts/mac-network.sh
./mac_diagnostics_mcp/scripts/mac-security.sh
./mac_diagnostics_mcp/scripts/mac-backup.sh
./mac_diagnostics_mcp/scripts/mac-storage.sh
./mac_diagnostics_mcp/scripts/mac-wifi.sh
./mac_diagnostics_mcp/scripts/mac-software-update.sh
# Developer environment tools
./mac_diagnostics_mcp/scripts/mac-mcp-servers.sh --stdout
./mac_diagnostics_mcp/scripts/mac-node-packages.sh --stdout
./mac_diagnostics_mcp/scripts/mac-node-update.sh --stdout # dry-run
./mac_diagnostics_mcp/scripts/mac-node-update.sh --stdout --apply # apply updates
./mac_diagnostics_mcp/scripts/mac-node-update.sh --stdout --apply --include-mcp-venvs
By default each script writes a timestamped report folder on your
Desktop; with --stdout (the mode the MCP server uses) it goes to a temp
dir instead. Use --out PATH to choose explicitly.
Development
python -m pip install -e .
mac-diagnostics-mcp # runs the server from the checkout
For development, point your client at the venv console script:
"/path/to/mac-diagnostics/.venv/bin/mac-diagnostics-mcp".
Checks:
bash -n mac_diagnostics_mcp/scripts/*.sh
shellcheck --shell=bash mac_diagnostics_mcp/scripts/*.sh
ruff check mac_diagnostics_mcp/ tests/
pytest
Releases are tagged (vX.Y.Z) and published via GitHub release — the
publish.yml workflow uploads to PyPI automatically (OIDC trusted
publishing, no tokens).
Requirements
- macOS and Bash
- GNU
timeoutinPATH(e.g. Homebrewcoreutils) - Standard macOS tools:
pmset,log,launchctl,system_profiler,ioreg,osascript - Python ≥ 3.11 and
fastmcp— MCP server only
Some commands return partial output depending on macOS privacy settings.
Privacy note
Reports can include hostnames, usernames, process names, installed services, and log excerpts. Review report output before sharing it outside your machine.
License
MIT
Metadata
Release files for mac-diagnostics-mcp 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mac_diagnostics_mcp-0.6.1.tar.gz | 67.5 kB | With provenance | Details for mac_diagnostics_mcp-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mac_diagnostics_mcp-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for mac_diagnostics_mcp-0.6.1-py3-none-any.whl |
Total release size: 154.5 kB
Release files / mac_diagnostics_mcp-0.6.1.tar.gz
| Download URL | mac_diagnostics_mcp-0.6.1.tar.gz |
|---|---|
| Size | 67.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfc8a8c4ddc8ebb5396c53262b6343deae51e816e41092870e9c0dcec8ebd967
|
|
BLAKE2b-256 checksum How to use checksums |
86a292694b08d1fe54ae0ede1303d2c790993fab09e9bc827f8dc2f6d94ff592
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / mac_diagnostics_mcp-0.6.1-py3-none-any.whl
| Download URL | mac_diagnostics_mcp-0.6.1-py3-none-any.whl |
|---|---|
| Size | 87.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3eb8237b132fff631824689dfd60160d4d0ed2ddeaa86e7fcf56685ddcb42252
|
|
BLAKE2b-256 checksum How to use checksums |
e321e674df7f4a37bdef420fb09570c88a9e932c1ad1e9bc18209e3f6b8da5a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for mac-diagnostics-mcp 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mac_diagnostics_mcp-0.6.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.