Skip to main content
Glama
theluckystrike

Cups to Grams MCP

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

Tool

What it does

convert_ingredient

Converts 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_ingredients

Fuzzy 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_recipe

Scales 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_temperature

Fahrenheit, 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.

Related MCP server: yes_chef_mcp

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 github:theluckystrike/cups-to-grams-mcp

Claude Desktop

Add to claude_desktop_config.json:

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

Cursor

Add to ~/.cursor/mcp.json:

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

VS Code

Add to .vscode/mcp.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 install
npm run build
npm test
npx 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.

server

tools

hosted URL

dscr-loan-calculator-mcp

calculate_dscr, max_loan_for_target_dscr, rent_needed_for_target_dscr, compare_scenarios, amortization_summary

https://dscr-loan-calculator-mcp.lipmichal.workers.dev/mcp

gold-price-per-gram-mcp

get_gold_price_per_gram, get_metal_prices, calculate_jewelry_value, convert_gold_units

https://gold-price-per-gram-mcp.lipmichal.workers.dev/mcp

lake-level-mcp

search_lakes, get_lake_level, get_lake_history, compare_lakes

https://lake-level-mcp.lipmichal.workers.dev/mcp

minimum-wage-mcp

get_minimum_wage, list_upcoming_increases, compare_states, annual_income_at_minimum_wage

https://minimum-wage-mcp.lipmichal.workers.dev/mcp

no-tax-on-overtime-mcp

calculate_overtime_deduction, calculate_tips_deduction, calculate_senior_deduction, estimate_tax_savings, explain_eligibility

https://no-tax-on-overtime-mcp.lipmichal.workers.dev/mcp

paycheck-calculator-mcp

calculate_take_home_pay, compare_states_take_home, salary_to_hourly, hourly_to_salary, get_federal_tax_brackets

https://paycheck-calculator-mcp.lipmichal.workers.dev/mcp

uk-income-tax-salary-mcp

calculate_uk_take_home, get_uk_tax_bands, compare_salaries, marginal_rate_at_income

https://uk-income-tax-salary-mcp.lipmichal.workers.dev/mcp

us-federal-holidays-business-days-mcp

list_federal_holidays, is_business_day, add_business_days, count_business_days, invoice_due_date

https://us-federal-holidays-business-days-mcp.lipmichal.workers.dev/mcp

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

Available Tools

4 tools
convert_ingredientConvert cups to grams for a named ingredientA
Read-onlyIdempotent
Inspect

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.

NameRequiredDescriptionDefault
amountYesQuantity to convert, e.g. 1.5. Use decimals for fractions (3/4 = 0.75).
to_unitYesUnit to convert to, e.g. g, oz, cup, ml.
from_unitYesUnit to convert from, e.g. cup, us_cup, metric_cup, tbsp, tsp, fl oz, ml, l, g, oz, lb, stick.
cup_systemNoWhich cup and spoon family the bare words cup, tbsp, tsp, fl oz and pint mean. us = 236.588 mL cup (default), metric = 250 mL cup with 15/5 mL spoons, imperial = 284.13 mL cup with UK pints. Explicit units such as metric_cup always win.
ingredientNoIngredient name, e.g. "all-purpose flour", "brown sugar", "honey". Required when converting between volume and weight.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety needs no restating. The description instead adds real behavioural context: the density data is measured (not guessed), the corpus is 271 ingredients, and the response reports which cup definition was applied and cites the source. That last point is valuable output-behaviour disclosure in the absence of an output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and the ingredient-optional rule are front-loaded, and every other sentence does work. The single long unit enumeration is dense but earns its place because the unit parameters are free-form strings; still, it reads as a wall of nouns rather than a structured list.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only five-parameter converter with a fully documented schema and no output schema, this covers the decision points an agent faces: which units exist, how cup ambiguity is resolved, when an ingredient is mandatory, and what the result reports about its own provenance. Only ingredient-name resolution failures are unaddressed, a minor gap against an otherwise complete picture.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Coverage is 100%, so the baseline is 3, but the description goes further by enumerating the accepted unit vocabulary (including the six cup definitions and the spoon/fl-oz/butter-stick families) for free-form string parameters whose schema only supplies partial examples. It also reinforces that explicit units like metric_cup override cup_system, which is the subtlest interaction in the call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states a specific verb (converts) and a precise resource (a kitchen amount between volume and weight for a named ingredient), plus the data basis (USDA portion weights with FDC ids, King Arthur chart). This is unmistakably distinct from the sibling tools convert_oven_temperature, search_ingredients, and scale_recipe.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly establishes the condition that selects the ingredient parameter — "Volume to volume and weight to weight need no ingredient" — which is exactly the decision an agent needs to make. What it lacks is any routing to siblings, e.g. pointing at search_ingredients when the exact ingredient name is unknown.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

convert_oven_temperatureConvert oven temperature between F, C and gas markA
Read-onlyIdempotent
Inspect

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.

NameRequiredDescriptionDefault
fanNoFan oven adjustment. Default none.
valueYesTemperature or gas mark, e.g. 350, 180 or 4.
from_scaleYesScale of value: F, C or gas (gas mark).

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), and the description goes further by disclosing the 20 C fan offset rationale, the gas-mark table bounds, and that results are rounded to the nearest gas mark with an exactness flag. That rounding/exactness behaviour is real substance not present in the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core conversion and followed by the return-value note; nothing is padded. The first sentence is dense with parentheticals, which costs a little readability but every clause carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With only three simple parameters, no output schema, and annotations covering safety, the description supplies everything an agent needs: input scales, gas-mark bounds, fan handling, and the shape of the returned gas mark plus exactness flag.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with enums for both fan and from_scale, so the schema carries the baseline. The description still adds meaning the schema lacks: the allowable gas-mark span (1/4 to 10) and the magnitude/source of the fan adjustment (20 C, manufacturer guidance), which tells an agent what the enum values actually do.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

A specific verb ('Converts') plus the exact resource ('an oven setting') and the three scales involved, including the gas-mark range 1/4 to 10. It also names the optional fan adjustment, so an agent can tell immediately this is a temperature-unit tool and not the ingredient converter among the siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when it applies (converting an oven setting across F/C/gas, with or without fan adjustment) but never states explicit conditions, prerequisites, or when to prefer convert_ingredient instead. Usage is inferable from the title and description rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scale_recipeScale a recipe and convert it to gramsA
Read-onlyIdempotent
Inspect

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.

NameRequiredDescriptionDefault
linesYesIngredient lines, one per item, quantity first.
factorNoMultiply every quantity by this, e.g. 2 or 0.5. Or give servings instead.
cup_systemNoWhich cup and spoon family the bare words cup, tbsp, tsp, fl oz and pint mean. us = 236.588 mL cup (default), metric = 250 mL cup with 15/5 mL spoons, imperial = 284.13 mL cup with UK pints. Explicit units such as metric_cup always win.
target_servingsNoServings you want.
original_servingsNoServings the recipe makes now.
to_metric_weightsNoAlso give grams for each line. Default false.

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish read-only, idempotent, non-destructive behavior, and the description adds genuinely new context: mixed-number and fraction-character parsing, the measured density table used for gram conversion, and that unmatched lines are reported back. It does not characterize failure modes beyond unmatched lines.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences, front-loaded with the core action and supported by illustrative examples. Every sentence carries information, though the density is on the higher side.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description carries the burden of describing return values, and it only partially does so—mentioning reported unmatched lines but not the shape of the successful scaled output (e.g., strings vs. structured quantity/unit/gram triples). For a tool this data-shaping, that gap matters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents every parameter thoroughly, making 3 the baseline. The description does add one relationship not encoded in the schema—that factor is an alternative to original_servings/target_servings—but does not elaborate further.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource (scaling ingredient lines) and gives concrete input examples, so an agent immediately knows what the tool consumes. It does not explicitly contrast itself with the sibling convert_ingredient, which handles single-ingredient conversion, leaving that boundary to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the two supported modes clearly: scale by a factor, or scale from original to target servings, plus the optional to_metric_weights mode. It stops short of naming when to prefer this over convert_ingredient or search_ingredients.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_ingredientsSearch the measured ingredient density tableA
Read-onlyIdempotent
Inspect

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.

NameRequiredDescriptionDefault
limitNoMaximum results. Default 10.
queryYesIngredient name or part of it, e.g. "flour", "confectioners sugar", "oats".

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior. The description adds useful context beyond annotations: search is fuzzy, results include canonical names and density values with provenance from USDA FDC or King Arthur Baking. It does not discuss ranking or pagination beyond the limit parameter.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two compact sentences, front-loaded with the core action and scope, followed by return values and usage guidance. There is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only lookup with two fully documented parameters and no output schema, the description covers what the tool searches, what it returns, and how it fits before conversion. An agent has enough information to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both query and limit are already documented with examples and bounds. The description adds no additional parameter guidance, which matches the baseline 3 when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Fuzzy search over the ingredient table'), lists the covered categories, and names the concrete return fields (canonical names, grams per cup/tablespoon, source). This clearly distinguishes it from conversion tools like convert_ingredient.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says to use it 'to pick the exact ingredient before converting,' which positions it relative to convert_ingredient. It stops short of naming when not to use it or pointing to an alternative search method, but the usage context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedconvert_ingredient
    • First observedconvert_oven_temperature
    • First observedscale_recipe
    • First observedsearch_ingredients

TDQS

A4.2/5.0

Scored across 4 tools

Disambiguation4/5

The four tools have mostly distinct roles: searching ingredients, converting a single ingredient amount, scaling recipe lines, and converting oven temperatures. The only mild overlap is that scale_recipe can perform metric weight conversions internally, similar to convert_ingredient, but the descriptions make the intended boundary clear.

Naming Consistency5/5

All tool names use consistent snake_case verb_noun phrasing: convert_oven_temperature, search_ingredients, convert_ingredient, and scale_recipe. The pattern is predictable and readable.

Tool Count5/5

Four tools is well-scoped for a specialized cooking-unit conversion server. Each tool covers a distinct part of the workflow: ingredient lookup, unit conversion, recipe scaling, and oven temperature conversion.

Completeness5/5

The tool surface covers the core lifecycle for this domain: finding an ingredient, converting its units, scaling whole recipes, and converting oven temperatures. No obvious operational gaps remain for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI assistants to search for recipes, get nutritional information, find ingredients, and more through the Spoonacular Food API using natural language.
    6
    16 npm
    6
    ISC
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables AI assistants to search recipes, compose nutritionally balanced meals, optimize weekly meal plans based on macro targets for family members, and generate consolidated grocery lists from a personal recipe database.
    -
  • A
    license
    B
    quality
    C
    maintenance
    Enables AI agents to perform 22 unit conversions and common calculations such as length, weight, temperature, volume, tip, percentage, date difference, age, currency, cooking, and fuel consumption.
    14
    1
    MIT