Cronometer

io.github.cphoskinsPublished by GitHub account cphoskinsv2.4.2Updated Nov 3, 2026

MCP server for Cronometer — food logs, macros, fasting, biometrics, and recurring foods

VerifiedSTDIODesktop onlyLocation & LifestyleData & Analytics

Overview

AI-generated overview

Connects an assistant to a Cronometer Gold account to read food logs, macros, micronutrients, fasting and biometrics, and to edit diary entries and targets.

What you can do
  • Read food logs, daily macro totals, micronutrient breakdowns and raw CSV exports
  • Search the food database and inspect foods, serving measures and diary groups
  • Add or remove diary entries, copy a day, mark days complete, manage recurring foods
  • Read and update macro targets, templates and weekly schedules
  • View fasting history and stats, cancel or delete fasts
  • Log or remove biometrics and sync JSON exports plus a markdown food log to disk
When to use it
Useful when you track nutrition in Cronometer and want an assistant to analyze intake, spot nutrient gaps, summarize trends, or make bulk diary and target changes without using the web app.
Requirements
Runs locally as a Python package (pip install cronometer-mcp) over stdio. Needs a paid Cronometer account that supports web login, plus CRONOMETER_USERNAME and CRONOMETER_PASSWORD. Optional CRONOMETER_DATA_DIR sets the sync output folder; CRONOMETER_READ_ONLY, CRONOMETER_TRANSPORT and related host settings change exposure.
Before you install
The account password is stored in the client config and grants full account access; read-only mode only hides tools, it does not limit the credentials. Many tools write, copy or delete diary entries, targets, fasts, biometrics and repeat items. Sync writes files to disk. The server relies on undocumented Cronometer internals that may break on site updates. If exposed over HTTP, the endpoint has no authentication and needs host allowlisting.

Installation

In SourceWeft

  1. Open Cronometer in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

cronometer-mcp

An MCP (Model Context Protocol) server that provides access to your Cronometer nutrition data. Pull detailed food logs, daily macro/micro summaries, manage diary entries, fasting, biometrics, and recurring foods — all from Claude, Cursor, or any MCP-compatible client.

Requires a Cronometer Gold account (or any paid tier that supports web login).

Features

  • Food log — individual food entries with full macro and micronutrient breakdown
  • Daily nutrition — daily calorie, protein, carb, fat, and fiber totals
  • Micronutrients — detailed vitamin/mineral breakdown with period averages
  • Diary management — add/remove food entries, copy entire days, mark days complete
  • Recurring foods — create, list, and delete repeat items that auto-log on selected days
  • Macro targets — read/write daily targets, create templates, set weekly schedules
  • Fasting — view history and stats, cancel or delete fasts
  • Biometrics — log and remove weight, blood glucose, heart rate, body fat
  • Raw CSV export — servings, daily summary, exercises, biometrics, or notes
  • Sync to disk — download JSON exports and generate a markdown food log

Quick Start

1. Install

bash
pip install cronometer-mcp

Or install from source:

bash
git clone https://github.com/cphoskins/cronometer-mcp.gitcd cronometer-mcppip install -e .

2. Set credentials

bash
export CRONOMETER_USERNAME="[email protected]"export CRONOMETER_PASSWORD="your-password"

Or add them to a .env file in your project root (if your MCP client supports it).

3. Configure your MCP client

Claude Code (.mcp.json)
json
{  "mcpServers": {    "cronometer": {      "command": "cronometer-mcp",      "env": {        "CRONOMETER_USERNAME": "[email protected]",        "CRONOMETER_PASSWORD": "your-password"      }    }  }}
Claude Desktop (claude_desktop_config.json)
json
{  "mcpServers": {    "cronometer": {      "command": "cronometer-mcp",      "env": {        "CRONOMETER_USERNAME": "[email protected]",        "CRONOMETER_PASSWORD": "your-password"      }    }  }}

If you installed from source with pip install -e ., you can also use the full Python path:

json
{  "command": "/path/to/venv/bin/python",  "args": ["-m", "cronometer_mcp.server"]}

Read-only mode

Set CRONOMETER_READ_ONLY=1 (also accepts true or yes) in the server's env to expose only the read tools. The 13 tools that change your Cronometer account are not registered at all, so the client never sees them: adding or removing food entries, macro targets, schedules and templates, fasts, biometrics, copy day, mark day complete, and repeat items. sync_cronometer stays available; it only writes files on your machine.

This limits what the server offers, not what your credentials can do. Cronometer has no read-only login, so the password in env still has full access to the account.

Remote access (streamable HTTP)

