the-momentum/apple-health-mcp-server
Apple Health MCP Server is a Python-based Model Context Protocol (MCP) server that allows AI assistants and applications to securely access and analyze personal health data exported from Apple Health. The server ingests the XML export file generated by the Apple Health app, parses it, and imports the data into a local DuckDB database—an efficient in-process analytical database. This structured database contains three tables representing different health record types (such as quantity samples, category samples, and workouts), enabling fast SQL-based querying and analytics. Once the server is running, it exposes a set of MCP tools that AI models (like those in Claude or any MCP client) can invoke to list available health data types, query specific metrics (e.g., daily steps, heart rate, sleep duration), perform statistical aggregations, and retrieve workout details. The server is designed to be self-hosted, ensuring that sensitive health information remains entirely under the user's control—data never leaves the local machine. It runs cross-platform on macOS, Windows, and Linux. The project includes a robust import pipeline that handles large XML exports efficiently. Configuration options allow users to specify the DuckDB database file location and other parameters. Recent updates have switched from Parquet-based storage to a native DuckDB file, improving query performance and simplifying the architecture. The server is part of the growing ecosystem of MCP-enabled tools, making it easy to integrate personal health data into AI workflows for personalized insights, trend analysis, and conversational health coaching. Apple Health MCP Server is an open-source project with an active development community. It is distributed under an open-source license and has gained moderate popularity with 203 GitHub stars at the time of scraping.
- Category
- Developer Tools
- Pricing
- Open Source
Problem solved
Apple Health collects a wealth of personal wellness data, but exporting and analyzing that data programmatically is cumbersome. Users who want to query their health history, generate reports, or integrate it with AI assistants face the challenge of parsing the verbose XML export file and structuring it into a queryable format. This MCP server solves that problem by automating the import process, providing a simple interface for AI models to retrieve and analyze health metrics. It enables privacy-preserving, on-device health data analytics that can be invoked conversationally via any MCP-compatible client.
Use cases
- Ask an AI assistant about daily step counts, averages, and trends over weeks or months.
- Analyze sleep patterns by querying sleep analysis data and correlating with other metrics like heart rate.
- Retrieve detailed workout logs (runs, walks, cycling) to review performance and calories burned.
- Build a personal health dashboard that combines weight, blood pressure, and active energy data from Apple Health.
- Generate a health report for a medical appointment by aggregating relevant metrics and highlights.
- Use as a data source for a larger self-quantification project that combines health data with other IoT devices.
Audience
- Developers
- Data Scientists
- Hobbyists
Pros
- Privacy-preserving: data stays on your local machine.
- Uses fast DuckDB engine for analytics, suitable for large health datasets.
- Seamless MCP integration lets any compatible AI app query health data.
- Supports the full Apple Health XML export format.
- Open source and actively maintained.
Cons
- Requires manual export of health data from the Apple Health app (no real-time sync).
- Initial setup requires technical knowledge (Python environment, MCP client configuration).
- Limited to data types provided by Apple Health; may not cover all third-party health app data.
Official website: https://github.com/the-momentum/apple-health-mcp-server
Canonical LambdaBase page: https://www.lambdabase.com/tools/the-momentum-apple-health-mcp-server