cronometer-mcp 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/PKG-INFO +81 -12
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/README.md +80 -11
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/cronometer_mcp/__init__.py +1 -1
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/cronometer_mcp/client.py +2 -2
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/pyproject.toml +1 -1
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/server.json +3 -3
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/.github/workflows/publish.yml +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/.gitignore +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/LICENSE +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/RESEARCH-copy-repeat-gwt-rpc.md +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/cronometer_mcp/markdown.py +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/cronometer_mcp/server.py +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/release.sh +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/tests/__init__.py +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/tests/test_client.py +0 -0
- {cronometer_mcp-2.0.0 → cronometer_mcp-2.0.2}/tests/test_markdown.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cronometer-mcp
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: MCP server for Cronometer nutrition data — pull food logs, macros, and micronutrients via the Model Context Protocol
|
|
5
5
|
Project-URL: Homepage, https://github.com/cphoskins/cronometer-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/cphoskins/cronometer-mcp
|
|
@@ -26,7 +26,7 @@ Description-Content-Type: text/markdown
|
|
|
26
26
|
|
|
27
27
|
<!-- mcp-name: io.github.cphoskins/cronometer -->
|
|
28
28
|
|
|
29
|
-
An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that provides access to your [Cronometer](https://cronometer.com/) nutrition data. Pull detailed food logs, daily macro/micro summaries, and
|
|
29
|
+
An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that provides access to your [Cronometer](https://cronometer.com/) 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.
|
|
30
30
|
|
|
31
31
|
**Requires a Cronometer Gold account** (or any paid tier that supports web login).
|
|
32
32
|
|
|
@@ -35,6 +35,11 @@ An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that
|
|
|
35
35
|
- **Food log** — individual food entries with full macro and micronutrient breakdown
|
|
36
36
|
- **Daily nutrition** — daily calorie, protein, carb, fat, and fiber totals
|
|
37
37
|
- **Micronutrients** — detailed vitamin/mineral breakdown with period averages
|
|
38
|
+
- **Diary management** — add/remove food entries, copy entire days, mark days complete
|
|
39
|
+
- **Recurring foods** — create, list, and delete repeat items that auto-log on selected days
|
|
40
|
+
- **Macro targets** — read/write daily targets, create templates, set weekly schedules
|
|
41
|
+
- **Fasting** — view history and stats, cancel or delete fasts
|
|
42
|
+
- **Biometrics** — log and remove weight, blood glucose, heart rate, body fat
|
|
38
43
|
- **Raw CSV export** — servings, daily summary, exercises, biometrics, or notes
|
|
39
44
|
- **Sync to disk** — download JSON exports and generate a markdown food log
|
|
40
45
|
|
|
@@ -108,31 +113,76 @@ If you installed from source with `pip install -e .`, you can also use the full
|
|
|
108
113
|
|
|
109
114
|
## Available Tools
|
|
110
115
|
|
|
116
|
+
### Food Log & Nutrition
|
|
117
|
+
|
|
111
118
|
| Tool | Description |
|
|
112
119
|
|------|-------------|
|
|
113
120
|
| `get_food_log` | Individual food entries with macros + micros for a date range |
|
|
114
121
|
| `get_daily_nutrition` | Daily macro totals (calories, protein, carbs, fat, fiber) |
|
|
115
122
|
| `get_micronutrients` | Detailed vitamin/mineral breakdown with period averages |
|
|
116
123
|
| `export_raw_csv` | Raw CSV export for any data type (servings, exercises, biometrics, etc.) |
|
|
124
|
+
|
|
125
|
+
### Food Search & Diary Management
|
|
126
|
+
|
|
127
|
+
| Tool | Description |
|
|
128
|
+
|------|-------------|
|
|
117
129
|
| `search_foods` | Search the Cronometer food database |
|
|
118
|
-
| `get_food_details` | Get full nutrition info and measure IDs for a food |
|
|
130
|
+
| `get_food_details` | Get full nutrition info and serving measure IDs for a food |
|
|
119
131
|
| `add_food_entry` | Add a food entry to the diary |
|
|
120
132
|
| `remove_food_entry` | Remove a food entry from the diary |
|
|
121
|
-
| `
|
|
133
|
+
| `copy_day` | Copy all diary entries from one date to another |
|
|
134
|
+
| `set_day_complete` | Mark a diary day as complete or incomplete |
|
|
135
|
+
|
|
136
|
+
### Recurring Foods (Repeat Items)
|
|
137
|
+
|
|
138
|
+
| Tool | Description |
|
|
139
|
+
|------|-------------|
|
|
140
|
+
| `get_repeated_items` | List all recurring food entries |
|
|
141
|
+
| `add_repeat_item` | Add a recurring food entry that auto-logs on selected days |
|
|
142
|
+
| `delete_repeat_item` | Delete a recurring food entry |
|
|
143
|
+
|
|
144
|
+
### Macro Targets & Templates
|
|
145
|
+
|
|
146
|
+
| Tool | Description |
|
|
147
|
+
|------|-------------|
|
|
148
|
+
| `get_macro_targets` | Get daily macro targets (or full weekly schedule with `target_date="all"`) |
|
|
122
149
|
| `set_macro_targets` | Update daily macro targets (partial updates supported) |
|
|
150
|
+
| `list_macro_templates` | List all saved macro target templates |
|
|
151
|
+
| `create_macro_template` | Create a new saved macro target template |
|
|
152
|
+
| `set_weekly_macro_schedule` | Assign a template to days of the week as the recurring default |
|
|
153
|
+
|
|
154
|
+
### Fasting
|
|
155
|
+
|
|
156
|
+
| Tool | Description |
|
|
157
|
+
|------|-------------|
|
|
158
|
+
| `get_fasting_history` | View all fasts or fasts within a date range |
|
|
159
|
+
| `get_fasting_stats` | Aggregate fasting statistics (total hours, longest, averages) |
|
|
160
|
+
| `cancel_active_fast` | Cancel an in-progress fast while preserving the recurring schedule |
|
|
161
|
+
| `delete_fast` | Delete a fast entry |
|
|
162
|
+
|
|
163
|
+
### Biometrics
|
|
164
|
+
|
|
165
|
+
| Tool | Description |
|
|
166
|
+
|------|-------------|
|
|
167
|
+
| `get_recent_biometrics` | Get recently logged biometric entries |
|
|
168
|
+
| `add_biometric` | Log weight (lbs), blood glucose (mg/dL), heart rate (bpm), or body fat (%) |
|
|
169
|
+
| `remove_biometric` | Remove a biometric entry |
|
|
170
|
+
|
|
171
|
+
### Sync
|
|
172
|
+
|
|
173
|
+
| Tool | Description |
|
|
174
|
+
|------|-------------|
|
|
123
175
|
| `sync_cronometer` | Download JSON exports + generate food-log.md to disk |
|
|
124
176
|
|
|
125
177
|
### Tool Parameters
|
|
126
178
|
|
|
127
|
-
All date parameters use `YYYY-MM-DD` format
|
|
179
|
+
All date parameters use `YYYY-MM-DD` format. Most tools default to today or the last 7 days when dates are omitted.
|
|
128
180
|
|
|
129
|
-
|
|
130
|
-
- `
|
|
131
|
-
- `
|
|
132
|
-
- `
|
|
133
|
-
- `
|
|
134
|
-
- `set_macro_targets(protein_grams?, fat_grams?, carbs_grams?, calories?, target_date?, template_name?)` — reads current targets first, merges provided values
|
|
135
|
-
- `sync_cronometer(start_date?, end_date?, days?, diet_label?)` — `days` defaults to 14; `diet_label` is optional text for the markdown header
|
|
181
|
+
Key parameter patterns:
|
|
182
|
+
- `diary_group` — one of `"Breakfast"`, `"Lunch"`, `"Dinner"`, `"Snacks"` (case-insensitive)
|
|
183
|
+
- `days_of_week` — `"all"`, `"weekdays"`, `"weekends"`, or comma-separated day numbers (`0`=Sun through `6`=Sat)
|
|
184
|
+
- `measure_id` — pass `0` to use the universal gram-based measure (works for all food sources)
|
|
185
|
+
- `target_date` — pass `"all"` on `get_macro_targets` to get the full weekly schedule
|
|
136
186
|
|
|
137
187
|
### Sync Output
|
|
138
188
|
|
|
@@ -158,6 +208,9 @@ Cronometer does not have a public API for individual users. This server uses the
|
|
|
158
208
|
3. Calls GWT-RPC `authenticate` to get a user ID
|
|
159
209
|
4. Calls GWT-RPC `generateAuthorizationToken` for short-lived export tokens
|
|
160
210
|
5. Downloads CSV exports using the token
|
|
211
|
+
6. Calls GWT-RPC methods directly for diary edits, fasting, biometrics, macro targets, and repeat items
|
|
212
|
+
|
|
213
|
+
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).
|
|
161
214
|
|
|
162
215
|
### GWT Magic Values
|
|
163
216
|
|
|
@@ -204,6 +257,22 @@ summaries = client.get_daily_summary(start)
|
|
|
204
257
|
|
|
205
258
|
# Raw CSV export
|
|
206
259
|
csv_text = client.export_raw("exercises", start, date.today())
|
|
260
|
+
|
|
261
|
+
# Copy a day's diary entries
|
|
262
|
+
client.copy_day(date(2026, 3, 1), date(2026, 3, 8))
|
|
263
|
+
|
|
264
|
+
# Add a recurring food entry (every weekday)
|
|
265
|
+
client.add_repeat_item(
|
|
266
|
+
food_source_id=12345,
|
|
267
|
+
measure_id=0, # universal gram-based measure
|
|
268
|
+
quantity=200,
|
|
269
|
+
food_name="Oatmeal",
|
|
270
|
+
diary_group=1, # Breakfast
|
|
271
|
+
days_of_week=[1, 2, 3, 4, 5],
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
# Log a biometric
|
|
275
|
+
client.add_biometric("weight", 218.5, date.today())
|
|
207
276
|
```
|
|
208
277
|
|
|
209
278
|
## License
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- mcp-name: io.github.cphoskins/cronometer -->
|
|
4
4
|
|
|
5
|
-
An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that provides access to your [Cronometer](https://cronometer.com/) nutrition data. Pull detailed food logs, daily macro/micro summaries, and
|
|
5
|
+
An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that provides access to your [Cronometer](https://cronometer.com/) 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.
|
|
6
6
|
|
|
7
7
|
**Requires a Cronometer Gold account** (or any paid tier that supports web login).
|
|
8
8
|
|
|
@@ -11,6 +11,11 @@ An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that
|
|
|
11
11
|
- **Food log** — individual food entries with full macro and micronutrient breakdown
|
|
12
12
|
- **Daily nutrition** — daily calorie, protein, carb, fat, and fiber totals
|
|
13
13
|
- **Micronutrients** — detailed vitamin/mineral breakdown with period averages
|
|
14
|
+
- **Diary management** — add/remove food entries, copy entire days, mark days complete
|
|
15
|
+
- **Recurring foods** — create, list, and delete repeat items that auto-log on selected days
|
|
16
|
+
- **Macro targets** — read/write daily targets, create templates, set weekly schedules
|
|
17
|
+
- **Fasting** — view history and stats, cancel or delete fasts
|
|
18
|
+
- **Biometrics** — log and remove weight, blood glucose, heart rate, body fat
|
|
14
19
|
- **Raw CSV export** — servings, daily summary, exercises, biometrics, or notes
|
|
15
20
|
- **Sync to disk** — download JSON exports and generate a markdown food log
|
|
16
21
|
|
|
@@ -84,31 +89,76 @@ If you installed from source with `pip install -e .`, you can also use the full
|
|
|
84
89
|
|
|
85
90
|
## Available Tools
|
|
86
91
|
|
|
92
|
+
### Food Log & Nutrition
|
|
93
|
+
|
|
87
94
|
| Tool | Description |
|
|
88
95
|
|------|-------------|
|
|
89
96
|
| `get_food_log` | Individual food entries with macros + micros for a date range |
|
|
90
97
|
| `get_daily_nutrition` | Daily macro totals (calories, protein, carbs, fat, fiber) |
|
|
91
98
|
| `get_micronutrients` | Detailed vitamin/mineral breakdown with period averages |
|
|
92
99
|
| `export_raw_csv` | Raw CSV export for any data type (servings, exercises, biometrics, etc.) |
|
|
100
|
+
|
|
101
|
+
### Food Search & Diary Management
|
|
102
|
+
|
|
103
|
+
| Tool | Description |
|
|
104
|
+
|------|-------------|
|
|
93
105
|
| `search_foods` | Search the Cronometer food database |
|
|
94
|
-
| `get_food_details` | Get full nutrition info and measure IDs for a food |
|
|
106
|
+
| `get_food_details` | Get full nutrition info and serving measure IDs for a food |
|
|
95
107
|
| `add_food_entry` | Add a food entry to the diary |
|
|
96
108
|
| `remove_food_entry` | Remove a food entry from the diary |
|
|
97
|
-
| `
|
|
109
|
+
| `copy_day` | Copy all diary entries from one date to another |
|
|
110
|
+
| `set_day_complete` | Mark a diary day as complete or incomplete |
|
|
111
|
+
|
|
112
|
+
### Recurring Foods (Repeat Items)
|
|
113
|
+
|
|
114
|
+
| Tool | Description |
|
|
115
|
+
|------|-------------|
|
|
116
|
+
| `get_repeated_items` | List all recurring food entries |
|
|
117
|
+
| `add_repeat_item` | Add a recurring food entry that auto-logs on selected days |
|
|
118
|
+
| `delete_repeat_item` | Delete a recurring food entry |
|
|
119
|
+
|
|
120
|
+
### Macro Targets & Templates
|
|
121
|
+
|
|
122
|
+
| Tool | Description |
|
|
123
|
+
|------|-------------|
|
|
124
|
+
| `get_macro_targets` | Get daily macro targets (or full weekly schedule with `target_date="all"`) |
|
|
98
125
|
| `set_macro_targets` | Update daily macro targets (partial updates supported) |
|
|
126
|
+
| `list_macro_templates` | List all saved macro target templates |
|
|
127
|
+
| `create_macro_template` | Create a new saved macro target template |
|
|
128
|
+
| `set_weekly_macro_schedule` | Assign a template to days of the week as the recurring default |
|
|
129
|
+
|
|
130
|
+
### Fasting
|
|
131
|
+
|
|
132
|
+
| Tool | Description |
|
|
133
|
+
|------|-------------|
|
|
134
|
+
| `get_fasting_history` | View all fasts or fasts within a date range |
|
|
135
|
+
| `get_fasting_stats` | Aggregate fasting statistics (total hours, longest, averages) |
|
|
136
|
+
| `cancel_active_fast` | Cancel an in-progress fast while preserving the recurring schedule |
|
|
137
|
+
| `delete_fast` | Delete a fast entry |
|
|
138
|
+
|
|
139
|
+
### Biometrics
|
|
140
|
+
|
|
141
|
+
| Tool | Description |
|
|
142
|
+
|------|-------------|
|
|
143
|
+
| `get_recent_biometrics` | Get recently logged biometric entries |
|
|
144
|
+
| `add_biometric` | Log weight (lbs), blood glucose (mg/dL), heart rate (bpm), or body fat (%) |
|
|
145
|
+
| `remove_biometric` | Remove a biometric entry |
|
|
146
|
+
|
|
147
|
+
### Sync
|
|
148
|
+
|
|
149
|
+
| Tool | Description |
|
|
150
|
+
|------|-------------|
|
|
99
151
|
| `sync_cronometer` | Download JSON exports + generate food-log.md to disk |
|
|
100
152
|
|
|
101
153
|
### Tool Parameters
|
|
102
154
|
|
|
103
|
-
All date parameters use `YYYY-MM-DD` format
|
|
155
|
+
All date parameters use `YYYY-MM-DD` format. Most tools default to today or the last 7 days when dates are omitted.
|
|
104
156
|
|
|
105
|
-
|
|
106
|
-
- `
|
|
107
|
-
- `
|
|
108
|
-
- `
|
|
109
|
-
- `
|
|
110
|
-
- `set_macro_targets(protein_grams?, fat_grams?, carbs_grams?, calories?, target_date?, template_name?)` — reads current targets first, merges provided values
|
|
111
|
-
- `sync_cronometer(start_date?, end_date?, days?, diet_label?)` — `days` defaults to 14; `diet_label` is optional text for the markdown header
|
|
157
|
+
Key parameter patterns:
|
|
158
|
+
- `diary_group` — one of `"Breakfast"`, `"Lunch"`, `"Dinner"`, `"Snacks"` (case-insensitive)
|
|
159
|
+
- `days_of_week` — `"all"`, `"weekdays"`, `"weekends"`, or comma-separated day numbers (`0`=Sun through `6`=Sat)
|
|
160
|
+
- `measure_id` — pass `0` to use the universal gram-based measure (works for all food sources)
|
|
161
|
+
- `target_date` — pass `"all"` on `get_macro_targets` to get the full weekly schedule
|
|
112
162
|
|
|
113
163
|
### Sync Output
|
|
114
164
|
|
|
@@ -134,6 +184,9 @@ Cronometer does not have a public API for individual users. This server uses the
|
|
|
134
184
|
3. Calls GWT-RPC `authenticate` to get a user ID
|
|
135
185
|
4. Calls GWT-RPC `generateAuthorizationToken` for short-lived export tokens
|
|
136
186
|
5. Downloads CSV exports using the token
|
|
187
|
+
6. Calls GWT-RPC methods directly for diary edits, fasting, biometrics, macro targets, and repeat items
|
|
188
|
+
|
|
189
|
+
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).
|
|
137
190
|
|
|
138
191
|
### GWT Magic Values
|
|
139
192
|
|
|
@@ -180,6 +233,22 @@ summaries = client.get_daily_summary(start)
|
|
|
180
233
|
|
|
181
234
|
# Raw CSV export
|
|
182
235
|
csv_text = client.export_raw("exercises", start, date.today())
|
|
236
|
+
|
|
237
|
+
# Copy a day's diary entries
|
|
238
|
+
client.copy_day(date(2026, 3, 1), date(2026, 3, 8))
|
|
239
|
+
|
|
240
|
+
# Add a recurring food entry (every weekday)
|
|
241
|
+
client.add_repeat_item(
|
|
242
|
+
food_source_id=12345,
|
|
243
|
+
measure_id=0, # universal gram-based measure
|
|
244
|
+
quantity=200,
|
|
245
|
+
food_name="Oatmeal",
|
|
246
|
+
diary_group=1, # Breakfast
|
|
247
|
+
days_of_week=[1, 2, 3, 4, 5],
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
# Log a biometric
|
|
251
|
+
client.add_biometric("weight", 218.5, date.today())
|
|
183
252
|
```
|
|
184
253
|
|
|
185
254
|
## License
|
|
@@ -2401,8 +2401,8 @@ class CronometerClient:
|
|
|
2401
2401
|
if days_of_week is None:
|
|
2402
2402
|
days_of_week = [0, 1, 2, 3, 4, 5, 6]
|
|
2403
2403
|
|
|
2404
|
-
# Build day entries: "10|{day}
|
|
2405
|
-
day_entries = "".join(f"10|{d}
|
|
2404
|
+
# Build day entries: "10|{day}" for each day, joined by "|"
|
|
2405
|
+
day_entries = "|".join(f"10|{d}" for d in days_of_week)
|
|
2406
2406
|
|
|
2407
2407
|
# Format quantity
|
|
2408
2408
|
qty_str = str(int(quantity)) if quantity == int(quantity) else str(quantity)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cronometer-mcp"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.2"
|
|
8
8
|
description = "MCP server for Cronometer nutrition data — pull food logs, macros, and micronutrients via the Model Context Protocol"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.cphoskins/cronometer",
|
|
4
|
-
"description": "MCP server for Cronometer — food logs, macros, and
|
|
4
|
+
"description": "MCP server for Cronometer — food logs, macros, fasting, biometrics, and recurring foods",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/cphoskins/cronometer-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.0.
|
|
9
|
+
"version": "2.0.2",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "pypi",
|
|
13
13
|
"identifier": "cronometer-mcp",
|
|
14
|
-
"version": "2.0.
|
|
14
|
+
"version": "2.0.2",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|