health4ai MCP server
Local MCP server that queries your Apple Health data from a Supabase/Postgres project you own. Use it with Claude Desktop, Claude Code, Cursor, or any stdio MCP client.
Install
pip install health4ai
Requires Python 3.11+. From a clone of the repo you can still run the previous path:
pip install -r mcp-server/requirements.txt
python mcp-server/main.py
Configure
The server talks to your database over stdio. Set these environment variables (or a .env file in the working directory):
| Variable | Required | Secret | Description |
|---|---|---|---|
DATABASE_URL |
yes | yes | Postgres connection string for your Supabase project (transaction pooler; database password, not the service_role key). SUPABASE_DB_URL is accepted as an alias. |
HEALTHKIT_USER_ID |
yes | no | UUID of the Supabase Auth user whose HealthKit rows to query. The server refuses to start if this is unset, not a UUID, or the 00000000-… placeholder. |
HEALTH4AI_TZ |
no | no | IANA time zone for calendar-day buckets (default UTC). |
Full walkthrough: docs/SETUP.md.
Run
After pip install health4ai:
health4ai
# or
python -m health4ai
Claude Desktop / Claude Code / Cursor (mcp.json):
{
"mcpServers": {
"health4ai": {
"command": "health4ai",
"env": {
"DATABASE_URL": "postgresql://...",
"HEALTHKIT_USER_ID": "<your auth user UID>"
}
}
}
}
From a git clone, "command": "python" and "args": ["/path/to/health4ai/mcp-server/main.py"] still work.
License
MIT. See the repository LICENSE.
Release files for health4ai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| health4ai-0.1.0.tar.gz | 35.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| health4ai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.8 kB
Release files / health4ai-0.1.0.tar.gz
| Download URL | health4ai-0.1.0.tar.gz |
|---|---|
| Size | 35.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d3fdf7d06067d50ffcf5e691ae8ee6e4c16d7100789be2101534c35ccb312af
|
|
BLAKE2b-256 checksum How to use checksums |
a091180fc19518bb37b0648fae431e7765301ee7524d1715101d58846521a135
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / health4ai-0.1.0-py3-none-any.whl
| Download URL | health4ai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
faa7346e52e4676846bc10915a338e3d66dcfa358610711f7e6aa2523a9687a6
|
|
BLAKE2b-256 checksum How to use checksums |
d1a490ad8f442cf9ff12c1d1f6fceb0e417696a549d7fe56460555a21c40efb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|