By default the server talks to its client over stdio. To run it on another machine or in a container, set CRONOMETER_TRANSPORT=streamable-http and it serves the MCP endpoint at http://<host>:<port>/mcp instead.

VariableDefaultMeaning
CRONOMETER_TRANSPORTstdiostdio or streamable-http
CRONOMETER_HOST127.0.0.1Interface to bind. Use 0.0.0.0 inside a container.
CRONOMETER_PORT8000TCP port, 1 to 65535
CRONOMETER_ALLOWED_HOSTSunsetComma-separated Host header values clients may use, as host:port or host:*. Set it whenever the bind host is not loopback.

In Docker, against the published package, reachable as your-server on your network:

bash
docker run --rm -p 8000:8000 \  -e [email protected] \  -e CRONOMETER_PASSWORD=your-password \  -e CRONOMETER_TRANSPORT=streamable-http \  -e CRONOMETER_HOST=0.0.0.0 \  -e CRONOMETER_ALLOWED_HOSTS=your-server:8000 \  python:3.12-slim sh -c "pip install -q cronometer-mcp && cronometer-mcp"

CRONOMETER_ALLOWED_HOSTS matters: the MCP SDK checks Host and Origin headers on its own only when bound to loopback. On any other bind it accepts every Host, which lets a web page you happen to open on the same network reach the server through DNS rebinding. With the allowlist set, requests whose Host or Origin is not on it get 421 or 403. Without it the server logs a warning at startup and runs anyway.

Then point the client at the URL. Claude Code (.mcp.json):

json
{  "mcpServers": {    "cronometer": {      "type": "http",      "url": "http://your-server:8000/mcp"    }  }}

The endpoint has no authentication. Anyone who can reach the port can read and change the Cronometer account whose credentials the server holds. Keep it bound to 127.0.0.1, or put it on a network only you can reach (a VPN or Tailscale keeps strangers out; it does not stop the DNS rebinding case above, so set the allowlist as well) or behind a reverse proxy that authenticates. Adding CRONOMETER_READ_ONLY=1 narrows what a remote client can do, with the same caveat as above: the credentials themselves keep full access.

Available Tools

Food Log & Nutrition

ToolDescription
get_food_logIndividual food entries with macros + micros for a date range
get_daily_nutritionDaily macro totals (calories, protein, carbs, fat, fiber)
get_micronutrientsDetailed vitamin/mineral breakdown with period averages
export_raw_csvRaw CSV export for any data type (servings, exercises, biometrics, etc.)

Food Search & Diary Management

ToolDescription
search_foodsSearch the Cronometer food database
list_diary_groupsList this account's diary groups and the values diary_group accepts
get_food_detailsGet full nutrition info and serving measure IDs for a food
add_food_entryAdd a food entry to the diary
remove_food_entryRemove a food entry from the diary
copy_dayCopy all diary entries from one date to another
set_day_completeMark a diary day as complete or incomplete

Recurring Foods (Repeat Items)

ToolDescription
get_repeated_itemsList all recurring food entries
add_repeat_itemAdd a recurring food entry that auto-logs on selected days
delete_repeat_itemDelete a recurring food entry

Macro Targets & Templates

ToolDescription
get_macro_targetsGet daily macro targets (or full weekly schedule with target_date="all")
set_macro_targetsUpdate daily macro targets (partial updates supported)
list_macro_templatesList all saved macro target templates
create_macro_templateCreate a new saved macro target template
set_weekly_macro_scheduleAssign a template to days of the week as the recurring default

Fasting

ToolDescription
get_fasting_historyView all fasts or fasts within a date range
get_fasting_statsAggregate fasting statistics (total hours, longest, averages)
cancel_active_fastCancel an in-progress fast while preserving the recurring schedule
delete_fastDelete a fast entry

Biometrics

ToolDescription
get_recent_biometricsGet recently logged biometric entries
add_biometricLog weight (lbs), blood glucose (mg/dL), heart rate (bpm), or body fat (%)
remove_biometricRemove a biometric entry

Sync

ToolDescription
sync_cronometerDownload JSON exports + generate food-log.md to disk

Tool Parameters

All date parameters use YYYY-MM-DD format. Most tools default to today or the last 7 days when dates are omitted.

Key parameter patterns:

  • diary_group — a diary group name (case-insensitive) or a 0-based index. Cronometer Gold gives every account 8 diary group slots and lets you rename and enable them freely, so the names are account-specific and are not always Breakfast/Lunch/Dinner/Snacks. Call list_diary_groups to see yours. On an untouched account the four standard meals are indices 1–4 (index 0 is a slot that ships disabled). Unknown names, disabled groups, and out-of-range indices are rejected rather than silently defaulting — Cronometer itself accepts a bad index without complaint and the entry becomes unreachable.
  • days_of_week — "all", "weekdays", "weekends", or comma-separated day numbers (0=Sun through 6=Sat)
  • measure_id — pass 0 to use the universal gram-based measure (works for all food sources)
  • target_date — pass "all" on get_macro_targets to get the full weekly schedule

Sync Output

The sync_cronometer tool saves files to ~/.local/share/cronometer-mcp/ by default. Override with the CRONOMETER_DATA_DIR environment variable:

bash
export CRONOMETER_DATA_DIR="/path/to/your/project/data/cronometer"

Output files:

  • exports/servings_{start}_{end}.json
  • exports/daily_summary_{start}_{end}.json
  • exports/servings_latest.json
  • exports/daily_summary_latest.json
  • food-log.md

How It Works

Cronometer does not have a public API for individual users. This server uses the same GWT-RPC (Google Web Toolkit Remote Procedure Call) protocol that the Cronometer web app uses internally:

  1. Fetches the login page to get an anti-CSRF token
  2. POSTs credentials to authenticate
  3. Calls GWT-RPC authenticate to get a user ID
  4. Calls GWT-RPC generateAuthorizationToken for short-lived export tokens
  5. Downloads CSV exports using the token
  6. Calls GWT-RPC methods directly for diary edits, fasting, biometrics, macro targets, and repeat items

Session cookies are persisted to ~/.local/share/cronometer-mcp/.session_cookies so that subsequent invocations reuse the session without re-authenticating (Cronometer has aggressive login rate limiting).

GWT Magic Values

The GWT protocol uses a permutation hash and header value that are baked into each Cronometer web deploy. These values are hardcoded in the client and may break when Cronometer pushes a new build.

Current values (as of February 2026):

  • Permutation: 7B121DC5483BF272B1BC1916DA9FA963
  • Header: 2D6A926E3729946302DC68073CB0D550

If authentication starts failing with GWT errors, these values likely need updating. You can find the current values by:

  1. Opening Cronometer in your browser
  2. Going to Developer Tools → Network tab
  3. Looking for requests to cronometer.com/cronometer/app
  4. Checking the x-gwt-permutation header and the payload structure

You can override them via the CronometerClient constructor:

python
from cronometer_mcp import CronometerClient
client = CronometerClient(    gwt_permutation="NEW_PERMUTATION_HASH",    gwt_header="NEW_HEADER_VALUE",)

Python API

You can also use the client directly in Python:

python
from datetime import date, timedeltafrom cronometer_mcp import CronometerClient
client = CronometerClient()  # reads from env vars
# Get today's food logfoods = client.get_food_log()
# Get last 7 days of daily summariesstart = date.today() - timedelta(days=7)summaries = client.get_daily_summary(start)
# Raw CSV exportcsv_text = client.export_raw("exercises", start, date.today())
# Copy a day's diary entriesclient.copy_day(date(2026, 3, 1), date(2026, 3, 8))
# Add a recurring food entry (every weekday)client.add_repeat_item(    food_source_id=12345,    measure_id=0,        # universal gram-based measure    quantity=200,    food_name="Oatmeal",    diary_group=1,       # 0-based wire index; 1 == Breakfast on a default account    days_of_week=[1, 2, 3, 4, 5],)
# Diary groups are user-configured - check what this account actually hasfor g in client.diary_groups:    print(g["wire_index"], g["name"], g["enabled"])
# Log a biometricclient.add_biometric("weight", 218.5, date.today())

License

MIT

Source: README.md at commit 3157ff9

Tools

27

get_food_log

Get detailed food log with individual food entries and full nutrition. Returns every food entry with macros and micronutrients. Great for analyzing what was eaten and spotting nutrient gaps. Args: start_date: Start date as YYYY-MM-DD (defaults to today). end_date: End date as YYYY-MM-DD (defaults to today).

Parametersend_datestart_date

get_daily_nutrition

Get daily nutrition summary with macro totals per day. Returns calorie, protein, carb, fat, and fiber totals for each day. Use this for quick daily overviews and trend analysis. Args: start_date: Start date as YYYY-MM-DD (defaults to 7 days ago). end_date: End date as YYYY-MM-DD (defaults to today).

Parametersend_datestart_date

get_micronutrients

Get detailed micronutrient breakdown for meal planning. Shows vitamins, minerals, and other micronutrients per day with period averages. Use this to identify nutrient gaps and plan meals. Args: start_date: Start date as YYYY-MM-DD (defaults to 7 days ago). end_date: End date as YYYY-MM-DD (defaults to today).

