Cronometer

io.github.ekelly95由 GitHub 帳號 ekelly95 發布v1.0.2更新於 Oct 26, 2026

Your Cronometer diary, nutrition with honest coverage (missing is never zero), and safe writes.

已驗證STDIO僅桌面位置與生活資料與分析

概覽

AI 產生的概覽

非官方 MCP 伺服器,以你的 Cronometer 帳號登入,讓助理讀取飲食日記與營養資料,並在每次核准後記錄、修改或刪除項目。

可以做什麼
  • 讀取一天或最多 14 天的日記,含項目 id、目標、已攝取、剩餘與消耗能量
  • 取得附各營養素覆蓋情況的營養總計、Cronometer 評分,以及 31 項營養素雷達圖
  • 搜尋食物、查詢條碼,並讀取巨量目標、範本、斷食紀錄、身體指標與運動項目
  • 將飲食、運動、身體指標與筆記匯出為最長一年的 CSV,並分析已下載的匯出檔
  • 寫入日記、筆記、身體指標、運動、自訂食物、食譜、目標、斷食與重複食物,每次寫入都需核准
適用情境
適合在 Cronometer 記錄飲食與身體資料、希望助理回答攝取量、剩餘巨量或每週微量營養素缺口,或代為記錄與修正項目的人。僅供本人帳號的個人用途。
執行需求
以 stdio 本機程序透過 npx 執行,需要 Node.js 20 或更新版本。設定時會詢問 Cronometer 電子郵件、密碼、選用的雙因素驗證金鑰與日記時區;也可透過 CRONOMETER_USERNAME、CRONOMETER_PASSWORD 與 CRONOMETER_TOTP_SECRET 提供憑證,並將 CRONOMETER_LIVE_ENABLED 設為 1。需要連線至 cronometer.com 的網路。
安裝前請注意
Cronometer 沒有公開 API,此伺服器以你的身分使用其私有介面;屬非官方工具,介面變動時可能失效,Cronometer 也可能限制其判定為自動化的帳號。它需要你的帳號密碼與雙因素金鑰,會存入系統憑證儲存區或作為環境變數傳入。寫入工具會改動日記與帳號資料,但每次都會要求核准,刪除還需明確確認;設定 CRONOMETER_READ_ONLY=1 可完全停用寫入。不構成醫療建議。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Cronometer,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Cronometer MCP

[verify] [npm] [license: MIT]

An MCP server for your Cronometer account. Ask Claude (or any MCP client) what you ate, what is left for today, how your micronutrients look over the week — and have it log, edit or delete diary entries, with your approval each time.

  • The whole diary, with ids. Foods, exercise, notes and biometrics, each with the id the edit and delete tools need, plus the day's targets, what remains, and energy burned.
  • Honest nutrition. Totals are computed food by food. A nutrient a food doesn't report is counted as missing, not as zero — so "61 mg of magnesium" comes back as "at least 61 mg; only 4 of 12 foods report magnesium", which is what Cronometer's own total hides.
  • Safe writes. Every account-changing tool asks for approval, deletes need an explicit confirmation, a timed-out write is never retried, and a read-only mode removes writes entirely.
  • One command to set up, with your password kept in the operating system's credential store. Also runs as a Claude Desktop extension, or as a secure remote connector for claude.ai and the Claude phone apps.

[!IMPORTANT] Cronometer has no public API. This uses the same private interfaces as Cronometer's own app and website, signed in as you. It is unofficial: it can break whenever Cronometer changes them, and Cronometer could restrict an account it sees automated. It is not affiliated with or endorsed by Cronometer. See Risks.

Quick start

Requires Node.js 20 or later.

sh
npx @ekelly95/cronometer-mcp setup

Setup explains the risk and asks you to type ENABLE, then asks for your Cronometer email, password, an authenticator key if the account uses two-factor sign-in, and your diary timezone. It checks the sign-in before saving anything, stores the password in the Keychain (macOS), the Secret Service keyring (Linux) or DPAPI (Windows), and offers to add the server to Claude Code, Claude Desktop and Codex.

Restart your client and ask:

  • What did I eat yesterday, and how close was I to my targets?
  • How much protein do I have left today?
  • Log two large eggs for breakfast.
  • Which micronutrients were low this week — and which of those can't be trusted because foods didn't report them?
  • Show my nutrient radar for the last 7 days. (renders a chart; see /nutrient_radar)

npx @ekelly95/cronometer-mcp doctor checks the setup at any time.

Other ways to run it

Claude Desktop extension. Download cronometer-mcp.mcpb from the latest release and open it. Claude Desktop asks for your email and password and keeps them in your OS credential store.

Credentials in the client config (for clients without a keyring, or containers):

json
{  "mcpServers": {    "cronometer": {      "command": "npx",      "args": ["-y", "@ekelly95/cronometer-mcp"],      "env": {        "CRONOMETER_USERNAME": "[email protected]",        "CRONOMETER_PASSWORD": "…",        "CRONOMETER_LIVE_ENABLED": "1",        "CRONOMETER_TIMEZONE": "America/New_York"      }    }  }}

claude.ai and the phone apps. cronometer-mcp remote-setup configures a Streamable HTTP endpoint with its own single-user OAuth sign-in, run as a user service and published through a tunnel such as Tailscale Funnel. See docs/REMOTE.md.

VariableEffect
CRONOMETER_READ_ONLY=1Offer no tool that can change the account
CRONOMETER_TOTP_SECRETAuthenticator key for two-factor accounts (environment mode)
CRONOMETER_TIMEZONEDiary timezone; defaults to the saved setup, else the computer's
CRONOMETER_DATA_DIRWhere the setup, session caches and exports live

Tools

46 tools: 24 that read and 22 that write. Dates accept YYYY-MM-DD, today, yesterday or N days ago, resolved in the diary timezone.

Diary and nutrition

Tool
get_diaryOne day or up to 14: every entry with its id, targets, consumed, remaining, energy burned
get_daily_summaryNutrient totals with coverage per nutrient, and your Cronometer targets
get_nutrition_scoresCronometer's category scores, with its confidence per nutrient
nutrient_radar31 vitamins, minerals and amino acids against adult reference intakes, for a chart

Foods, targets, body

Tool
search_foods · get_food_details · lookup_barcodeFind foods, their measures and nutrients
get_macro_targets · list_macro_templatesTargets for a date, the weekly schedule, saved templates
get_fasting_history · get_fasting_statsFasts and fasting statistics
list_biometric_metrics · get_biometricsWeight, body fat, blood pressure… over time
search_activities · get_repeated_itemsExercise activity ids; foods that repeat automatically

Long ranges and downloaded exports

Tool
export_food_log · export_exercises · export_biometrics · export_notes · export_rawCronometer's CSV export, for ranges up to a year
list_exports · analyze_exportCoverage analysis of an export you downloaded, for months at a time

Writes — each asks for approval; ⚠ marks those that also need confirm: true

Tool
add_food_entry · update_food_entry · ⚠ remove_diary_entries · ⚠ copy_day · mark_day_completeThe food diary (delete works on any entry type)
add_note · update_note · add_biometric · add_exerciseNotes, measurements, exercise
add_custom_food · update_custom_food · ⚠ retire_custom_food · add_recipe · import_recipeCustom foods and recipes, including from free text
set_macro_targets · create_macro_template · ⚠ delete_macro_template · set_macro_schedule_dayTargets and the weekly schedule
⚠ delete_fast · ⚠ cancel_active_fast · add_repeat_item · ⚠ delete_repeat_itemFasts and repeated foods

A write that hasn't yet been verified against a live account says so in its description, and the model is told to read the result back. docs/PROTOCOL.md lists what each tool calls and what has been verified.

Missing is not zero

Cronometer stores each food's nutrients from whatever its source reports. A branded product's label might list eight nutrients; a lab-analysed whole food, ninety. When Cronometer totals a day, a nutrient a food doesn't report is added as zero, so the total looks complete when it isn't.

