Apple Health AI Bridge MCP Server

Apple Health AI Bridge MCP Server

Read-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.

Category
Visit Server

README

<div align="center">

<img src="assets/brand/health-bridge-lockup.png" alt="Health Bridge logo" width="720">

Apple Health AI Bridge

Local-first Apple Health context for AI agents.

License: Apache-2.0 Python 3.11+ MCP

Website · Quickstart · MCP · iPhone path · HealthKit read types · Scope · Security · Support · Privacy · Docs

</div>

Apple Health AI Bridge turns HealthKit data into local, source-grounded context an agent can read without sending your health history to a hosted service.

The stack is intentionally boring: a read-only iOS companion, a receiver you run, SQLite on your machine, a CLI, and a read-only MCP server. Start with synthetic data in a minute; use the iPhone path only when you are ready to pair a private receiver.

Apple Health AI Bridge is the open-source project and repository. Health Bridge is the iPhone companion name, and Health Bridge for AI is the public website name.

flowchart LR
  HealthKit[iPhone HealthKit] -->|read permission| App[iOS companion]
  App -->|authorized batches| Receiver[local receiver]
  Receiver --> DB[(SQLite)]
  DB --> CLI[CLI / JSON / Markdown]
  DB --> MCP[read-only MCP]
  MCP --> Agent[local agent]

Why this exists

AI assistants are useful when they can see current context and cite where it came from. Apple Health already has that context, but raw exports, screenshots, and copy-pasted summaries are a bad interface for agents.

This project provides a local bridge instead:

  • sync Apple Health data the user allows into a local SQLite store;
  • keep provenance, units, time ranges, sync runs, and data families attached;
  • expose fixed query and MCP tools instead of raw database access;
  • use synthetic fixtures for public examples and tests;
  • keep receiver credentials and real health values out of the repository.

Prerequisites

For the synthetic quickstart and MCP path:

  • Git;
  • Python 3.11+;
  • uv.

Real Apple Health sync additionally requires an iPhone running iOS 18 or later, a Mac with Xcode 16 or later, local signing access, and a receiver URL the phone can reach.

Quickstart

The quickstart uses synthetic fixture data. No iPhone, Apple account, receiver token, or HealthKit permission is needed.

git clone https://github.com/roian6/apple-health-ai-bridge.git
cd apple-health-ai-bridge
uv sync --all-extras --dev

uv run health-bridge init --db .tmp/quickstart.sqlite
uv run health-bridge ingest-fixture \
  --db .tmp/quickstart.sqlite \
  --input fixtures/health_bridge_batch_v1.synthetic.json

uv run health-bridge status --db .tmp/quickstart.sqlite --markdown
uv run health-bridge mcp smoke --db .tmp/quickstart.sqlite

Expected result: the database initializes, the synthetic batch ingests, Markdown status renders aggregate counts, and MCP smoke returns a compact read-only summary with forbidden_hits: [].

Query

uv run health-bridge query daily-summary \
  --db .tmp/quickstart.sqlite \
  --start-date 2026-06-01 \
  --end-date 2026-06-08

uv run health-bridge query supported-timeseries-types --category body
uv run health-bridge status --db .tmp/quickstart.sqlite --json

supported-timeseries-types describes the bridge's public type catalog and aggregation semantics. It does not mean every listed HealthKit family is live-synced by the iOS companion today; see Scope.

MCP

Start the local MCP server against a private database:

uv run health-bridge mcp start --db .tmp/quickstart.sqlite

Typical client config:

{
  "command": "uv",
  "args": ["run", "health-bridge", "mcp", "start", "--db", ".tmp/quickstart.sqlite"],
  "cwd": "/absolute/path/to/apple-health-ai-bridge"
}

If your MCP client cannot set cwd, use uv --directory:

{
  "command": "uv",
  "args": ["--directory", "/absolute/path/to/apple-health-ai-bridge", "run", "health-bridge", "mcp", "start", "--db", ".tmp/quickstart.sqlite"]
}

The MCP surface is read-only. It exposes status, context Markdown, metric coverage, supported type metadata, daily summaries, timeseries, workouts, sleep, and source queries.

iPhone path

Real Apple Health sync is a developer-preview path today. It needs an iPhone running iOS 18 or later, a Mac with Xcode 16 or later and a signing environment, and a receiver URL the phone can reach. Follow docs/ios-self-build.md for the full self-build flow and docs/pairing.md for the QR-first pairing/fallback matrix.

