Apple Health

Databases

Local-first Apple Health MCP server for questions about your sleep, workouts and heart data.

Your AI app calls the Apple Health MCP server, which does the databases work and sends the result back to the chat.

About Apple Health

Apple Health is a community MCP server from neiltron, filed in our directory under databases. Local-first Apple Health MCP server for questions about your sleep, workouts and heart data.

Apple Health runs on your own machine: your AI app starts it with the command npx -y @neiltron/apple-health-mcp@1.4.5 and talks to it over standard input and output. It needs HEALTH_DATA_DIR set before Apple Health starts.

Apple Health is listed in the official MCP registry as io.github.neiltron/apple-health-mcp, version 1.4.5.

At a glance

Publisher
neiltron (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @neiltron/apple-health-mcp
Written in
TypeScript
License
MIT
GitHub stars
580
Official MCP registry
io.github.neiltron/apple-health-mcp

How to set up Apple Health

  1. Install Node.js on the machine that runs your AI app, because Apple Health starts with npx and downloads its package on first run.
  2. Create HEALTH_DATA_DIR for Apple Health in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Apple Health to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Apple Health tools to confirm the connection.
  5. Run one read-only task with Apple Health first, and keep your app asking before each tool call until the results look right.

Apple Health compared with similar servers

  • Auto Ontology by gogoymh has fewer GitHub stars than Apple Health (575 against 580); both are community servers, and both run locally.
  • Ratel by ratel-ai has more GitHub stars than Apple Health (581 against 580); both are community servers, and both run locally.
  • Enferno by level09 has fewer GitHub stars than Apple Health (571 against 580); both are community servers, and both run locally.

Before you connect Apple Health

  • Give Apple Health its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Apple Health tool call until you trust what it does with them.
  • Treat text that Apple Health fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Apple Health on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Apple Health

How marketing and sales teams put Apple Health to work, by company size. Pick the size closest to yours and start Apple Health on one use case.

Small business

  • A small business with its own app can ask Apple Health plain questions about customers and orders, without writing SQL.
  • Owners can use Apple Health to pull a list of customers who haven't bought in 90 days and plan a win-back email.
  • Apple Health runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing analysts can connect Apple Health to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Lifecycle teams can use Apple Health to build audience lists from product data and check counts before a send.
  • Start Apple Health on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should point Apple Health at a read replica with a read-only role, so agents query freely without risk to production data.
  • Data teams can expose curated views through Apple Health, so marketing gets self-serve answers without access to raw customer tables.
  • Apple Health is a community server, so have security review the code and pin a version before Apple Health touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Apple Health README

From neiltron/apple-health-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Apple Health MCP Server

Query Apple Health data from an MCP client using SQL and DuckDB. The server runs locally, reads CSV exports on demand, and provides tools for schema discovery, analytical queries, and health summaries.

Requirements

The native Apple Health export.xml format is not currently supported.

Configure an MCP client

For Claude Desktop, add the following to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "apple-health": {
      "command": "npx",
      "args": ["-y", "@neiltron/apple-health-mcp"],
      "env": {
        "HEALTH_DATA_DIR": "/path/to/your/unzipped/health-export"
      }
    }
  }
}

Restart the client after changing its configuration. Other MCP clients can use the same command, arguments, environment, and stdio transport.

Environment variables
Variable Required Default Purpose
HEALTH_DATA_DIR Yes , Directory containing the exported CSV files
MAX_MEMORY_MB No 2048 DuckDB memory limit in megabytes
CACHE_SIZE No 100 Maximum number of cached query results

Export health data

  1. Install and open Simple Health Export CSV on your iPhone.
  2. Select All and choose the time range to export.
  3. Transfer the archive to the computer running your MCP client.
  4. Unzip it and set HEALTH_DATA_DIR to the resulting directory.

The server reads the files in place. It does not upload the export or make network requests, although query results returned to your MCP client may be sent to that client's configured model provider.

Tools

Tool Purpose
health_schema Discover table names, columns, units, and sample rows
health_query Run one DuckDB SELECT-family analytical statement with JSON, CSV, or summary output
health_report Generate a weekly, monthly, or custom health summary

Start with health_schema; table names depend on the files in your export. See Querying Apple Health data for the data model and working examples.

health_query accepts one DuckDB analytical statement. See Query safeguards for supported statements and restricted operations.

Query safeguards

The server limits DuckDB file access to HEALTH_DATA_DIR. It also disables network access and temporary disk storage, and it locks the database settings. The data directory stays readable and writable so the importer can read CSV files.

These controls reduce accidental side effects from generated SQL. They do not isolate the process. Run the server through a local stdio MCP client. Do not expose it to an untrusted network client. Use process or OS isolation if the server must accept untrusted SQL.

History and memory

The first request that needs a table loads that table's full CSV history. There is no date window, so a query can reach as far back as the export goes.

Because every tool can reach the whole configured history, only start this server from an MCP client you trust with that data.

Loaded tables are held in memory, and DuckDB is given the MAX_MEMORY_MB limit described above. Roughly 1 GiB covers a two-year multi-table export, so the 2048MB default leaves headroom; raise MAX_MEMORY_MB for a larger export. The server never spills health rows to a temporary directory on disk, so an export that does not fit in the limit fails with an explicit error instead.

Other current limitations:

  • Only the Simple Health Export CSV layout is supported.
  • The DuckDB database is in memory and is rebuilt for each server process, so each launch reloads from the CSV files. Persistent incremental import is planned future work, not current behavior.
  • Device overlap can produce duplicate-looking measurements; queries should account for sourceName where appropriate.
  • Health reports summarize recorded data and are not medical advice.

Development

git clone https://github.com/neiltron/apple-health-mcp.git
cd apple-health-mcp
bun install

npm test
npm run typecheck
npm run build

See Architecture for the code layout, data lifecycle, and implementation constraints. See Release procedure for publishing and recovery steps.

License

MIT

Questions about Apple Health

What is the Apple Health MCP server?

Local-first Apple Health MCP server for questions about your sleep, workouts and heart data. Apple Health is maintained by neiltron on GitHub at neiltron/apple-health-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Apple Health MCP server?

Add Apple Health to your AI app's MCP config with the command npx -y @neiltron/apple-health-mcp@1.4.5. In Claude Code, run claude mcp add --transport stdio apple-health -- npx -y @neiltron/apple-health-mcp@1.4.5. To run Apple Health this way you need Node.js installed.

Does Apple Health need an API key?

Yes. Apple Health expects HEALTH_DATA_DIR to be set. Create the key for Apple Health in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Apple Health an official MCP server?

No. Apple Health is a community server maintained by neiltron. Community servers can be excellent; read the code and the open issues before you give Apple Health access to company data.

What license is Apple Health under?

Apple Health is released under the MIT license, according to its GitHub repository. The license covers the code of Apple Health; the service it connects to has its own terms.