Metadata-Version: 2.4
Name: health4ai
Version: 0.1.0
Summary: Local MCP server that queries Apple Health data from your own Supabase/Postgres for Claude, Cursor, and other MCP clients.
Author: Jeff Littell
License-Expression: MIT
Project-URL: Homepage, https://health4.ai
Project-URL: Repository, https://github.com/jefflitt1/health4ai
Project-URL: Issues, https://github.com/jefflitt1/health4ai/issues
Project-URL: Documentation, https://github.com/jefflitt1/health4ai/blob/main/docs/SETUP.md
Keywords: mcp,apple-health,healthkit,supabase,claude,cursor
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastmcp>=2.0.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: python-dotenv>=1.0.0
Dynamic: license-file

# 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.

<!-- mcp-name: io.github.jefflitt1/health4ai -->

## Install

```bash
pip install health4ai
```

Requires Python 3.11+. From a clone of the repo you can still run the previous path:

```bash
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](https://github.com/jefflitt1/health4ai/blob/main/docs/SETUP.md).

## Run

After `pip install health4ai`:

```bash
health4ai
# or
python -m health4ai
```

Claude Desktop / Claude Code / Cursor (`mcp.json`):

```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](https://github.com/jefflitt1/health4ai/blob/main/LICENSE).