prove the synthetic path
→ start a private receiver and verify its phone-facing /health URL
→ generate private pairing/setup material
→ install the iOS companion
→ pair the receiver
→ allow selected read-only Health permissions
→ run Sync Now
→ verify redacted CLI/MCP output locally

For a same-machine receiver smoke test, keep the receiver running in one terminal:

uv run health-bridge init --db .tmp/device.sqlite
uv run health-bridge receiver start --db .tmp/device.sqlite --host 127.0.0.1 --port 8765

For a physical iPhone, do not use 127.0.0.1 in setup material. Use a private LAN or private-network URL the phone can reach, verify /health, then generate setup material:

PHONE_REACHABLE_BASE_URL="http://<phone-reachable-private-host>:8765"
curl -fsS "$PHONE_REACHABLE_BASE_URL/health"

PHONE_REACHABLE_BATCH_URL="$PHONE_REACHABLE_BASE_URL/v1/batches"
uv run health-bridge dev device-session \
  --db .tmp/device.sqlite \
  --label ios-companion \
  --receiver-url "$PHONE_REACHABLE_BATCH_URL" \
  --setup-page .tmp/ios-companion-device-session.html

Generated setup pages, pairing links, tokens, receiver databases, and real-device logs are private. Do not commit them. Expert receiver commands that print tokens or pairing links require explicit secret-output flags; prefer dev device-session for onboarding.

No official public TestFlight invitation path has been published. Treat distribution as private/pending; the public developer-preview path is currently the documented self-build flow.

Scope

Implemented in the developer preview:

Area Status
Local store SQLite migrations, synthetic fixture ingest, receiver batch ingest
iOS companion Pairing, Keychain token storage, local outbox retry, disconnect, privacy copy
Live Apple Health sync Steps, workouts, sleep, and every runtime-available quantity type implemented by the companion and allowed through Apple Health, all in one foreground/automatic coverage plan
Background work Observer registration requested across runtime-supported types, with per-type results, trigger-prioritized reconciliation, and iOS-controlled timing
Agent surfaces CLI, JSON, Markdown, and read-only MCP
Metadata Supported type catalog with aggregation semantics and iOS support labels

How to read the catalog:

Category Meaning
Live today Implemented receiver/CLI/MCP path and shared foreground/automatic iOS sync for the families listed above
Metadata supported Type codes, units, sensitivity, aggregation semantics, and query labels that may be used by fixtures, stored data, or future iOS readers
Future work HealthKit families that need separate readers, permissions, normalization, review copy, and real-device proof before being claimed

Not claimed yet:

  • public App Store availability;
  • TestFlight availability unless an official beta link or invitation path has been intentionally published;
  • hosted sync, hosted relay, or remote MCP;
  • full Apple Health coverage for every HealthKit family;
  • guaranteed background freshness;
  • medical decisions, scoring, or emergency use.

High-risk or structurally different families such as clinical records, ECG/waveforms, medications, symptoms, reproductive health, workout routes/location, nutrition, and generic category/profile/correlation data are future work.

Security model

  • HealthKit access is read-only by default.
  • The default data path is user-owned: iPhone → companion → your receiver → your SQLite database.
  • Public examples use synthetic fixtures.
  • Keep real health values, receiver DBs, pairing material, setup pages, bearer tokens, token hashes, cursor values, screenshots with health values, and local outbox payloads out of issues, PRs, docs, logs, and chat.
  • The project does not add telemetry, analytics, hidden uploads, advertising hooks, data brokers, or third-party AI calls without an explicit project decision and privacy review.

See SECURITY.md and CONTRIBUTING.md.

Development

uv sync --all-extras --dev
uv run health-bridge --version
uv run ruff format --check .
uv run ruff check .
uv run basedpyright
uv run pytest

For iOS work, use the Xcode project under ios/HealthBridgeCompanion. A simulator build proves compile/config only; real HealthKit data and background execution require physical-device validation.

Docs

Try and integrate

Contributor references

Trademark notice

Apple, Apple Health, HealthKit, iPhone, and Xcode are trademarks of Apple Inc. This independent open-source project is not affiliated with, endorsed by, or sponsored by Apple Inc.

License

Apache License 2.0. See LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured