Recipe Nutrition Calculator

io.github.theluckystrike由 GitHub 账号 theluckystrike 发布v1.0.0更新于 Nov 3, 2026

根据配料行计算食谱营养:采用USDA FoodData Central数值,按每份计,遵循FDA取整规则。

AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。

原文描述

Recipe nutrition from ingredient lines: USDA FoodData Central values, per serving, FDA rounding.

发布方自己的服务:Calculator Tools MCP

已验证Streamable HTTP可网页运行位置与生活

概览

Recipe Nutrition Calculator 的托管 MCP 服务(recipe-nutrition-calculator-mcp.lipmichal.workers.dev);无需登录;Streamable HTTP;4 个工具。

暂无 AI 概览:以下信息来自注册中心条目和服务本身。

端点
recipe-nutrition-calculator-mcp.lipmichal.workers.dev
最近检查

安装

在 SourceWeft 中

  1. 打开 控制台中的 Recipe Nutrition Calculator,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.theluckystrike%2Frecipe-nutrition-calculator-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "recipe-nutrition-calculator": {
      "type": "http",
      "url": "https://recipe-nutrition-calculator-mcp.lipmichal.workers.dev/mcp"
    }
  }
}

README

Recipe Nutrition Calculator MCP

Recipe nutrition for AI assistants: paste ingredient lines, get calories, protein, fat, saturated fat, carbohydrate, fiber, sugars and sodium per recipe and per serving from USDA FoodData Central, rounded by the FDA Nutrition Facts rules.

Hosted MCP URL (no sign-in, no token): https://recipe-nutrition-calculator-mcp.lipmichal.workers.dev/mcp

Nutrition calculators and label tools on the web: recipetool.net

Tools

ToolWhat it does
lookup_ingredient_nutritionUSDA nutrients per 100 g for one of 406 common recipe ingredients, with its FDC id, the USDA household measures in grams (1 cup, 1 tbsp, 1 large, 1 clove), and the nutrients for an amount such as 1.5 cup or 3 each.
calculate_recipe_nutritionParses lines like "2 1/4 cups flour", "1 stick butter", "2 large eggs", "1 (15 oz) can black beans", converts them to grams with the USDA weights for that food, and returns totals, per-serving values and the per-serving Nutrition Facts values. Lines it cannot match are listed, not guessed.
round_nutrition_labelApplies the 21 CFR 101.9(c) rounding steps to unrounded per-serving values and adds percent Daily Value from the 2,000-calorie DRVs.
scale_recipe_nutritionScales ingredient lines by a factor or from one servings count to another, and recomputes the nutrition of the scaled recipe.

Every result has structured JSON, a one-paragraph summary, an as_of date, a source URL and a more link to the matching recipetool.net page.

What it knows that your model does not

  • Exact USDA values. Each of the 406 ingredients carries the FoodData Central nutrient values and FDC id: 398 from SR Legacy and 8 from the April 2026 Foundation Foods release where that release has all eight nutrients. A model recalls nutrition roughly and changes its answer between runs.
  • Food-specific cup weights. A cup of flour is 125 g, packed brown sugar 220 g, shredded cheddar 113 g, chopped onion 160 g, whole milk 244 g. These are the USDA household measures for that food, not one density for everything.
  • The label rounding rules. Calories round to 5 up to 50 and to 10 above, fat to 0.5 g under 5 g, sodium to 5 mg up to 140 mg and to 10 mg above, with the "less than 1g" cases for carbohydrate, fiber, sugars and protein. Copied from the eCFR text of 21 CFR 101.9.
  • The current Daily Values. Fat 78 g, saturated fat 20 g, sodium 2,300 mg, carbohydrate 275 g, fiber 28 g, added sugars 50 g.

Install

Claude.ai custom connector, ChatGPT developer mode

Paste this URL as a custom connector. No token or sign-in.

https://recipe-nutrition-calculator-mcp.lipmichal.workers.dev/mcp

Claude Code

claude mcp add --transport http recipe-nutrition https://recipe-nutrition-calculator-mcp.lipmichal.workers.dev/mcp

Or run it locally over stdio:

claude mcp add recipe-nutrition -- npx -y github:theluckystrike/recipe-nutrition-calculator-mcp

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "recipe-nutrition": {      "command": "npx",      "args": ["-y", "github:theluckystrike/recipe-nutrition-calculator-mcp"]    }  }}

Cursor

Add to ~/.cursor/mcp.json:

json
{  "mcpServers": {    "recipe-nutrition": { "url": "https://recipe-nutrition-calculator-mcp.lipmichal.workers.dev/mcp" }  }}

VS Code

Add to .vscode/mcp.json:

json
{  "servers": {    "recipe-nutrition": { "type": "http", "url": "https://recipe-nutrition-calculator-mcp.lipmichal.workers.dev/mcp" }  }}

Test with curl

curl -s -X POST https://recipe-nutrition-calculator-mcp.lipmichal.workers.dev/mcp \  -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"calculate_recipe_nutrition","arguments":{"lines":["2 cups all-purpose flour","1 cup sugar","1/2 cup butter"],"servings":4}}}'

Example prompts

  • "How many calories per cookie in this recipe? It makes 48." (paste the ingredient list)
  • "Make a Nutrition Facts panel for my granola, 12 servings."
  • "How much protein is in 1 cup of cooked lentils?"
  • "I have 137.4 kcal, 6.8 g fat and 96 mg sodium per serving. What goes on the label?"
  • "Scale this chili from 4 to 10 servings and tell me the calories per bowl."

How it calculates

  • Weight units convert exactly (1 oz = 28.349523125 g, 1 lb = 453.59237 g, 1 stick of butter = 1/4 lb).
  • Cups and spoons use the USDA household measure for that food. A US cup is 236.588 mL, 16 tbsp or 48 tsp. When the line says chopped, sliced, shredded or packed, the matching USDA measure is used.
  • Counted items ("2 large eggs", "3 cloves garlic", "1 medium onion") use the USDA weight for that size. Eggs default to large, produce to medium.
  • Can and package sizes in the line ("1 (15 oz) can") use the net weight.
  • Nutrients = grams x USDA value per 100 g / 100, summed over lines, divided by servings.
  • Label values follow 21 CFR 101.9(c). Percent DV is computed from the unrounded amount and rounded to the nearest whole percent.

19 test fixtures check table values and arithmetic. The expected values come from scripts/expected.py, which reads the USDA CSV files directly and applies the rounding rules by hand, not from the server code.

Data sources

See DATA_SOURCES.md. In short, nutrient values and household measures come from the USDA FoodData Central SR Legacy (2018-04) and Foundation Foods (2026-04-30) CSV downloads, fetched on 2026-11-02, which are public domain. Rounding rules and Daily Values come from the eCFR text of 21 CFR 101.9, fetched the same day.

Limitations

  • Values are for the raw ingredients as listed. Cooking losses, water evaporation and oil absorbed in frying are not modeled.
  • 406 common ingredients, not branded products. Lines that do not match are listed under unresolved_lines. Rewrite them or give grams.
  • SR Legacy does not report fiber or sugars for a few foods (some spices, grains and oils). Those show as null and the result lists which ingredients lacked a nutrient, so totals are a lower bound for that nutrient.
  • Added sugars are not in SR Legacy. round_nutrition_label takes added sugars if you supply them.
  • Matching is fuzzy. Check the matched name and FDC id in each line.
  • This is arithmetic on published reference values. A commercial label may need lab analysis or a compliant database; check FDA guidance.

Development

npm installnpm run buildnpm testnpx wrangler deploy

src/core.ts holds the pure logic and src/data.ts the generated table. src/stdio.ts and src/worker.ts are thin entries over the same tool registry in src/tools.ts. Rebuild the table with scripts/build_data.py from the USDA CSV downloads.

License

MIT

Part of the Zovo MCP collection: https://mcp.zovo.one

More data servers from the same author

Each one is free, needs no API key and has a hosted URL you can paste into Claude or ChatGPT.

servertoolshosted URL
cups-to-grams-mcpconvert_ingredient, search_ingredients, scale_recipe, convert_oven_temperaturehttps://cups-to-grams-mcp.lipmichal.workers.dev/mcp
dscr-loan-calculator-mcpcalculate_dscr, max_loan_for_target_dscr, rent_needed_for_target_dscr, compare_scenarios, amortization_summaryhttps://dscr-loan-calculator-mcp.lipmichal.workers.dev/mcp
gold-price-per-gram-mcpget_gold_price_per_gram, get_metal_prices, calculate_jewelry_value, convert_gold_unitshttps://gold-price-per-gram-mcp.lipmichal.workers.dev/mcp
lake-level-mcpsearch_lakes, get_lake_level, get_lake_history, compare_lakeshttps://lake-level-mcp.lipmichal.workers.dev/mcp
minimum-wage-mcpget_minimum_wage, list_upcoming_increases, compare_states, annual_income_at_minimum_wagehttps://minimum-wage-mcp.lipmichal.workers.dev/mcp
no-tax-on-overtime-mcpcalculate_overtime_deduction, calculate_tips_deduction, calculate_senior_deduction, estimate_tax_savings, explain_eligibilityhttps://no-tax-on-overtime-mcp.lipmichal.workers.dev/mcp
paycheck-calculator-mcpcalculate_take_home_pay, compare_states_take_home, salary_to_hourly, hourly_to_salary, get_federal_tax_bracketshttps://paycheck-calculator-mcp.lipmichal.workers.dev/mcp
uk-income-tax-salary-mcpcalculate_uk_take_home, get_uk_tax_bands, compare_salaries, marginal_rate_at_incomehttps://uk-income-tax-salary-mcp.lipmichal.workers.dev/mcp
us-federal-holidays-business-days-mcplist_federal_holidays, is_business_day, add_business_days, count_business_days, invoice_due_datehttps://us-federal-holidays-business-days-mcp.lipmichal.workers.dev/mcp
ab-test-sample-size-calculator-mcpcalculate_sample_size, estimate_test_duration, test_ab_significance, fisher_exact_test, check_peeking_riskhttps://ab-test-sample-size-calculator-mcp.lipmichal.workers.dev/mcp
aca-premium-tax-credit-calculator-mcpget_federal_poverty_level, calculate_premium_tax_credit, check_subsidy_cliff, get_aptc_repayment_caphttps://aca-premium-tax-credit-calculator-mcp.lipmichal.workers.dev/mcp
ap-score-distributions-mcpget_ap_score_distribution, estimate_ap_percentile, compare_ap_exams, list_ap_exams, estimate_ap_score_from_compositehttps://ap-score-distributions-mcp.lipmichal.workers.dev/mcp
car-loan-interest-deduction-calculator-mcpcalculate_car_loan_interest_deduction, calculate_salt_deduction, get_tax_brackets_and_standard_deduction, calculate_child_tax_credithttps://car-loan-interest-deduction-calculator-mcp.lipmichal.workers.dev/mcp
estate-gift-tax-exemption-calculator-mcpget_exemption_amounts, calculate_estate_tax, check_gift, compare_yearshttps://estate-gift-tax-exemption-calculator-mcp.lipmichal.workers.dev/mcp
retirement-contribution-limits-2027-mcpget_contribution_limits, calculate_max_contribution, get_social_security_cola, compare_yearshttps://retirement-contribution-limits-2027-mcp.lipmichal.workers.dev/mcp
section-179-deduction-calculator-mcpcalculate_section_179, calculate_bonus_depreciation, get_vehicle_depreciation_limits, calculate_asset_loan_paymenthttps://section-179-deduction-calculator-mcp.lipmichal.workers.dev/mcp
student-loan-repayment-assistance-plan-calculator-mcpcalculate_rap_payment, compare_rap_vs_standard, get_federal_loan_limits, get_plan_transition_dateshttps://student-loan-repayment-assistance-plan-calculator-mcp.lipmichal.workers.dev/mcp
subdomain-finder-mcpfind_subdomains, resolve_subdomains, get_certificate_history, summarize_attack_surfacehttps://subdomain-finder-mcp.lipmichal.workers.dev/mcp
uk-statutory-sick-pay-maternity-pay-calculator-mcpcalculate_statutory_sick_pay, calculate_statutory_maternity_pay, get_minimum_wage_rates, check_eligibilityhttps://uk-statutory-sick-pay-maternity-pay-calculator-mcp.lipmichal.workers.dev/mcp

The paid back-office collection (invoices, VAT, PDFs, spreadsheets) is at https://mcp.zovo.one

来源:README.md,提交 dd13bf7

工具

4

lookup_ingredient_nutrition

Look up USDA nutrients for an ingredient

Returns USDA FoodData Central nutrient values per 100 g (calories, protein, total fat, saturated fat, carbohydrate, fiber, total sugars, sodium) for a common recipe ingredient, with its FDC id, the USDA household measures (1 cup, 1 tbsp, 1 large, 1 clove) in grams, and optionally the nutrients for an amount such as 1.5 cup or 3 large. 406 ingredients from SR Legacy and Foundation Foods, embedded, no API key. Use it instead of estimating nutrition from memory.

输入参数unitamountingredient必填

calculate_recipe_nutrition

Calculate nutrition for a whole recipe and per serving

Parses ingredient lines ("2 cups flour", "1 stick butter" as 8 tbsp, "3 large eggs", "1 lb ground beef"), converts cups, spoons and counted items to grams with USDA household measure weights for that specific food, and sums USDA FoodData Central nutrients. Returns per-line grams and matches, recipe totals, per-serving values, and the per-serving values rounded by the FDA Nutrition Facts rules (21 CFR 101.9) with percent Daily Value. Lines it cannot match are listed, never guessed.

输入参数lines必填servings

round_nutrition_label

Round values for an FDA Nutrition Facts label

Applies the FDA Nutrition Facts rounding rules from 21 CFR 101.9(c) to unrounded per-serving values: calories (under 5 = 0, nearest 5 up to 50, nearest 10 above), fat and saturated fat (nearest 0.5 g under 5 g), sodium (nearest 5 mg up to 140 mg, nearest 10 above), carbohydrate, fiber, sugars, added sugars and protein (nearest gram, "less than 1g" rules). Adds percent Daily Value from the 2,000-calorie DRVs (fat 78 g, saturated fat 20 g, sodium 2,300 mg, carbohydrate 275 g, fiber 28 g, added sugars 50 g). Rules copied from the eCFR text.

输入参数kcal必填fat_gcarbs_gfiber_gsugars_gprotein_gsat_fat_gsodium_mgadded_sugars_g

scale_recipe_nutrition

Scale a recipe and recompute its nutrition

Scales ingredient lines by a factor or from original to target servings (parses mixed numbers and fraction characters), then recomputes total and per-serving nutrition with USDA FoodData Central values and FDA label rounding for the scaled recipe.

输入参数lines必填factortarget_servingsoriginal_servings

版本历史

1
  1. v1.0.0最新Nov 3, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Calculator 集成