Skip to main content
Glama

food-mcp

PyPI version npm version License: MIT

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"]
    }
  }
}

Related MCP server: fatsecret-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:

  1. recipe-formulation: Deep dive into caloric distribution, $Na:K$ and $Ca:Mg$ mineral ratios, iron bioavailability levers, and Glycemic Load categorization.

  2. 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.

  3. 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.

Available Tools

9 tools
check_for_updatesC

Check PyPI for the latest version of food-mcp.

Inputs: force. Returns: result

doctorB

Tests connectivity to Open Food Facts, USDA, and local IFCT dataset.

Inputs: no named parameters. Returns: result

formulate_recipeC

Formulates a multi-ingredient recipe and returns aggregate and per-serving macros,

caloric distribution, amino acid completeness (WHO/FAO 2007 pattern + 2.5g Leucine MPS threshold), micronutrient synergies (Na:K ratio, Ca:Mg ratio, Iron bioavailability), glycemic impact (GI and Glycemic Load), and cleanliness score (weighted NOVA).

Inputs: ingredients (required), title, servings. Returns: result

get_food_chemistryB

Returns the full molecular profile for a food ID or packaged barcode:

macros, micros, amino acids, fatty acids, NOVA group (1 to 4), Nutri-Score, allergens, and additives.

Inputs: food_id_or_barcode (required). Returns: result

lookup_barcodeB

Instant lookup of any global packaged food barcode via Open Food Facts API.

Inputs: barcode (required). Returns: result

lookup_foodB

Searches food chemistry databases across ICMR-NIN IFCT, USDA, and Open Food Facts.

Returns matched foods with food IDs and per-100g macro previews.

Inputs: query (required), limit, region. Returns: result

optimize_recipe_macrosB

Analyzes a recipe and suggests precise gram adjustments or nutrient-dense swaps

(e.g., swapping flour for lupin/almond flour, adding hemp seeds, paneer, nutritional yeast) to hit target macros and clear the 2.5g Leucine MPS threshold.

Inputs: ingredients (required), servings, max_carbs_g, target_protein_g. Returns: result

skill_readC

Read a specific food chemistry skill/playbook by name.

Inputs: name (required). Returns: result

skills_listA

List available food chemistry and recipe optimization skills.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools have distinct resource/action pairings, but lookup_barcode and get_food_chemistry both handle packaged barcodes, creating potential overlap. formulate_recipe and optimize_recipe_macros are also adjacent, though their descriptions differentiate creation from analysis/optimization.

    Naming Consistency3/5

    All names use snake_case, but the patterns are mixed: verb_noun (lookup_food, get_food_chemistry), noun_verb (skills_list, skill_read), a bare noun (doctor), and a longer verb phrase (check_for_updates). The convention is readable but not predictable.

    Tool Count5/5

    Nine tools is well-scoped for a food chemistry and recipe optimization server. The set balances core domain operations with useful meta tools without becoming bloated.

    Completeness4/5

    The surface covers lookup, detailed chemistry, barcode resolution, recipe formulation, optimization, and supporting utilities. Minor gaps exist, such as direct nutrient-based search or multi-food comparison, but core workflows are covered.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides tools to search and retrieve USDA Food Data Central information, including food items, nutrients, and food groups, enabling AI agents to query food data through natural language.
      70 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides LLM agents with read-only access to FatSecret's food and recipe database through MCP tools for searching foods and retrieving detailed nutritional information.
      92 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to analyze the nutrition of ingredients or recipe lines and to search recipe and food databases with optional diet, health, and cuisine filters.
      304 npm
      MIT