Baby Routine MCP
# Baby Routine MCP
MCP server (built on `mcp` 2.1.1, the official Python SDK) that exposes a baby's
routine to any MCP client — Claude Desktop, Claude Code, or your own agent.
The server is deliberately thin: the API owns the tool contract
(`POST /api/assistant/tools/{name}`), so this project is a transport adapter with
no business rules to keep in sync.
## Tools
| Tool | What it answers / does |
| --- | --- |
| `describe_resources` | Which record types exist and what fields they take |
| `log_record` | Create a feeding, sleep, diaper, bath, dose, purchase, clothing item… |
| `update_record` / `delete_record` | Fix or remove a record |
| `search_records` | "Which bodies size S do I have?" |
| `medication_report` | "How much did I spend on this medication two months ago, and how many doses per day?" |
| `routine_report` | Per-day counts and averages for the routine |
| `today_overview` | Age, today's counts, medication adherence, active alerts |
## Configure
```bash
cp .env.example .env
```
| Variable | Meaning |
| --- | --- |
| `BABY_ROUTINE_API_URL` | Where the API lives (`http://localhost:8010`) |
| `BABY_ROUTINE_SERVICE_TOKEN` | Must match `MCP_SERVICE_TOKEN` in the API |
| `BABY_ROUTINE_USER_ID` | Firebase uid this server acts for |
| `BABY_ROUTINE_ID_TOKEN` | Alternative: a Firebase ID token |
| `BABY_ROUTINE_TRANSPORT` | `stdio` (local client) or `streamable-http` (remote) |
## Run
Local (stdio), from Claude Desktop or Claude Code — `claude_desktop_config.json`:
```json
{
"mcpServers": {
"baby-routine": {
"command": "baby-routine-mcp",
"env": {
"BABY_ROUTINE_API_URL": "http://localhost:8010",
"BABY_ROUTINE_SERVICE_TOKEN": "change-me",
"BABY_ROUTINE_USER_ID": "dev-user"
}
}
}
}
```
Or with Claude Code: `claude mcp add baby-routine -- baby-routine-mcp`.
Remote (streamable HTTP), served by nginx at `/mcp/`:
```bash
make up # http://localhost:8020
make logs
make stdio # run on stdio, as a local MCP client would
make down
```
## Tests
```bash
make test
```
They drive real MCP tool calls against a mocked API transport, asserting the
outgoing HTTP request, the credentials and the error mapping.
TDQS
Scored across 8 tools
Most tools have clearly distinct purposes: CRUD operations (log/update/delete/search), schema discovery, and specialized reports. However, routine_report and today_overview both return daily counts for feedings/diapers/sleep, so an agent might need to read descriptions carefully to pick the right one.
The majority of tools follow a verb_noun pattern (describe_resources, log_record, update_record, delete_record, search_records), but the reporting tools break this with noun_noun names (routine_report, medication_report, today_overview). The convention is otherwise consistent and readable.
Eight tools is well-scoped for a baby routine tracker: generic CRUD via log/update/delete/search, a schema explorer, and three reporting/overview tools. Each tool serves a distinct need without redundancy.
The generic log/update/delete/search surface covers all twelve resource types listed by describe_resources, so no record type is a dead end. Reporting covers routine events, medications, and a daily snapshot, and missing analytics like growth charts are not core to the stated purpose.