Give your data to an AI agent
Mint a read-only token and point Claude, or any MCP client, at one person's health data.
Open Health Sync speaks the Model Context Protocol. An agent can list and read a person's samples, sleep, workouts, daily summaries and coverage. It cannot write, delete or connect anything.
Mint a read-only token
A token whose only scope is read may live up to 30 days, so a person can keep it in their agent
configuration:
curl -s -X POST $OHS/v1/users/$USER_ID/tokens -H "Authorization: Bearer $KEY" \
-H 'Content-Type: application/json' -d '{"scopes":["read"],"ttl_seconds":2592000}'
# {"token": "ohs_ut_...", "expires_at": "...", "scopes": ["read"]}The token sees that one user only. It stops working at expires_at or when the user is deleted.
Add the server to your agent
In Claude Desktop, open Settings, Developer, Edit Config, and add to
claude_desktop_config.json, then restart:
{
"mcpServers": {
"open-health-sync": {
"command": "/usr/local/bin/ohs",
"args": ["mcp"],
"env": {
"OHS_MCP_URL": "https://ohs.example.org",
"OHS_MCP_KEY": "ohs_ut_..."
}
}
}
}ohs mcp holds no data and needs no database: it forwards every message to the /mcp endpoint
of the instance. Get the binary from the
releases.
Ask
How did my resting heart rate move over the last month, and on which days did I sleep less than six hours?
The server's instructions steer agents to daily summaries for trends and to narrow windows for raw samples, so answers stay small.


Good to know
OHS_MCP_URLmust behttpsunless the host is loopback, and redirects are not followed: give the final URL.- A 401 means a wrong key or an expired token; a 403 a user token without the
readscope; a 404 or 405 a URL that is not the instance's base URL. - Records carry strings written by devices and providers (source names, metadata, meal labels). Agents must treat them as data, never as instructions.
- A tenant key works too, and sees every user of the tenant. Prefer a user token for a person's own agent.
Every tool and argument: MCP server reference.