Parametersend_datestart_date

export_raw_csv

Export raw CSV data from Cronometer for any data type. Useful when you need the full unprocessed export. Args: export_type: One of 'servings', 'daily_summary', 'exercises', 'biometrics', 'notes'. start_date: Start date as YYYY-MM-DD (defaults to today). end_date: End date as YYYY-MM-DD (defaults to today).

Parametersend_datestart_dateexport_typerequired

list_diary_groups

List this account's diary groups, with the values add_food_entry accepts. Diary group names are user-configured in Cronometer, so they are NOT always Breakfast/Lunch/Dinner/Snacks. Call this before assuming a name exists — an account may rename any slot or enable extra ones. Returns each group's wire_index (the 0-based value add_food_entry takes), its name, and whether it is enabled. Only enabled groups can be written to.

Takes no parameters.

search_foods

Search Cronometer's food database by name. Returns matching foods with their IDs and source information needed to add a serving (food_id, food_source_id, measure_id). Args: query: Food name or keyword to search for (e.g. "eggs", "chicken breast").

Parametersqueryrequired

get_food_details

Get detailed food information including available serving measures. Use this after search_foods to get the measure_id needed for add_food_entry. Returns all available serving sizes with their numeric IDs and gram weights. Args: food_source_id: Food source ID from search_foods results.

Parametersfood_source_idrequired

add_food_entry

Add a food entry to the Cronometer diary. Use search_foods to find food_id and food_source_id, then get_food_details for measure_id and weight_grams. For CRDB/custom foods, you can omit measure_id (defaults to a universal NCCDB measure that works for all food sources). When measure_id is omitted, quantity is set to weight_grams. Args: food_id: Numeric food ID from search_foods results. food_source_id: Food source ID from search_foods results. weight_grams: Weight of the serving in grams. date: Date to log the entry as YYYY-MM-DD (e.g. "2026-03-04"). measure_id: Measure/unit ID. Pass 0 (default) to use the universal measure that works for all food sources. quantity: Number of servings. Defaults to weight_grams when measure_id is 0 (universal gram-based measure). diary_group: Diary group name (case-insensitive) or 0-based index. Names are user-configured and are not always Breakfast/Lunch/Dinner/Snacks — call list_diary_groups to see this account's groups. Defaults to a time-of-day choice among enabled groups if omitted.

Parametersdaterequiredfood_idrequiredquantitymeasure_iddiary_groupweight_gramsrequiredfood_source_idrequired

remove_food_entry

Remove a food entry from the Cronometer diary. Args: serving_id: The serving ID returned by add_food_entry (e.g. "D80lp$").

Parametersserving_idrequired

get_macro_targets

Get current daily macro targets from Cronometer. Returns the effective macro targets (protein, fat, carbs, calories) and the template name for a specific date or all days of the week. A macro with no target set in Cronometer is null. Args: target_date: Date as YYYY-MM-DD to get targets for (defaults to today). Pass "all" to get the full weekly schedule.

Parameterstarget_date

set_macro_targets

Update daily macro targets in Cronometer. Reads current targets first, then updates only the provided values. Omitted values remain unchanged. Args: protein_grams: Protein target in grams. fat_grams: Fat target in grams. carbs_grams: Net carbs target in grams. calories: Calorie target in kcal. target_date: Date as YYYY-MM-DD (defaults to today). template_name: Template name (defaults to "Custom Targets").

Parameterscaloriesfat_gramscarbs_gramstarget_dateprotein_gramstemplate_name

set_weekly_macro_schedule

Set the recurring weekly macro schedule by assigning a template to days. This updates the DEFAULT schedule that applies to all future dates, not just a specific date override. First finds the template by name (from existing saved templates or from a recently created per-date template), then assigns it to the specified days of the week. Args: template_name: Name of a saved macro target template (e.g. "Retatrutide GI-Optimized", "Keto Rigorous"). days: Comma-separated day names or "all" (default). E.g. "Monday,Wednesday,Friday" or "all".

Parametersdaystemplate_namerequired

list_macro_templates

List all saved macro target templates in Cronometer. Returns template names, IDs, and their macro values. Use this to find the template_name for set_weekly_macro_schedule.

Takes no parameters.

create_macro_template

Create a new saved macro target template in Cronometer. Optionally assigns it to all days of the week as the recurring default. Args: template_name: Name for the new template (e.g. "Retatrutide GI-Optimized"). protein_grams: Protein target in grams. fat_grams: Fat target in grams. carbs_grams: Net carbs target in grams. calories: Calorie target in kcal. assign_to_all_days: If True, also set this as the recurring weekly schedule for all 7 days (default False).