get_daily_summary keeps them apart. For a made-up day of 12 foods:

NutrientReported byResult
Energy12 of 12 foods2,410 kcal — a real total
Protein12 of 12172 g
Vitamin D9 of 12insufficient data — at least 520 IU
Magnesium4 of 12insufficient data — at least 61 mg

A nutrient becomes a number only when every food reports it (or the share you choose with coverage_threshold); otherwise you get a floor that says what it is. Days with nothing logged are listed rather than averaged in as zero. The same rule drives the radar, which draws an incomplete spoke as a dashed "at least" line and a nutrient nobody reported as no data at all. None of this diagnoses anything; it reports what was logged.

How it keeps the account safe

  • Approval on every write. Write tools carry MCP's destructive/read-only hints and anthropic/requiresUserInteraction, which makes Claude Code ask every time, under every permission mode. Deletes and other irreversible tools also require confirm: true.
  • No duplicate writes. A write that times out is reported as "outcome unknown — check the Cronometer app", never retried. A write is re-sent only when Cronometer refused it outright (401/403), which means it wasn't applied.
  • Ids, not guesses. Edits and deletes take ids from get_diary; the server refuses an id that isn't on that day.
  • Untrusted data stays data. Food names and notes come back inside a JSON-encoded fence the content cannot close, and the server tells the model to treat them as data.
  • Narrow network and storage. HTTPS to cronometer.com and mobile.cronometer.com only, size-capped and time-limited. Passwords live in the OS credential store; session caches are private files (mode 600) in a private directory; secrets are redacted from every error and log line.
  • Gentle on Cronometer. Calls run one at a time with a floor between them, and sessions are cached so the server rarely signs in.

Troubleshooting

SymptomFix
"Cronometer is not set up yet"Run npx @ekelly95/cronometer-mcp setup in a terminal
"two-factor authentication"Re-run setup and paste the authenticator's base32 key
"rate-limiting sign-ins"Wait a few minutes; the session cache prevents this in normal use
No password found in the keyring (Linux)Make sure GNOME Keyring or KDE Wallet is running and unlocked, and secret-tool is installed
Writes rejected as incompatibleCronometer changed something; check for a newer version of this package
Anything elsenpx @ekelly95/cronometer-mcp doctor

Risks

  • Unofficial interfaces. Cronometer publishes no API. Its terms limit use to personal, non-commercial purposes and allow access to be ended without notice. This tool is for use with your own account only.
  • It can break. The mobile API expects the app's version numbers, which can be updated with CRONOMETER_APP_VERSION/CRONOMETER_APP_BUILD; the web protocol's build hashes are discovered automatically. Either can still change in ways only a new release fixes.
  • Exports are rate-limited by Cronometer; the export_* tools are for long ranges, and get_diary covers anything up to 14 days without them.
  • Not medical advice. Reference intakes are population figures, not personal targets.

How it works

The server talks to Cronometer's mobile API (the Android app's JSON interface) for almost everything, and to the web app's GWT-RPC protocol only for CSV exports, macro templates, fast edits and repeated foods. docs/PROTOCOL.md has the details; docs/DATA_MODEL.md describes the CSV export schemas.

It builds on two MIT-licensed projects: cronometer-api-mcp by Randy Westergren, which established the mobile API, and cronometer-mcp by Paul Hoskins, which established the web protocol. See THIRD_PARTY_NOTICES.md.

Development

sh
npm cinpm run verify      # typecheck + the full offline test suitenpm start           # run the stdio server from source (after npm run build)

Tests are offline and use synthetic fixtures; nothing in the suite has Cronometer credentials. Live behaviour is checked by hand before a release on a throwaway diary date (docs/RELEASING.md). Changes are recorded in CHANGELOG.md.

License

MIT

來源:README.md,提交 07dba12

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v1.0.2最新Oct 18, 2026
  2. v1.0.1Oct 18, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分