Cups to Grams

io.github.theluckystrike由 GitHub 帳號 theluckystrike 發布v1.0.0更新於 Nov 6, 2026

Cups to grams for 271 ingredients with USDA and King Arthur densities, recipe scaling, oven temps.

已驗證Streamable HTTP可網頁執行位置與生活資料與分析

概覽

AI 產生的概覽

依 271 種食材在杯、匙與克之間換算烹飪用量,可縮放食譜配料行並換算烤箱溫度。

可以做什麼
  • 依名稱模糊搜尋食材表,查看每杯與每湯匙的克數及資料來源
  • 在指定食材的體積與重量單位之間換算,涵蓋公制、英制、日本杯以及奶油條
  • 依倍數或從原份數到目標份數縮放食譜配料行,可選擇為每行給出克數
  • 在華氏、攝氏與瓦斯刻度之間換算烤箱設定,並可選擇做旋風烤箱調整
適用情境
適合需要依實測食材重量回答烘焙與烹飪問題的情境,例如把食譜中的杯數換成克數、依份數縮放食譜,或在不同地區之間換算烤箱溫度。
執行需求
使用託管端點無需安裝,也不需要登入或權杖。另提供以 npx 套件執行的本機 stdio 版本,需要 Node.js。遠端端點需要網路存取。
安裝前請注意
結果是參考值而非實測:乾性體積以匙取刮平估算,表內數值取整到克,模糊比對可能選錯食材,應核對回傳的比對名稱。整顆雞蛋等以個數計量的食材不做體積換算。旋風烤箱建議僅為經驗法則。

安裝

在 SourceWeft 中

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

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.theluckystrike%2Fcups-to-grams-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "cups-to-grams": {
      "type": "http",
      "url": "https://cups-to-grams-mcp.lipmichal.workers.dev/mcp"
    }
  }
}

README

Cups to Grams MCP

Ingredient-aware cups to grams for AI assistants, using measured grams per cup from USDA FoodData Central and the King Arthur Baking weight chart instead of guessed densities.

Hosted MCP URL (no sign-in, no token): https://cups-to-grams-mcp.lipmichal.workers.dev/mcp

Converters and recipe tools on the web: ingredientcalculator.com

Tools

ToolWhat it does
convert_ingredientConverts an amount between volume and weight for a named ingredient (cup, tbsp, tsp, fl oz, mL, L to g, oz, lb and back). Supports US, metric, imperial, US legal and Japanese cups, US, metric and Australian spoons, sticks of butter. Says which cup it used and cites the density source.
search_ingredientsFuzzy search over 271 ingredients. Returns canonical names, grams per US cup and per tablespoon, and the source (USDA FDC id or King Arthur chart).
scale_recipeScales ingredient lines by a factor or from one servings count to another. Parses mixed numbers and fraction characters. Optionally gives grams for every line.
convert_oven_temperatureFahrenheit, Celsius and gas mark (1/4 to 10), with a 20 C fan oven adjustment.

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

What it knows that your model does not

  • Measured weights. A cup of all-purpose flour is 120 g, granulated sugar 200 g, butter 227 g, honey 339 g, water 237 g. Models often apply one density to everything or mix up fluid ounces and weight ounces. Each of the 271 rows carries its source, and USDA rows carry the FDC id.
  • Which cup. A US cup is 236.5882365 mL, a metric cup 250 mL, an imperial cup 284.13 mL, the US nutrition-label cup 240 mL and a Japanese cup 200 mL. A 1 cup of flour in an Australian recipe is about 127 g, not 120 g. The server states the cup it used.
  • Exact unit constants. US units come from the US gallon of 231 cubic inches (NIST SP 811). Imperial units come from the UK Weights and Measures Act 1985 (gallon = 4.54609 L). The pound is exactly 453.59237 g.
  • Where published tables disagree. For 23 ingredients USDA and King Arthur differ by more than 5% (cornstarch, bread flour, oats, baking soda and others). The result names the value used and lists the other published value, so the user can see the spread.

Install

Claude.ai custom connector, ChatGPT developer mode

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

https://cups-to-grams-mcp.lipmichal.workers.dev/mcp

Claude Code

claude mcp add --transport http cups-to-grams https://cups-to-grams-mcp.lipmichal.workers.dev/mcp

Or run it locally over stdio:

claude mcp add cups-to-grams -- npx -y cups-to-grams-mcp

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "cups-to-grams": {      "command": "npx",      "args": ["-y", "cups-to-grams-mcp"]    }  }}

Cursor

Add to ~/.cursor/mcp.json:

json
{  "mcpServers": {    "cups-to-grams": { "url": "https://cups-to-grams-mcp.lipmichal.workers.dev/mcp" }  }}

VS Code

Add to .vscode/mcp.json:

json
{  "servers": {    "cups-to-grams": { "type": "http", "url": "https://cups-to-grams-mcp.lipmichal.workers.dev/mcp" }  }}

Test with curl

curl -s -X POST https://cups-to-grams-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":"convert_ingredient","arguments":{"amount":1,"from_unit":"cup","to_unit":"g","ingredient":"all-purpose flour"}}}'

Example prompts

  • "How many grams is 3/4 cup of brown sugar?"
  • "Convert 250 g of bread flour to cups."
  • "This Australian recipe says 2 cups plain flour. How many grams is that?"
  • "Double this recipe and give me grams: 1 1/2 cups flour, 1/2 cup sugar, 2 tbsp honey, 1 stick butter."
  • "Scale this recipe from 4 servings to 10."
  • "What is gas mark 6 in Fahrenheit, and what should I set a fan oven to?"

How it converts

  • Density in g per mL = grams per US cup / 236.5882365.
  • Volume to weight = amount x unit mL x density. Weight to volume is the reverse.
  • Volume to volume and weight to weight use the unit constants only.
  • A stick of butter is 1/4 lb (113.398 g), which USDA lists as 113 g and 1/2 cup.
  • Gas marks follow the standard recipe table (gas mark 4 = 350 F = 180 C). Fan ovens are set 20 C lower, per oven maker guidance.

27 test fixtures check unit constants and table values. The expected values come from scripts/expected.py, which works from the unit definitions and the published table values, not from the server code.

Data sources

See DATA_SOURCES.md. In short, densities come from USDA FoodData Central SR Legacy portion weights (FDC ids per row) and the King Arthur Baking ingredient weight chart, both fetched on 2026-10-30. The table is rebuilt by scripts/build_data.py.

Limitations

  • Volume measures vary with how you fill the cup. Dry values assume spoon-and-level filling. Scooping flour from the bag can add 30 g or more per cup. Weigh when it matters.
  • Table values are whole grams per cup, so results carry about plus or minus 0.5 g per cup of rounding. King Arthur rows given per tablespoon or teaspoon are coarser.
  • Whole eggs and other count items are not converted by volume. A large egg is about 50 g.
  • Ingredient matching is fuzzy. Check the matched name in the result, or use search_ingredients first.
  • Fan oven guidance is a rule of thumb. Oven calibration varies.

Development

npm installnpm run buildnpm testnpx wrangler deploy

src/core.ts holds the pure conversion logic and src/data.ts the generated density table. src/stdio.ts and src/worker.ts are thin entries over the same tool registry in src/tools.ts.

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
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
recipe-nutrition-calculator-mcplookup_ingredient_nutrition, calculate_recipe_nutrition, round_nutrition_label, scale_recipe_nutritionhttps://recipe-nutrition-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,提交 0ed154d

工具

4

convert_ingredient

Convert cups to grams for a named ingredient

Converts a kitchen amount between volume and weight for a specific ingredient, using measured grams-per-cup values (USDA FoodData Central portion weights with FDC ids, and the King Arthur Baking ingredient weight chart) instead of guessed densities. 271 ingredients. Units: US cup (236.5882365 mL), metric cup (250 mL), imperial cup, US legal cup (240 mL), Japanese cup, US/metric/Australian tablespoons, teaspoons, US and imperial fl oz, pints, quarts, gallons, mL, dL, L, g, mg, kg, oz, lb and sticks of butter. Volume to volume and weight to weight need no ingredient. States which cup definition it used and cites the density source.

輸入參數amount必填to_unit必填from_unit必填cup_systemingredient

search_ingredients

Search the measured ingredient density table

Fuzzy search over the ingredient table (flours, sugars, fats, dairy, liquids, nuts, grains, fruit, produce). Returns canonical names, grams per US cup and per tablespoon, and the source (USDA FDC id or King Arthur Baking chart). Use it to pick the exact ingredient before converting.

輸入參數limitquery必填

scale_recipe

Scale a recipe and convert it to grams

Scales a list of recipe ingredient lines ("1 1/2 cups all-purpose flour", "2 tbsp honey", "3 eggs") by a factor or from original to target servings. Parses mixed numbers and fraction characters. With to_metric_weights, converts cup and spoon amounts to grams with the measured density table and weights to grams, and reports lines it could not match.

輸入參數lines必填factorcup_systemtarget_servingsoriginal_servingsto_metric_weights

convert_oven_temperature

Convert oven temperature between F, C and gas mark

Converts an oven setting between Fahrenheit, Celsius and UK gas mark (1/4 to 10, from the standard recipe table) and optionally adjusts for a fan (convection) oven by 20 C, the manufacturer guidance. Returns the nearest gas mark and whether it is an exact table value.

輸入參數fanvalue必填from_scale必填

版本歷史

1
  1. v1.0.0最新Oct 30, 2026

評分

已滿足適用檢查項的 100%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分