Parameterscaloriesrequiredfat_gramsrequiredcarbs_gramsrequiredprotein_gramsrequiredtemplate_namerequiredassign_to_all_days

get_fasting_history

Get fasting history from Cronometer. Returns all fasts (or fasts within a date range) with their status, names, recurrence rules, and timestamps. Args: start_date: Start date as YYYY-MM-DD (omit for all history). end_date: End date as YYYY-MM-DD (omit for all history).

Parametersend_datestart_date

get_fasting_stats

Get aggregate fasting statistics from Cronometer. Returns total fasting hours, longest fast, 7-fast average, and completed fast count.

Takes no parameters.

delete_fast

Delete a fast entry from Cronometer. Use get_fasting_history first to find the fast_id. Args: fast_id: The fast ID to delete.

Parametersfast_idrequired

cancel_active_fast

Cancel an active (in-progress) fast while preserving the recurring schedule. Use get_fasting_history to find active fasts (is_active=true). Args: fast_id: The fast ID of the active fast to cancel.

Parametersfast_idrequired

get_recent_biometrics

Get the most recently logged biometric entries from Cronometer. Returns recent values for weight, blood glucose, blood pressure, heart rate, body fat, and other tracked biometrics.

Takes no parameters.

add_biometric

Add a biometric entry to Cronometer. Supported metric types: weight (lbs), blood_glucose (mg/dL), heart_rate (bpm), body_fat (%). Args: metric_type: One of 'weight', 'blood_glucose', 'heart_rate', 'body_fat'. value: The value in display units (lbs, mg/dL, bpm, %). entry_date: Date as YYYY-MM-DD.

Parametersvaluerequiredentry_daterequiredmetric_typerequired

remove_biometric

Remove a biometric entry from Cronometer. Use get_recent_biometrics to find biometric_id values. Args: biometric_id: The biometric entry ID (e.g. "BXW0DA").

Parametersbiometric_idrequired

sync_cronometer

Download Cronometer data and save locally as JSON + food-log.md. Downloads servings and daily summary data, saves JSON exports, and regenerates food-log.md. Output directory defaults to ~/.local/share/cronometer-mcp/ but can be overridden with the CRONOMETER_DATA_DIR environment variable. Args: start_date: Start date as YYYY-MM-DD (defaults to `days` ago). end_date: End date as YYYY-MM-DD (defaults to today). days: Number of days to look back if start_date not specified (default 14). diet_label: Optional diet label for the markdown header (e.g., "Keto Rigorous").

Parametersdaysend_datediet_labelstart_date

copy_day

Copy all diary entries from one date to another. Server-side operation that copies ALL entries (food, exercise, notes, biometrics) from source to destination. Additive — does not remove existing entries on the destination date. Args: source_date: Date to copy FROM as YYYY-MM-DD. destination_date: Date to copy TO as YYYY-MM-DD.

Parameterssource_daterequireddestination_daterequired

set_day_complete

Mark a diary day as complete or incomplete. Args: date: Date to mark as YYYY-MM-DD. complete: True to mark complete, False to mark incomplete.

Parametersdaterequiredcomplete

get_repeated_items

List all recurring food entries. Returns all repeat items configured in Cronometer, including their food name, quantity, measure, diary group, and which days of the week they repeat on.

Takes no parameters.

add_repeat_item

Add a recurring food entry that auto-logs on selected days. Quantity is in default servings for the food (e.g., for coffee where the default serving is 1 cup, quantity=12 means 12 cups). Use search_foods to find food_id and food_source_id. Args: food_id: Numeric food ID from search_foods results. food_source_id: Food source ID from search_foods results. quantity: Number of default servings. food_name: Display name for the food. diary_group: Diary group name (case-insensitive) or 0-based index. Names are user-configured — call list_diary_groups to see this account's groups. Defaults to a time-of-day choice among enabled groups if omitted. days_of_week: Comma-separated day numbers (0=Sun, 1=Mon, ..., 6=Sat), or "all" for every day (default), or "weekdays", or "weekends".

Parametersfood_idrequiredquantityrequiredfood_namerequireddiary_groupdays_of_weekfood_source_idrequired

delete_repeat_item

Delete a recurring food entry. Use get_repeated_items to find the repeat_item_id. Args: repeat_item_id: The ID of the repeat item to delete.

Parametersrepeat_item_idrequired

Version history

5
  1. v2.4.2LatestNov 1, 2026
  2. v2.4.1Oct 30, 2026
  3. v2.4.0Oct 25, 2026
  4. v2.3.0Oct 3, 2026
  5. v2.0.3Sep 16, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts