MCP server for Cronometer nutrition data — pull food logs, macros, and micronutrients via the Model Context Protocol
Project description
cronometer-mcp
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.) |
search_foods |
Search the Cronometer food database |
get_food_details |
Get full nutrition info and 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 |
get_macro_targets |
Get current daily macro targets (or weekly schedule with target_date="all") |
set_macro_targets |
Update daily macro targets (partial updates supported) |
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 todayget_daily_nutrition(start_date?, end_date?)— defaults to last 7 daysget_micronutrients(start_date?, end_date?)— defaults to last 7 daysexport_raw_csv(export_type, start_date?, end_date?)— type is one of:servings,daily_summary,exercises,biometrics,notesget_macro_targets(target_date?)— defaults to today; pass"all"for weekly scheduleset_macro_targets(protein_grams?, fat_grams?, carbs_grams?, calories?, target_date?, template_name?)— reads current targets first, merges provided valuessync_cronometer(start_date?, end_date?, days?, diet_label?)—daysdefaults to 14;diet_labelis 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}.jsonexports/daily_summary_{start}_{end}.jsonexports/servings_latest.jsonexports/daily_summary_latest.jsonfood-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:
- Fetches the login page to get an anti-CSRF token
- POSTs credentials to authenticate
- Calls GWT-RPC
authenticateto get a user ID - Calls GWT-RPC
generateAuthorizationTokenfor short-lived export tokens - 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:
- Opening Cronometer in your browser
- Going to Developer Tools → Network tab
- Looking for requests to
cronometer.com/cronometer/app - Checking the
x-gwt-permutationheader 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cronometer_mcp-2.0.0.tar.gz.
File metadata
- Download URL: cronometer_mcp-2.0.0.tar.gz
- Upload date:
- Size: 50.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
162ac66d47a6769d7b196794482b230c1dc99c897b7fd44ee9a8ee2f16523d2c
|
|
| MD5 |
5f65acbd459549697b93f5bfb26b55d5
|
|
| BLAKE2b-256 |
deb7af72c945d1acd17d4a5b1710576850bece8e899f24c8c6c5557f05b678a9
|
Provenance
The following attestation bundles were made for cronometer_mcp-2.0.0.tar.gz:
Publisher:
publish.yml on cphoskins/cronometer-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cronometer_mcp-2.0.0.tar.gz -
Subject digest:
162ac66d47a6769d7b196794482b230c1dc99c897b7fd44ee9a8ee2f16523d2c - Sigstore transparency entry: 1059825036
- Sigstore integration time:
-
Permalink:
cphoskins/cronometer-mcp@849aee7c3d2ce5265ea835a079be4b8597ef4b1c -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/cphoskins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@849aee7c3d2ce5265ea835a079be4b8597ef4b1c -
Trigger Event:
release
-
Statement type:
File details
Details for the file cronometer_mcp-2.0.0-py3-none-any.whl.
File metadata
- Download URL: cronometer_mcp-2.0.0-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6918ce606095a1fb2be6459d428a8fe2f9f74590c141a631faaa140f138ddf1
|
|
| MD5 |
3eb175dfe6224191e76bf3d55ceba037
|
|
| BLAKE2b-256 |
faa42197842460782041026409e8c622c1593fb7adeea0198650e8fce844ee9c
|
Provenance
The following attestation bundles were made for cronometer_mcp-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on cphoskins/cronometer-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cronometer_mcp-2.0.0-py3-none-any.whl -
Subject digest:
a6918ce606095a1fb2be6459d428a8fe2f9f74590c141a631faaa140f138ddf1 - Sigstore transparency entry: 1059825040
- Sigstore integration time:
-
Permalink:
cphoskins/cronometer-mcp@849aee7c3d2ce5265ea835a079be4b8597ef4b1c -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/cphoskins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@849aee7c3d2ce5265ea835a079be4b8597ef4b1c -
Trigger Event:
release
-
Statement type: