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
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选