Insights

Apple Health MCP Server: 6 Developer Use Cases With Query Examples

A diagram showing custom logo of Apple Health MCP Server
Author
Bartosz Michalak
Published
November 5, 2025
Last update
March 10, 2026
A diagram showing custom logo of Apple Health MCP Server

Table of Contents

EXCLUSIVE LAUNCH
AI Implementation in Healthcare Masterclass
Start the course

Key Takeaways

  1. Apple Health's XML format changes across iOS versions; the MCP server normalizes it into DuckDB with consistent schemas, eliminating per-version parsing fixes from your application codebase.
  2. Five MCP tool types cover every query pattern: health summaries, record search, per-type statistics, trend analysis by time interval, and exact-value matching.
  3. v0.1.0 requires one manual Apple Health export per user and has no continuous sync; design your onboarding flow around this data-import step before writing a single query.
  4. DuckDB is zero-config and the default backend; switch to Elasticsearch or ClickHouse via environment variables if your stack already runs them or you need full-text search at scale.
  5. All six use cases - fitness coaching to clinical decision support - run on the same MCP toolset and differ only in which record types and time ranges developers query.

Is Your HealthTech Product Built for Success in Digital Health?

Download the Playbook
Update: Looking for wearable data integration beyond just Apple Health?
Open Wearables extends all of these use cases to Garmin, Polar, Suunto, Whoop, and Samsung Health Connect through a single unified API with a built-in MCP server for AI assistants.

Apple Health stores years of health data. Workouts, sleep analysis, heart rate, HRV, step count, and more. Accessing it programmatically means parsing a large XML file whose structure changes between iOS versions, requiring custom code for every record type your application needs. The Apple Health MCP Server handles that by indexing the export into DuckDB and exposing the data through MCP tools that any AI client can call with natural language. One tradeoff to design around: each user must manually export from the iOS Health app and provide the file to your application. There is no automatic sync in v0.1.0.

What is Apple Health MCP Server

For the full architecture breakdown, see How the Apple Health MCP Server Works → Apple Health MCP Server: Architecture, Technical Setup & How It Works. This guide focuses on use cases and implementation.

The Apple Health MCP Server is an open-source tool that implements the Model Context Protocol, providing a clean interface for accessing Apple Health data. It takes Apple Health XML exports, indexes them in DuckDB for fast querying, and exposes the data through tools that AI agents can use naturally. The server also supports Elasticsearch integration for advanced search capabilities.

The server handles XML structure analysis, health record search, data extraction by type, and trend generation. Instead of building custom XML parsers, developers get structured access to health data through simple API calls that work with AI applications like Claude Desktop.

Why It Matters

Rather than maintaining custom XML parsers, developers can query user health data through structured AI-accessible tools.

Building on Apple Health data typically means writing a parser that handles the full XML schema, hundreds of record types, device metadata, and nested elements before you can run a single query. That parser needs maintenance every time Apple updates the export format.

The MCP server eliminates this friction. Developers can query health data using natural language rather than writing complex parsing logic. This means more time building features that help users and less time wrestling with data infrastructure.

Apple Health MCP Server: 6 Developer Use Cases With Query Examples

Before wego further, here's a table mapping common Apple Health record types to use cases, so developers can immediately identify which types they'll need to query:

Record Type Apple Health Identifier Primary Use Cases
Running workout HKWorkoutActivityTypeRunning Fitness coaching
Sleep analysis HKCategoryTypeIdentifierSleepAnalysis Wellness, AI coaching, Clinical
Resting heart rate HKQuantityTypeIdentifierRestingHeartRate Wellness, AI coaching, Clinical
HRV HKQuantityTypeIdentifierHeartRateVariabilitySDNN Research, Clinical, AI coaching
Step count HKQuantityTypeIdentifierStepCount Wellness, Corporate, Research
Blood oxygen HKQuantityTypeIdentifierOxygenSaturation Clinical, Research

1. Fitness and Training Applications

Fitness apps can use complete Apple Health histories to create personalized workout recommendations. A running coach app can query average weekly mileage over months and analyze rest day patterns between long runs. This historical context enables realistic training progressions based on actual performance rather than user estimates.

Sleep coaching applications benefit similarly by analyzing sleep patterns alongside other lifestyle factors. They can correlate sleep quality with workout intensity, daily activity levels, and timing patterns to provide targeted improvement recommendations.

Example query a fitness coaching app can send through the MCP server:

Analyze running workouts from the past 12 weeks. Calculate average weekly mileage, identify the 3 highest-load weeks by total distance, and flag any week where a long run over 10 miles was followed by another run within 36 hours.

MCP tool called: get_trend_data_duckdb - returns temporal patterns aggregated by interval (daily / weekly / monthly), scoped to the specified workout type.

2. Wellness and Habit Tracking

Wellness applications can surface correlations between health metrics that users would never find manually. A developer can build a feature that cross-references step count with HRV, or sleep efficiency with resting heart rate, across months of data - without writing a single aggregation query.

Example query:

For the past 90 days, correlate daily step count with heart rate variability. Return the 7 lowest-HRV days and show the step count 24 and 48 hours before each.

The server's trend analysis tools identify patterns that would be difficult to spot manually, enabling apps to surface meaningful insights without building custom analytics infrastructure.

MCP tool called: search_health_records_duckdb combined with get_statistics_by_type_duckdb - queries multiple record types and returns statistical output in a single response.

3. Corporate Wellness Platforms

Enterprise wellness solutions can analyze employee health trends while maintaining privacy. Companies building B2B wellness platforms can query aggregate activity levels across teams, helping design better wellness initiatives based on actual usage patterns rather than assumptions.

These platforms often serve clients willing to pay premium prices for personalized medicine approaches, where detailed health analysis justifies higher service costs.

Example query a corporate wellness platform can run after aggregating multiple employee exports:

Compare average weekly step count across Q4 2024 and Q1 2025. Identify the 5 record types with the largest activity change between periods.

MCP tool called: get_statistics_by_type_duckdb - computes aggregated statistics (count, min, max, average, sum) per health record type across a defined time range.

4. Research and Analytics Tools

Researchers studying personal health patterns can access structured data from Apple Health exports without building custom parsers for each study. A research platform can quickly extract heart rate data during workout sessions across hundreds of participants, standardizing the analysis process.

Developers building personal analytics tools can expose complex health queries to users with no SQL background. Natural language queries route through the MCP tools automatically, so users get structured results without the developer needing to write database queries for every possible combination of record types and date ranges.

Example query:

Extract all resting heart rate measurements from the past 6 months. Group by week. Calculate mean, min, and max per week. Flag any week where the 7-day rolling average exceeded 75 bpm.

MCP tool called: get_statistics_by_type_duckdb + get_trend_data_duckdb - combines per-type statistical analysis with temporal trend detection.

5. AI Health Assistants and Chatbots

Developers building AI health assistants can use the MCP server to create context-aware coaching experiences. An AI assistant built on the MCP server can detect when resting heart rate has been elevated for several consecutive days while sleep efficiency drops, then surface recovery suggestions based on patterns from the user's own historical data — not generic advice.

These applications become particularly skilled when they obtain reference to years of user data to provide personalized recommendations rather than generic health advice.

Example query:

Resting heart rate has exceeded 65 bpm for the last 4 days and sleep efficiency has been below 80%. Look back through all historical data and find 3 similar periods. What did the user do in the following week that correlated with the fastest return to baseline?

MCP tool called: search_health_records_duckdb + get_trend_data_duckdb - cross-references multiple health metrics and identifies matching historical patterns.

6. Clinical Decision Support Tools

Healthcare applications can use Apple Health data to provide additional context during patient consultations. While not replacing clinical monitoring, the lifestyle data helps clinicians understand patient behavior patterns between visits.

A telehealth platform can pull a patient's activity and sleep patterns for any period leading up to reported symptoms, giving clinicians structured data during the consultation rather than relying on self-reported estimates.

Example query:

Patient reported fatigue onset approximately 2 weeks ago. Pull sleep duration, sleep efficiency, daily step count, and resting heart rate for the 30 days prior to 2025-11-01. Format as a weekly summary table.

MCP tool called: search_health_records_duckdb - retrieves multiple health record types filtered by date range, returns structured output.

{{lead-magnet}}

Getting Started

