
Apple Health MCP Server
Query your Apple Health data with natural language via Elasticsearch, ClickHouse, or DuckDB.
Add to your client
Copy the config for your MCP client and paste it into its config file.
git clone https://github.com/the-momentum/apple-health-mcp-serverPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"apple-health-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--init",
"--mount",
"type=bind,source=<project-path>/{xml-file-name}.xml,target=/root_project/raw.xml",
"--mount",
"type=bind,source=<project-path>/config/.env,target=/root_project/config/.env",
"-e",
"ES_HOST=host.docker.internal",
"mcp-server:latest"
]
}
}
}Requires Docker to be installed and running.
Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Docker (recommended) or uv for dependency management
- Clone the repository and copy config/.env.example to config/.env
- An Apple Health data export as an XML file placed on your filesystem
- A backing store populated from the XML: Elasticsearch (make es), ClickHouse (make ch), or DuckDB (make duckdb)
About Apple Health MCP Server
An MCP server for querying Apple Health data with natural language. It imports Apple Health XML exports into Elasticsearch, ClickHouse, or DuckDB and exposes MCP tools for structure analysis, record search, type-based extraction, summaries, statistics, and trend analysis. Built on FastMCP, with Docker support and extensive .env configuration.
Tools & capabilities (18)
get_xml_structureAnalyze the structure and metadata of your Apple Health XML export (file size, tags, types).
search_xml_contentSearch for specific content in the XML file (by attribute value, device, type, etc.).
get_xml_by_typeExtract all records of a specific health record type from the XML file.
get_health_summary_esGet a summary of all Apple Health data in Elasticsearch (total count, type breakdown, etc.).
search_health_records_esFlexible search for health records in Elasticsearch with advanced filtering and query options.
get_statistics_by_type_esGet comprehensive statistics (count, min, max, avg, sum) for a specific health record type in Elasticsearch.
get_trend_data_esAnalyze trends for a health record type over time (daily, weekly, monthly, yearly) in Elasticsearch.
search_values_esSearch Elasticsearch for records with exactly matching values (including text).
get_health_summary_chGet a summary of all Apple Health data in ClickHouse (total count, type breakdown, etc.).
search_health_records_chFlexible search for health records in ClickHouse with advanced filtering and query options.
get_statistics_by_type_chGet comprehensive statistics (count, min, max, avg, sum) for a specific health record type in ClickHouse.
get_trend_data_chAnalyze trends for a health record type over time (daily, weekly, monthly, yearly) in ClickHouse.
search_values_chSearch ClickHouse for records with exactly matching values (including text).
get_health_summary_duckdbGet a summary of all Apple Health data in DuckDB (total count, type breakdown, etc.).
search_health_records_duckdbFlexible search for health records in DuckDB with advanced filtering and query options.
get_statistics_by_type_duckdbGet comprehensive statistics (count, min, max, avg, sum) for a specific health record type in DuckDB.
get_trend_data_duckdbAnalyze trends for a health record type over time (daily, weekly, monthly, yearly) in DuckDB.
search_values_duckdbSearch DuckDB for records with exactly matching values (including text).
When to use it
- Analyze your Apple Health data types and how much data is available
- Summarize daily activity statistics and review recent trends
- Summarize and compare workouts (e.g. running) across specific months
- Surface hidden trends in health data via auto-generated queries instead of manual SQL
Security notes
Runs locally and reads your exported Apple Health XML data from your filesystem; no external API key is required. The Docker config mounts your health data file, the app directory, and your config/.env into the container. Apple Health data is sensitive personal health information, so keep your exports and config private.
Apple Health MCP Server FAQ
Which databases are supported as a backend?
Elasticsearch, ClickHouse, and DuckDB. You populate the chosen backend from your Apple Health XML export using make es, make ch, or make duckdb.
How do I get my Apple Health data in?
Export your Apple Health data as an XML file from your iPhone, place it on your filesystem (the project root by default), and import it into your chosen backend before running the server.
How do I run it with an MCP client?
Either via Docker (recommended) by building the image with make build and adding the docker-mcp-server config, or locally with uv run by adding the uv-mcp-server config. Both are stdio-based and added to your LLM client's mcpServers settings.
Does it require an API key?
No. The server runs locally against your own exported data and your chosen local/self-hosted database; no external API key is needed for the MCP server itself.
Alternatives to Apple Health MCP Server
Compare all alternatives →Official MCP server providing persistent, file-backed knowledge-graph memory across sessions.
Structured step-by-step reasoning tool for breaking problems into revisable thought sequences.
Fully managed remote server for AWS docs, blogs, What's-New and Well-Architected guidance — no key.
Compare Apple Health MCP Server with: