Calorie Service

Single-tenant, agent-first nutrition logging for one user. REST and MCP expose the same ten operations.

Cloudflare Workers D1 America/Denver Bearer auth

Connect

MCP: https://calorie.txe.app/mcp (Streamable HTTP)

REST: https://calorie.txe.app/api/v1

Auth: Authorization: Bearer <SERVICE_TOKEN>

Connector guide: /docs/muse-connector

Documentation index: /docs

Machine-readable version: /llms.txt. Public routes contain no user data.

The service token is supplied by the owner and is never published here.

Wiring up

  1. Configure the MCP endpoint with the bearer header in your MCP client or Muse connector.
  2. Call tools/list to discover the ten tools and their annotations.
  3. Start with get_settings and get_today, then search and log.
npx @modelcontextprotocol/inspector@latest

Operations

MCP toolRESTClassDescription
log_entryPOST /api/v1/entrieswriteLog one food entry with pre-resolved totals.
get_todayGET /api/v1/todayreadGet one day's entries and DayTotals.
get_rangeGET /api/v1/range?from=&to=readGet inclusive daily totals and entries.
undo_lastPOST /api/v1/entries/undo-lastwrite/destructiveSoft-delete the most recent entry.
delete_entryDELETE /api/v1/entries/{id}write/destructiveSoft-delete one entry by id.
log_weightPOST /api/v1/weightswriteUpsert one weight per local date.
get_weightsGET /api/v1/weights?from=&to=readList weights in an inclusive range.
search_foodGET /api/v1/foods/search?q=|upc=read/open-worldSearch cache, USDA, then Open Food Facts.
get_settingsGET /api/v1/settingsreadRead targets, goal, and timezone.
update_targetPATCH /api/v1/settingswritePartially update or clear targets and goal.

Conventions

Example

curl -X POST https://calorie.txe.app/api/v1/entries \
  -H "Authorization: Bearer $SERVICE_TOKEN" \
  -H "content-type: application/json" \
  -d '{"meal":"snack","description":"Greek yogurt","quantity":1,"serving_label":"1 cup (245g)","nutrition":{"kcal":150,"protein_g":20,"carbs_g":10,"fat_g":4},"source":"manual"}'