Configure your agent
The Mac app contains two signed helpers. healthmd-mcp gives agents typed tools. healthmd gives you CLI commands.
The separate portable CLI can connect directly to a phone. This feature is a preview and has not completed stable release tests.
A local client can use only the Health.md interfaces that you configure. The client cannot read HealthKit directly. Health.md does not upload your source library.
Choose an interface
Section titled “Choose an interface”| Goal | Start with | Continue to |
|---|---|---|
| Let Codex or Claude query and chart health data on Mac | Bundled healthmd-mcp over stdio |
MCP server & tools |
| Export canonical JSON or generated files in a Mac script | Bundled healthmd CLI |
CLI |
| Connect directly to an open iPhone or Android phone without the Mac app | Portable direct CLI (preview) | Direct phone access |
| Build against exact request and response envelopes | Loopback API or public contracts | Loopback API |
| Parse schemas, records, evidence, or generated fixtures | Versioned reference | Data contracts |
Health.md does not change from direct phone access to the Mac app without your action.
Codex with the Mac app
Section titled “Codex with the Mac app”Install Health.md for Mac. Open its CLI screen. If the app is not in /Applications, copy the displayed MCP path.
Add the signed healthmd-mcp helper to ~/.codex/config.toml:
[mcp_servers.healthmd]command = "/Applications/Health.md.app/Contents/Helpers/healthmd-mcp"args = []startup_timeout_sec = 10tool_timeout_sec = 1200default_tools_approval_mode = "prompt"Restart Codex. Call healthmd_doctor to check setup. Use healthmd_metrics to find metric IDs.
Use the refresh tool to get a small data scope. Then query that scope with a typed tool such as healthmd_metric_chart.
The bundled server has 21 tools for setup, refresh jobs, evidence, queries, and visualizations.
Claude Desktop or Claude Code on Mac
Section titled “Claude Desktop or Claude Code on Mac”Add the bundled helper to Claude Desktop’s MCP configuration or to a trusted Claude Code .mcp.json:
{ "mcpServers": { "healthmd": { "command": "/Applications/Health.md.app/Contents/Helpers/healthmd-mcp", "args": [] } }}Restart the client after you change its configuration. A project configuration requires workspace trust and server approval.
Keep the Mac and iPhone apps open when a tool requests new HealthKit data.
Any stdio MCP client on Mac
Section titled “Any stdio MCP client on Mac”Configure one local process:
command: /Applications/Health.md.app/Contents/Helpers/healthmd-mcparguments: nonetransport: stdioThe host controls stdin and the process. Do not start the helper as an interactive command.
Do not use a shell wrapper that changes JSON-RPC output. Use MCP tools/list to get the schemas from the installed app.
Portable direct setup
Section titled “Portable direct setup”The portable Rust CLI is a public preview. It includes healthmd setup codex, healthmd mcp serve, and direct pairing on Linux and Windows.
On macOS or Linux, run brew install CodyBontecou/tap/healthmd. Then run healthmd setup codex to configure Codex and pair an iPhone.
You can run the setup command again without making duplicate configuration entries.
Use the mobile build that the release evidence names. A published package does not prove mobile compatibility.
Read Direct phone access for transport and protocol details.
Explicit CLI workflows
Section titled “Explicit CLI workflows”Use healthmd directly for canonical extraction or file automation:
healthmd statushealthmd extract --category Sleep --last 7 --output sleep.jsonhealthmd export --last 7 --destination "$HOME/Documents/HealthVault"The bundled Mac helper and portable CLI have different commands and release status. Read Health.md CLI before you automate a command.
Portable pairing and readiness
Section titled “Portable pairing and readiness”These portable workflows are a preview. The bundled Mac MCP helper uses the Mac app's existing iPhone connection.
Direct MCP and CLI workflows require one trusted pairing with Health.md on iPhone. Pairing uses authenticated encryption and the operating system credential store.
- Enable Direct CLI Access in Health.md on iPhone.
- Start pairing from
healthmd setup codexorhealthmd direct pair. - Approve the bounded pairing request on iPhone.
- Keep Health.md in the foreground when you start a query or export.
- Before a large request, call
healthmd_doctorin MCP. In the portable CLI, runhealthmd status.
Read Direct phone access for Manual IP, Tailscale, ports, trusted devices, foreground use, and recovery.
Configuration boundaries
Section titled “Configuration boundaries”A local agent configuration does not grant:
- Unrestricted HealthKit access
- Unrestricted file access
- Unrestricted URLs, shell commands, prompts, roots, or MCP sampling
- Permission to hide missing data, coverage, units, evidence, or limits
- Permission to resume, cancel, or overwrite files without the required approval.
For a complete result, inspect the requested scope, coverage, traversal, limits, and source schema. Process success is not sufficient evidence.