# Habits agent mode

product: Habits
base_url: https://habits.kevnk.com

Habit tracker with a hosted API and MCP server. An agent acts for the person
who owns the API key.

## When to use
The user mentions their habits, streaks, a daily check-in, marking something
done, or wants a habit added, renamed, reordered, or removed.

## Authentication
- `Authorization: Bearer hab_…` (API key). Get one:
  1. `POST /api/auth/request-code` `{"email": "…"}` → the user gets a six-digit code by email.
  2. `POST /api/auth/verify-code` `{"email": "…", "code": "123456", "name": "claude-code", "timezone": "America/Chicago"}` → `{"apiKey": "hab_…"}`. Save it; it is shown once.
- MCP clients that speak OAuth can connect to `https://habits.kevnk.com/mcp` and sign in in the browser.

## Key endpoints
- `POST /api/tools/{name}` with a JSON object of arguments. `GET /api/tools` lists them with schemas. Start with `get_overview`.
- `GET /api/me`, `GET|POST /api/me/keys`, `DELETE /api/me/keys/{id}`.
- `GET|POST /api/sync` for the app's offline cache.
- `https://habits.kevnk.com/mcp` Streamable HTTP MCP (stateless).

## Rules
See `https://habits.kevnk.com/guide.md` (also the MCP resource `habits://guide`).

## Install
- CLI + skill: https://github.com/kevnk/habits-app (`habits login`).
- Claude Code: `claude mcp add --transport http habits https://habits.kevnk.com/mcp --header "Authorization: Bearer hab_…"`.

## Not supported
No multi-user sharing, no webhooks, no ChatGPT Actions manifest yet. Errors are JSON `{error: {code, message, hint}}`.

## Reference
- https://habits.kevnk.com/llms.txt
- https://habits.kevnk.com/.well-known/agent.json
