apple-health-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
apple-health-mcp
Sync Apple Health from your iPhone to a small server of your own, and let any AI agent that speaks MCP read it. Ask it about your health data, track goals, and get daily and weekly summaries.
iPhone server (e.g. on Vercel) AI agent
┌──────────────┐ sends ┌──────────────────────────┐ asks ┌─────────────┐
│ iOS app │ ───────▶ │ Database + MCP server │ ◀──── │ Questions, │
│ (reads │ health │ (stores (answers │ tools │ summaries, │
│ HealthKit) │ data │ history) questions) │ │ goals │
└──────────────┘ └──────────────────────────┘ └─────────────┘
ios/ folder src/ folder Grok Bot, Claude Code, ...Apple Health data lives only on your iPhone, so an app on the phone has to send it out.
This service is the mailbox it sends to. It stores the history and lets your agent look things up.
It was built for Grok Bot, but works with any MCP client that can send an
Authorization: Bearer header.
How it works
Piece | What it does | File |
Ingest endpoint | The iPhone app uploads data here. Needs |
|
MCP endpoint | Your agent calls tools here. Needs |
|
Database | Daily numbers, workouts, goals. Postgres (Neon) |
|
Goals | Daily / weekly / monthly targets, and deadline targets like a goal weight |
|
Summaries | Totals, averages, comparisons, trends |
|
MCP (Model Context Protocol) is a standard plug shape for giving an AI new abilities. You give your agent this service's address and key, and it gains these tools:
Tool | Use it for |
| Today's date, units, how fresh the data is, list of goals |
| "How did I do yesterday?" Every metric, workouts, daily goals |
| Weekly/monthly reviews, compared with the previous period |
| "Is my resting heart rate going down?" Daily series + 7-day average |
| Runs (with pace), lifting sessions, etc. |
| On track / behind / met, hit rate, streaks, weight-goal projection |
| "Set a goal to run 3 times a week" |
| Bedtime, wake, time in bed, awake gaps, night-time pickups, time zone and city, night by night |
| "I actually went to bed at 11:30 last night" (the phone then fixes Apple Health) |
Metrics
Steps, walking + running distance, active calories, exercise minutes, calories eaten, protein, carbs, fat, sleep (total, deep, REM, core, awake; needs a wearable), time in bed (from the phone's dock and alarm), resting heart rate, HRV, VO2 max, weight, body fat %.
Calories eaten only appear in Apple Health if you log food in an app that writes to Health (MyFitnessPal, Lose It!, Cronometer, ...).
Weightlifting: Apple Health records the workout's time, calories and heart rate, but not sets/reps/weights.
Related MCP server: health-mcp
Sleep without a watch
The iPhone app logs each night from the phone's charger dock and alarm, through three Shortcuts actions
(Log Bedtime, Log Off Charger, Log Wake) that run while the phone is locked. Each night goes to Apple Health
as In Bed blocks (Awake blocks for time up in the night) and to the server with its raw events and city.
Nights are filed under the evening they started: Friday night to Saturday morning is Friday.
Setup is in the app under 4. Sleep. The rules are in ios/HealthBridge/Sleep/SleepEngine.swift.
Piece | File |
Upload |
|
Nights table |
|
Try it on your computer
You need Node.js 20 or newer.
npm installnpm run devThis starts the service at http://localhost:8787 with a throwaway database full of fake data
(90 days of someone who runs and lifts 3x a week). Nothing is saved when you stop it (Ctrl+C).
Use FAKE_DATA=0 npm run dev to start empty, e.g. to test the iPhone app with your real data.
Run the automatic checks:
npm testSettings (environment variables)
See .env.example. On Vercel, these go in Project → Settings → Environment Variables.
Name | Meaning |
| Postgres connection string (Neon) |
| Secret key the iPhone app uses (make one with |
| A different secret key your agent uses |
| e.g. |
|
|
Upload format (for the iPhone app)
{
"daily": [
{ "date": "2026-11-22", "metric": "steps", "value": 8123 },
{ "date": "2026-11-22", "metric": "weight", "value": 84.2 }
],
"workouts": [
{ "id": "HealthKit-UUID", "activity_type": "running",
"start": "2026-11-22T13:05:00Z", "end": "2026-11-22T13:41:00Z",
"duration_s": 2160, "distance_m": 5000, "energy_kcal": 380,
"avg_heart_rate": 151, "max_heart_rate": 171, "source": "Apple Watch" }
],
"deleted_workout_ids": []
}dateis the day in the phone's time zone. Re-sending a day overwrites it, so the phone can safely re-send recent days.Values are in storage units: kg, km, kcal, g, minutes (sleep), bpm, ms, %, mL/kg/min.
activity_typeis the HealthKit workout type in snake_case (running,traditional_strength_training, ...).
Privacy
This holds sensitive health data. Both endpoints require a secret key. Without a key configured, the endpoint
refuses all requests. Keep the keys out of git (.env is ignored), and use different keys for the
phone and for your agent. Run your own copy: don't send your health data to a server someone else controls.
Put it online
Import this repo into Vercel. It detects Hono and runs
src/index.tswith no extra setup.Add a Postgres database from the Vercel Marketplace (Neon). That sets
DATABASE_URL; tables are created on first use.Set
INGEST_TOKEN,MCP_TOKEN,USER_TIMEZONEandUNITS(see above), then redeploy.Build the iPhone app and point it at
https://<your-app>.vercel.appwithINGEST_TOKEN: seeios/README.md.
Connect your agent
The MCP address is https://<your-app>.vercel.app/api/mcp, with the header Authorization: Bearer <MCP_TOKEN>.
Grok Bot: ask it in chat to add a remote MCP connector with that address. It collects the key in a secure field.
Claude Code:
claude mcp add --transport http apple-health https://<your-app>.vercel.app/api/mcp --header "Authorization: Bearer <MCP_TOKEN>"Anything else: try it first with the MCP Inspector (
npx @modelcontextprotocol/inspector, transport "Streamable HTTP").
Some clients save the tool list when you add the connector and don't fetch it again. If your agent doesn't see a
new tool after an update, remove the connector and add it at a new address (e.g. .../api/mcp?v=2; the server
ignores the query string). get_overview always lists the tools the server has now.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Encrypted Apple Health for MCP clients. Your key never leaves your iPhone.
Encrypted Apple Health for MCP clients. Your key never leaves your iPhone.
Hosted Apple Health MCP for Claude and ChatGPT, works outside the US. iPhone app, no local server.
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Related MCP Servers
- AlicenseAqualityAmaintenanceRead-only MCP server that exposes Apple Health data (steps, workouts, sleep, etc.) from a local SQLite store, allowing AI agents to query health metrics without sending data to hosted services.937Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables Claude to access Apple Health data (sleep, heart rate, steps, etc.) via a self-hosted MCP server, bypassing regional restrictions.MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that securely syncs and queries your health data from Apple Health, storing it in your own Supabase Postgres database and exposing tools for AI assistants to retrieve weight, calories, macros, and more.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceRead-only MCP server for Apple Health data, exposing tools to query current health stats, sleep/health details, and trends over 7, 14, or 30 days.MIT