Build on Luna: REST API, MCP connector and CLI.
Luna by getmyluna.app is a baby tracker for feeds, sleep, nappies, solids and routines. Everything the web app does is available programmatically, scoped to one family per credential. This page is the developer portal; the machine-readable versions are linked in every section.
Start here
| OpenAPI spec | https://getmyluna.app/openapi.json |
|---|---|
| Interactive docs | https://getmyluna.app/docs (Swagger UI) · https://getmyluna.app/redoc |
| API index (JSON) | https://getmyluna.app/api |
| MCP server | https://getmyluna.app/mcp · manifest /.well-known/luna-connector.json · setup guide |
| Agent instructions | https://getmyluna.app/llms.txt |
| CLI | https://getmyluna.app/cli/luna.py (single file, Python 3.9+, standard library only) |
| Support | [email protected] |
Authentication
Create a free account at /onboard (or POST /api/vega/onboard). Then create a bearer token in the app under Settings → Connect an assistant, or from a signed-in session:
curl -X POST https://getmyluna.app/api/vega/token \
-H "Cookie: luna_session=<session>" -H "Content-Type: application/json" \
-d '{"label": "my-script", "scopes": ["read", "write"]}'
The token is shown once. Send it as Authorization: Bearer <token> on every request. Tokens are stored hashed, carry read or read+write scope, and can be listed (GET /api/vega/tokens) and revoked (POST /api/vega/token/revoke) at any time. Only GET /api/health and POST /api/vega/onboard work without credentials; everything else returns 401 {"error": "unauthorized"}.
Example requests
Live status (asleep or awake, hunger, next feed estimate, today's totals):
curl https://getmyluna.app/api/vega/live -H "Authorization: Bearer $LUNA_TOKEN"
Log a 150 ml bottle now:
curl -X POST https://getmyluna.app/api/vega/log \
-H "Authorization: Bearer $LUNA_TOKEN" -H "Content-Type: application/json" \
-d '{"type": "milk", "ml": 150}'
Log a solid meal at a specific time, then read back the day:
curl -X POST https://getmyluna.app/api/vega/log \
-H "Authorization: Bearer $LUNA_TOKEN" -H "Content-Type: application/json" \
-d '{"type": "solid", "foods": ["scrambled egg", "toast"], "meal_type": "meal", "ts": "2026-09-20T12:15:00"}'
curl "https://getmyluna.app/api/vega/events?date=2026-09-20" -H "Authorization: Bearer $LUNA_TOKEN"
Responses are JSON. Errors are {"error": "<code>"} with a 4xx status. Timestamps are ISO 8601 in the family's local time; future timestamps are rejected. Volumes are millilitres, weights kilograms, lengths centimetres regardless of the family's display units.
Endpoints
Grouped as in the spec. Every operation has a unique operationId, typed request and response schemas, and the error responses it can return, so the spec can be loaded straight into a function-calling or tool-use framework.
| Group | What it covers |
|---|---|
| Discovery | GET /api/health, GET /api/me, /llms.txt, the MCP manifest |
| Account | Sign-up, members, invite links, export, permanent deletion |
| Tokens | Create, list and revoke bearer tokens |
| Tracker | POST /api/vega/log and friends: feeds, sleep, nappies, solids, notes, supplements, measurements; edit, delete, undo, react |
| Insights | Live status, patterns and the weekly nutrition/allergen review (once solids have started), growth measurements |
| Profile | Child profile; region (uk/us), units and timezone |
| Ask Luna | Luna Plus questions answered from the family's own log, and the notes Luna remembers |
MCP connector
The same bearer token works with Luna's hosted MCP server at https://getmyluna.app/mcp (streamable HTTP, JSON responses, stateless). It exposes 23 tools, 3 resources and 3 prompts designed for assistants: every response names the child and the clock it was read at, write tools return a plain-language confirmation summary and accept an idempotency key. Setup for Meta Muse and Claude Code is on the connector page.
claude mcp add luna --transport http https://getmyluna.app/mcp --header "Authorization: Bearer $LUNA_TOKEN"
CLI
A single-file command-line client that needs nothing beyond Python's standard library:
curl -fsSLO https://getmyluna.app/cli/luna.py && chmod +x luna.py export LUNA_TOKEN=... # or: ./luna.py login [email protected] ./luna.py status ./luna.py log milk 150 ./luna.py log solid "scrambled egg" toast --meal snack ./luna.py events --date 2026-09-19 --pretty ./luna.py api GET /api/vega/patterns
Every command prints JSON and exits non-zero on an HTTP error, so it composes with jq and shell scripts. luna api METHOD /path reaches any endpoint in the spec.
Limits and conduct
- MCP calls are limited to 120 per minute per token; the REST API is unmetered but please keep polling to a few requests per minute.
- One family per credential. Do not attempt to access another family's data; see Terms and Privacy.
- Luna is not a medical device. Do not build anything on it that diagnoses, assesses symptoms or advises on medication. See Safety.
- Report security issues to [email protected] with "Security" in the subject.
Changelog
- 1.1.0: public OpenAPI spec, Swagger UI,
/apiindex, CLI, this portal. - 1.0.0: MCP connector (23 tools), scoped tokens, family deletion.