How to set up in 3 steps:

  1. Export Apple Health data: On iPhone, open the Health app → tap your profile photo → Export All Health Data → share the .zip file to your development machine.
  2. Start the server: Clone the repo and run docker compose up -d. DuckDB is the default backend with zero additional config.
  3. Connect your MCP client: Add the server to Claude Desktop, Cursor, or any MCP-compatible tool using the config in /docs/getting-started.md.

Once connected, queries route through the DuckDB tools automatically. Run get_xml_structure first to see which record types are present in the export before writing any application queries.

Resources:

Frequently Asked Questions

Is there a demo Apple Health MCP Server available?

Yes, you can see the Apple Health MCP Server in action in this demo video and find detailed information in this article.

How does the Apple Health MCP Server handle privacy and data security?
The server is designed for self-hosted deployment, meaning health data stays within your own infrastructure. Users must manually export their Apple Health data as XML and provide it to your application, giving them full control over what data they share. The server processes and indexes this data locally without sending it to external services. For production applications, you're responsible for implementing appropriate security measures around data storage and access, following healthcare compliance requirements like HIPAA if applicable to your use case.
Does the Apple Health MCP Server work with Claude Desktop out of the box?
Yes. Add the server to Claude Desktop's MCP config, point it at your indexed data, and Claude can query health records with natural language immediately. Setup takes under 30 minutes following the getting-started docs.
What Apple Health record types can the MCP server query?

Any type present in the export: workouts, sleep analysis, heart rate, HRV, step count, blood oxygen, respiratory rate, and more. Run get_xml_structure first to see exactly what's in a specific export before building queries.

Does this require continuous Apple Watch sync or a one-time XML export?

One-time manual export only in v0.1.0. Users export from the iOS Health app and provide the file to your application. There is no automatic sync at this version - plan user onboarding around this data-import step.

What backends does the MCP server support besides DuckDB?

Elasticsearch and ClickHouse are fully supported with dedicated tool sets. DuckDB is the default with zero infrastructure setup; switch backends by setting environment variables in the config.

Is the Apple Health MCP Server production-ready or still in development?

v0.1.0 is functional but APIs may change. For new projects requiring continuous sync or multi-device support, evaluate Open Wearables (the successor platform) before committing to an architecture built on manual exports.

Can the MCP server handle multiple users' health data or just one export at a time?

v0.1.0 is built around single-export analysis. Multi-user setups require additional infrastructure. Open Wearables handles multi-user scenarios natively and is worth evaluating if you're building a platform rather than a personal tool.

Written by Bartosz Michalak

Director of Engineering
He drives healthcare open-source development at the company, translating strategic vision into practical solutions. With hands-on experience in EHR integrations, FHIR standards, and wearable data ecosystems, he builds bridges between healthcare systems and emerging technologies.

See related articles

Ready to build with Apple Health data?

Let's Create the Future of Health Together

Apple Health MCP Server gives you instant access to structured health data through simple API calls.

Looking for a partner who not only understands your challenges but anticipates your future needs? Get in touch, and let’s build something extraordinary in the world of digital health.

Newsletter

Data integration beyond just Apple Health?

With Open Wearables, these capabilities extend beyond to all major wearable devices through a single API.

Explore
Bartosz Michalak

{
 "@context": "https://schema.org",
 "@type": "BlogPosting",
 "headline": "Apple Health MCP Server: Open-Source Tool for Connecting Apple Health Data to AI",
 "url": "https://www.themomentum.ai/blog/apple-health-mcp-server-by-momentum",
 "datePublished": "2025-08-20",
 "dateModified": "2026-03-10",
 "author": {
   "@type": "Person",
   "name": "Sebastian Kalisz",
   "jobTitle": "Senior Software Engineer"
 },
 "publisher": {
   "@type": "Organization",
   "name": "Momentum",
   "url": "https://www.themomentum.ai",
   "logo": {
     "@type": "ImageObject",
     "url": "https://www.themomentum.ai/logo.png"
   }
 },
 "description": "An open-source MCP server that bridges Apple Health XML exports with large language models, enabling natural language queries over personal health data — running locally by default.",
 "mainEntityOfPage": {
   "@type": "WebPage",
   "@id": "https://www.themomentum.ai/blog/apple-health-mcp-server-by-momentum"
 }
}