cronometer-mcp

cronometer-mcp

An MCP server that provides access to Cronometer nutrition data, enabling users to pull food logs, macro and micronutrient summaries, and biometric data into Claude or Cursor. It supports daily nutrition tracking and raw CSV exports by interfacing with the Cronometer web protocol.

Category
Visit Server

README

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, and raw CSV exports directly into 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
  • 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

Tool Description
get_food_log Individual food entries with macros + 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.)
sync_cronometer Download JSON exports + generate food-log.md to disk

Tool Parameters

All date parameters use YYYY-MM-DD format:

  • get_food_log(start_date?, end_date?) — defaults to today
  • get_daily_nutrition(start_date?, end_date?) — defaults to last 7 days
  • get_micronutrients(start_date?, end_date?) — defaults to last 7 days
  • export_raw_csv(export_type, start_date?, end_date?) — type is one of: servings, daily_summary, exercises, biometrics, notes
  • sync_cronometer(start_date?, end_date?, days?, diet_label?)days defaults to 14; diet_label is optional text for the markdown header

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

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())

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured