1 — Turn on the LAN server
- Open HealthKite MCP Switch to the Settings tab.
- Toggle Local LAN Server on iOS will ask for Local Network permission the first time. Allow it.
-
Copy the Pairing Secret
The Settings screen shows a Pairing Secret. Tap it to copy.
That one secret is used locally to derive both:
- the Bonjour/mDNS discovery name, and
- the TLS-PSK authentication key.
The LAN server only runs while the HealthKite MCP app is foregrounded on the iPhone. iOS suspends background apps, so the server stops the moment you switch apps or lock the phone. This is a platform constraint, not a bug.
2 — Install the MCP server
The MCP server is a Rust stdio program. It discovers the iPhone over Bonjour and connects over TLS-PSK; there is no URL to paste and no bearer token sent over the network.openssl-sys, install OpenSSL development libraries first (libssl-dev and pkg-config on Debian/Ubuntu; Homebrew openssl@3 on macOS if needed).
3 — Configure your agent
- Claude Code
- Codex
- Cursor
status, list_workouts, get_workout, list_quantity_types, get_quantity_series, list_sleep_sessions, and get_day_snapshot should appear in its tool list.
If the tools return an unreachable/discovery error, keep HealthKite MCP open in the foreground and confirm the iPhone and agent machine are on the same Wi-Fi network without guest/client isolation.
4 — Ask your first question
In Claude Code (or any agent), try:Summarize my last 3 workouts and tell me whether my pace at threshold heart rate has improved.The agent calls
list_workouts(limit: 3), follows up with get_workout(uuid) for each, computes pace-per-km at avg HR ~165, and tells you. No spreadsheet, no copy-paste.
Or:
Give me a single-day summary of yesterday. Just the highlights.The agent calls
get_day_snapshot(date: "2026-05-10") and replies with sleep / activity / heart / mobility / workouts.
What’s next
- Wire format — why the JSON looks the way it does
- API reference — every endpoint, every parameter
- MCP integration — tools, error codes, environment variables