# health4ai

health4ai is a Claude Code MCP server that queries Apple Health data from a personal Supabase or Postgres database.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 12 repo stars
- Author: jefflitt1
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jefflitt1/health4ai/tree/HEAD/mcp-server
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/health4ai

## What it does

The server communicates over stdio to fetch health records synced from the iOS app into your database. Running the server requires Python 3.11 or newer, along with the `DATABASE_URL` connection string and a valid user UUID in `HEALTHKIT_USER_ID`. The service halts startup if the user ID is missing or formatted incorrectly, while calendar buckets rely on `HEALTH4AI_TZ` with a default of UTC.

You can install the package via `pip install health4ai` and invoke the server using the `health4ai` command inside your client configuration.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `DATABASE_URL`, `HEALTHKIT_USER_ID` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add health4ai -e DATABASE_URL=<DATABASE_URL> -e HEALTHKIT_USER_ID=<HEALTHKIT_USER_ID> -- uvx health4ai
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from health4ai <command>

### Codex

**Platform CLI**
```bash
codex mcp add mcp-server --env DATABASE_URL=<DATABASE_URL> --env HEALTHKIT_USER_ID=<HEALTHKIT_USER_ID> -- uvx health4ai
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from health4ai <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-server": {
            "command": "uvx",
            "args": [
                "health4ai"
            ],
            "env": {
                "DATABASE_URL": "<DATABASE_URL>",
                "HEALTHKIT_USER_ID": "<HEALTHKIT_USER_ID>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from health4ai <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "health4ai"
            ],
            "env": {
                "DATABASE_URL": "<DATABASE_URL>",
                "HEALTHKIT_USER_ID": "<HEALTHKIT_USER_ID>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from health4ai <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e DATABASE_URL=<DATABASE_URL> -e HEALTHKIT_USER_ID=<HEALTHKIT_USER_ID> mcp-server uvx health4ai
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from health4ai <command>

## When to use it
- query Apple Health metrics from Supabase
- fetch workout history via MCP
- access health records in Claude Code

## Example prompts
- Show my step count for this week
- Get my average heart rate from yesterday
- Find my active calories burned last month

## Similar
- [Open Brain](https://affpapa.org/en/nevibecode/mcp/open-brain.md) — MCP server · ★ 8 repo stars
- [postgres-patterns](https://affpapa.org/en/nevibecode/skills/postgres-patterns.md) — skill · 7200 installs
- [Supabase](https://affpapa.org/en/nevibecode/mcp/supabase-supabase.md) — MCP server · 177 installs
- [supabase-schema-architect](https://affpapa.org/en/nevibecode/agents/supabase-schema-architect.md) — subagent · 3839 installs
- [powersync](https://affpapa.org/en/nevibecode/skills/powersync.md) — skill · 1400 installs
- [supabase-realtime-optimizer](https://affpapa.org/en/nevibecode/agents/supabase-realtime-optimizer.md) — subagent · 1346 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
