food-mcp
Precision food chemistry, global nutrition databases (USDA, Open Food Facts, IFCT), and recipe formulation for AI agents.
food-mcp equips LLMs and autonomous agents with exact molecular nutrition data: essential amino acid profiles (WHO/FAO 2007), Muscle Protein Synthesis (MPS) Leucine threshold verification, electrolyte and mineral synergy ($Na:K$ and $Ca:Mg$ ratios), Iron bioavailability dynamics, Glycemic Load (GL) calculation, and NOVA ultra-processed food detection.
Quickstart
Run directly without manual installation using uvx (recommended) or npx:
# Python / uvx (zero install)
uvx food-mcp
# Or use the CLI alias
uvx --from food-mcp food-chemistry-mcp
# Node / npx (zero install thin bridge)
npx food-mcp
MCP Client Configuration
Add food-mcp to your MCP client config (claude_desktop_config.json, ~/.cursor/mcp.json, or Antigravity):
Using uvx (Recommended)
{
"mcpServers": {
"food-mcp": {
"command": "uvx",
"args": ["--from", "food-mcp", "food-mcp"]
}
}
}
Using npx
{
"mcpServers": {
"food-mcp": {
"command": "npx",
"args": ["-y", "food-mcp"]
}
}
}
Architecture & Databases
| Database / Engine | Coverage | Highlights |
|---|---|---|
| ICMR-NIN IFCT 2017 | 35+ core South Asian staples | Exact per-100g macros, calcium, iron, zinc, potassium, and full essential amino acid assays for Ragi, Jowar, Bajra, Toor dal, Moong dal, Paneer, Ghee, Moringa, Amla, etc. |
| USDA FoodData Central | Curated reference whole foods | High-yield proteins (Chicken breast, Wild Salmon, Eggs), plant lipids (Avocado, EVOO), and modern formulation staples (Hemp seeds, Lupin flour, Whey isolate, Nutritional yeast). |
| Open Food Facts | Global packaged barcodes & search | Millions of consumer products with real-time barcode lookup, ingredient lists, NOVA classification (1 to 4), and Nutri-Score. |
| Molecular Nutrition Engine | Mathematical formulation | WHO/FAO 2007 EAA pattern, 2.5g Leucine MPS threshold, $Na:K$ cardiovascular ratio, $Ca:Mg$ bone/vascular ratio, iron bioavailability pairing, and weighted Glycemic Load. |
MCP Tools Reference
1. lookup_food(query: str, region: str = "global", limit: int = 5)
Searches across IFCT, USDA, and Open Food Facts. Returns matched food items with standard IDs (ifct:ragi, usda:chicken_breast, off:737628064502) and macro previews.
{
"query": "ragi",
"region": "south_asia",
"limit": 3
}
2. get_food_chemistry(food_id_or_barcode: str)
Returns the full molecular profile: per-100g calories, protein, fat, carbohydrates, fiber, net carbs, minerals ($Na, K, Ca, Mg, Fe, Zn$), 11 essential & semi-essential amino acids (mg), fatty acid breakdown, Glycemic Index, NOVA group, Nutri-Score, allergens, and additives.
{
"food_id_or_barcode": "ifct:ragi"
}
3. formulate_recipe(ingredients: List[dict], servings: int = 1, title: Optional[str] = None)
Evaluates a multi-ingredient dish or meal plan:
- Aggregate & per-serving macros (Calories, Protein, Fat, Carbs, Fiber, Net Carbs).
- Caloric macro distribution (% protein, % fat, % net carbs).
- Amino Acid Completeness: Compares against WHO/FAO 2007 adult scoring pattern, identifies limiting amino acid, and verifies if serving clears the 2.5g Leucine MPS threshold.
- Micronutrient Synergy:
- $Na:K$ ratio (evaluates against $< 1.0$ target).
- $Ca:Mg$ ratio (evaluates against optimal $\approx 2:1$ physiological balance).
- Iron bioavailability & ascorbic acid enhancement notes.
- Glycemic Load (GL): Calculates weighted meal GI and categorizes GL ($\le 10$ Low, $11-19$ Medium, $\ge 20$ High).
- Cleanliness / Processing Score: Computes weighted NOVA score ($1.0 - 4.0$) and flags ultra-processed additives.
Example Input
{
"title": "High-Protein Millet & Paneer Bowl",
"servings": 1,
"ingredients": [
{ "name": "Ragi", "grams": 60 },
{ "name": "Toor Dal", "grams": 40 },
{ "name": "Paneer", "grams": 80 },
{ "name": "Moringa Leaves", "grams": 30 },
{ "name": "Ghee", "grams": 10 }
]
}
4. optimize_recipe_macros(ingredients: List[dict], target_protein_g: float = 40.0, max_carbs_g: float = 30.0)
Analyzes a recipe and provides actionable, quantitative adjustments:
- Recommends nutrient-dense swaps (e.g. swapping high-carb flours for lupin or almond flour, cauliflower rice).
- Recommends protein boosters (hemp seed hearts, nutritional yeast, paneer, whey isolate) to hit protein targets and clear the 2.5g Leucine threshold.
- Recommends mutual amino acid complementation (pairing Lysine-rich pulses with Methionine-rich seeds).
- Simulates projected post-optimization macros.
5. lookup_barcode(barcode: str)
Direct lookup of any global packaged food barcode via Open Food Facts API (https://world.openfoodfacts.org/api/v2/product/{barcode}.json).
6. doctor()
Runs diagnostic checks across local IFCT datasets, USDA database, Open Food Facts API latency, and skills availability.
7. skills_list() and skill_read(name: str)
Inspects and loads dynamic food chemistry playbooks directly into the agent's context.
8. check_for_updates(force: bool = False)
Checks PyPI for latest version and upgrade directives.
Dynamic Skills
food-mcp includes decoupled playbooks that provide domain guidance:
recipe-formulation: Deep dive into caloric distribution, $Na:K$ and $Ca:Mg$ mineral ratios, iron bioavailability levers, and Glycemic Load categorization.amino-acid-optimization: WHO/FAO 2007 reference adult pattern, Liebig's law of the minimum, 2.5g Leucine MPS threshold mechanics, and South Asian mutual supplementation.ultra-processed-food-audit: NOVA classification rules, industrial cosmetic additives (emulsifiers, artificial sweeteners, maltodextrin), and gut mucosal implications.
Call skill_read(name="recipe-formulation") from your agent to load any skill.
Telemetry & Privacy
food-mcp collects anonymous usage telemetry (tool name, latency, error taxonomy, OS/Python version) to prioritize dataset expansion and bug fixes:
- No ingredients, recipe titles, meal names, or user content are ever collected or logged.
- Opt out anytime by setting any of the following environment variables:
export FOOD_MCP_TELEMETRY=false # or export MCP_TELEMETRY_OPT_OUT=1 # or export DO_NOT_TRACK=1
License
MIT License. Copyright (c) 2026 Surendran B.
Metadata
Release files for food-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| food_mcp-0.1.0.tar.gz | 50.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| food_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.7 kB
Release files / food_mcp-0.1.0.tar.gz
| Download URL | food_mcp-0.1.0.tar.gz |
|---|---|
| Size | 50.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c017ef7355a71b8185f4a5bd0c529a4c6e48e7ff5637a00bc1e217d5a3668f5
|
|
BLAKE2b-256 checksum How to use checksums |
49b28c5ca5ae5dfcf42d6ae80620cacbe007594a540b391f0dbebdebfe074573
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / food_mcp-0.1.0-py3-none-any.whl
| Download URL | food_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 46.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e82211a51dadf780356c1b15b22dface5150e69588b4377a61c687485cfb5ed
|
|
BLAKE2b-256 checksum How to use checksums |
9e536d12d0f94071a5b7e76a88c6b5e662c148e5ef793c78ed81b885e7f04687
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for food-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.