Show HN: Apple Health MCP Server (github.com)

199 points by _neil ↗ HN
Hey HN,

This is an MCP server to chat with Apple Health data. I built it because I'm working on (yet another) personal trainer tool that keeps track of my workout goals, etc. and does scheduling for me. Part of that is weekly check-ins. I thought pairing those check-ins with sensor data could be useful, so here we are.

It seems there isn't a way to automate access to Apple Health data, so this relies on an iOS app that can quickly/easily export key data to CSV. So the process at the moment is to export the data every Sunday before doing a check-in. More steps than I'd like, but in practice isn't a big lift.

Under the hood this is mostly a thin wrapper around duckdb.

There's a video of it in action here: https://x.com/realtron/status/1947710791521591514

26 comments

[ 7.3 ms ] story [ 58.4 ms ] thread
Super cool. An iPhone + Apple Watch generate about 40 distinct biomarkers of your data (resting heart rate, VO2max, workouts, sleep stages, sleep apnea risk, ECGs, and so on), but the ability to interpret them is very limited.

I work on an iOS health app, and I'd love to try integrating this. It'd help eliminate the step of having to manually export to a CSV every Sunday.

Feel free to shoot me an email if you want to collaborate!

Very cool indeed. I started building something similar - relying on Auto Export [https://apps.apple.com/us/app/health-auto-export-json-csv/id...] to export my health data to an endpoint which stores it in a sqlite database. I never got as far as building an MCP server around the data but that's certainly the direction I was heading. The initial idea was to use my health data to provide context to a health/fitness agent that would recommend workouts, check-in on things, etc.
This is awesome! I’ve been working on and off for the last few months on an AI running coach app. Would love to compare notes of effectively prompting Claude or O3 to analyze workouts / build workout plans. In my experience it still requires a lot of hand holding (sudden mileage increases w/w, inconsistent intervals, etc)
There is a native export function in Health but it generates about 1-2 GB of XML per year, since the schema is extremely verbose, so it takes a while. On the other hand, it’s very literally self-describing. But no need for handing access to Health to more or less dubious apps. I also think you can „export“ select data points to „CSV“ using a ten step Shortcut. Might be quicker.
What Apple health actually is? It’s Apple Watch. My data coming from Oura and Withings, I wonder maybe those would have better ways to integrate with actual API.
This is really cool - I recently worked on a tool that I installed on my iPhone, which extracts all health data nightly to CSV and then to a cloud database.

This was quite straightforward once you understand the permissions. I wonder why the OP didn’t do this and was instead using a simple health export CSV?

The main concern I had with releasing this or turning it into a tool was data security.

I have been swimming 1500m x 365 days of the year for the last 7 years. My use case was to build a personalised dashboard for my daily swimming and heart rate data to track detailed progress beyond what Apple offers. Having the ability to query this data with AI could be quite useful, rather than relying on manual reports.

I am once again wishing screen time data was in Apple Health :( Exporting that is even worse.
We built https://sensai.fit to solve this problem for ourselves. Hope it can be helpful for some of you as well.
I’m on mobile and can’t try it out first hand right now but looks great.

Does it include health records (eg from Epic)?

The current version does not. I’m not sure if the official Health export includes that info. My current doctor unfortunately uses some app that doesn’t integrate with Apple Health. It would be a great feature here though.
It’d be great if the agent could update things like my BP and weight.
Can imagine this is really useful for development too.

if RubyLLM.with_tools(...).ask("Do my health metrics indicate I am stressed?") model = 'claude-4-opus' else model = 'claude-4-sonnet' end

This is SO freaking cool. I'm doing something similar for a startup, albeit in a different domain and against a massive dataset.

Looking at the code (and "for the future..." note about LLM generated queries), you cannot ask arbitrary questions? Is that correct?

No, you can ask arbitrary queries. I’ve found that foundation models (and Claude in particular) do a great job at writing sql. It even seems to handle time series questions pretty well.
If you are looking for a way to explore Apple Health data:

I have a proof of concept here that turns the Apple Health export xml file into a timeseries .parquet that you can then load into clickhouse or duckdb.

https://github.com/atlaslib/atlas

Very cool. I already had this started at GitHub so I must have seen it in the past.

I love the use of a notebook as an updating dashboard here. One of my demos before this MCP server was an evidence.dev dashboard.

Can you please add examples of actual chat questions and answers so that we can understand how it actually performs?
Good idea. The video on Twitter has a few different queries (though I don’t expand all of them) in order to build the dashboard. If you pause it at different points, you can see some of the questions it’s asking and then subsequently writing queries for.

All that said, I’ll try to add some examples to the readme.

(comment deleted)