PluginBench
MCP Server
Maintained
MIT

io.github.cphoskins/cronometer MCP Server

io.github.cphoskins/cronometer

Access your Cronometer nutrition data—food logs, macros, fasting, and biometrics—directly from Claude and Cursor.

What is the io.github.cphoskins/cronometer MCP server?

The Cronometer MCP server provides access to your Cronometer nutrition tracking account, enabling you to pull food logs, daily macro/micronutrient summaries, manage diary entries, track fasting, log biometrics, and manage recurring foods. It requires a Cronometer Gold account and uses the GWT-RPC protocol that powers the Cronometer web app.

This server bridges Claude and Cursor to your Cronometer nutrition data. You can query detailed food logs with full macro and micronutrient breakdowns, view daily calorie and nutrient totals, manage diary entries, track fasting history and stats, log biometrics like weight and blood glucose, create recurring food entries, set macro targets and templates, and export raw CSV data. It's useful for nutrition analysis, meal planning automation, biometric tracking, and generating food-log reports without leaving your AI assistant.

How to install io.github.cphoskins/cronometer

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Environment / auth
  • CRONOMETER_USERNAME
    required

    Your Cronometer account email

  • CRONOMETER_PASSWORD
    required
    secret

    Your Cronometer account password

  • CRONOMETER_DATA_DIR

    Directory for sync output (defaults to ~/.local/share/cronometer-mcp/)

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "cronometer": {
      "command": "uvx",
      "args": [
        "cronometer-mcp"
      ],
      "env": {
        "CRONOMETER_USERNAME": "<YOUR_CRONOMETER_USERNAME>",
        "CRONOMETER_PASSWORD": "<YOUR_CRONOMETER_PASSWORD>",
        "CRONOMETER_DATA_DIR": "<YOUR_CRONOMETER_DATA_DIR>"
      }
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • get_food_log — Individual food entries with macros and micros for a date range
  • get_daily_nutrition — Daily macro totals (calories, protein, carbs, fat, fiber)
  • get_micronutrients — Detailed vitamin/mineral breakdown with period averages
  • export_raw_csv — Raw CSV export for any data type (servings, exercises, biometrics, etc.)
  • search_foods — Search the Cronometer food database
  • list_diary_groups — List this account's diary groups and the values diary_group accepts
  • get_food_details — Get full nutrition info and serving measure IDs for a food
  • add_food_entry — Add a food entry to the diary
  • remove_food_entry — Remove a food entry from the diary
  • copy_day — Copy all diary entries from one date to another
  • set_day_complete — Mark a diary day as complete or incomplete
  • get_repeated_items — List all recurring food entries
  • add_repeat_item — Add a recurring food entry that auto-logs on selected days
  • delete_repeat_item — Delete a recurring food entry
  • get_macro_targets — Get daily macro targets or full weekly schedule
  • set_macro_targets — Update daily macro targets (partial updates supported)
  • list_macro_templates — List all saved macro target templates
  • create_macro_template — Create a new saved macro target template
  • set_weekly_macro_schedule — Assign a template to days of the week as the recurring default
  • get_fasting_history — View all fasts or fasts within a date range

Use cases

  • Query your food log and daily nutrition summaries to analyze eating patterns and macro intake
  • Log biometrics like weight, blood glucose, and heart rate directly from Claude without opening Cronometer
  • Create and manage recurring food entries that auto-log on specific days of the week
  • Track fasting history and statistics, or cancel active fasts programmatically
  • Export raw CSV data for custom analysis or integration with other tools

io.github.cphoskins/cronometer MCP server FAQ

What is the Cronometer MCP server?

It's an MCP server that connects Claude, Cursor, or other MCP clients to your Cronometer nutrition account. You can query food logs, macros, micronutrients, fasting data, biometrics, and manage diary entries and recurring foods.

Do I need a paid Cronometer account?

Yes, you need a Cronometer Gold account (or any paid tier that supports web login). Free accounts are not supported.

How do I install it in Claude Desktop or Cursor?

Install via pip (pip install cronometer-mcp), set CRONOMETER_USERNAME and CRONOMETER_PASSWORD environment variables, then add the server to your .mcp.json or claude_desktop_config.json with the cronometer-mcp command.

What authentication is required?

You must provide your Cronometer email and password as environment variables (CRONOMETER_USERNAME and CRONOMETER_PASSWORD). The server uses the same GWT-RPC protocol as the Cronometer web app and persists session cookies to avoid repeated logins.

Is it free to use?

The MCP server itself is free and open-source (MIT license), but you must have a paid Cronometer account to use it.

What happens if Cronometer updates their web app?

The server uses hardcoded GWT magic values (permutation hash and header) that may break when Cronometer deploys a new build. You can update these values manually or override them in the CronometerClient constructor if needed.

README (reference)

Source of truth, from the repository.

cronometer-mcp

<!-- mcp-name: io.github.cphoskins/cronometer -->

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

pip install cronometer-mcp

Or install from source:

git clone https://github.com/cphoskins/cronometer-mcp.git
cd cronometer-mcp
pip install -e .

2. Set credentials

export CRONOMETER_USERNAME="your@email.com"
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)

{
  "mcpServers": {
    "cronometer": {
      "command": "cronometer-mcp",
      "env": {
        "CRONOMETER_USERNAME": "your@email.com",
        "CRONOMETER_PASSWORD": "your-password"
      }
    }
  }
}

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "cronometer": {
      "command": "cronometer-mcp",
      "env": {
        "CRONOMETER_USERNAME": "your@email.com",
        "CRONOMETER_PASSWORD": "your-password"
      }
    }
  }
}

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

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

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:

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:

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:

from datetime import date, timedelta
from cronometer_mcp import CronometerClient

client = CronometerClient()  # reads from env vars

# Get today's food log
foods = client.get_food_log()

# Get last 7 days of daily summaries
start = date.today() - timedelta(days=7)
summaries = client.get_daily_summary(start)

# Raw CSV export
csv_text = client.export_raw("exercises", start, date.today())

# Copy a day's diary entries
client.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 has
for g in client.diary_groups:
    print(g["wire_index"], g["name"], g["enabled"])

# Log a biometric
client.add_biometric("weight", 218.5, date.today())

License

MIT

Related MCP servers

MCP server for Amazon Ads API - manage campaigns, keywords, bids, and performance reports

3
TypeScript
View repository →
RArag-rat logo

rag-rat

Active

Repository intelligence, code graph, and source-anchored memories for coding agents.

15
Rust
MIT
View repository →
CQcQnce MCP logo

cQnce MCP

Active

Add human approval to AI agent workflows through cQnce authorization tools.

1
TypeScript
MIT
View repository →

Search, manage, and monitor Elasticsearch/OpenSearch clusters directly from your AI assistant.

292
Python
Apache-2.0
View repository →
OROrchestrator logo

Let one coding agent consult another—Claude Code, Codex, OpenCode, Copilot, or Antigravity—without leaving your terminal.

10
Python
MIT
View repository →

Consolidate multiple MCP servers into one connection with tool discovery, namespacing, and execution policies.

10
TypeScript
MIT
View repository →