Skip to main content
Glama
FDA Nutrition Facts MCP Server

FDA Nutrition Facts MCP Server

README.md
# FDA Nutrition Facts MCP Server

A lightweight, open-source [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server and structured JSON reference table for **US FDA 21 CFR 101.9 Daily Values (DRV/RDI)** and **legal Nutrition Facts rounding rules** — built for Claude Desktop, Cursor, Windsurf, Claude Code, LobeChat, and any MCP-compatible AI client.

Maintained by **[NutriLabelHub](https://nutritionlabelhub.com)** — an online FDA Nutrition Facts label generator and USDA recipe nutrition calculator for food makers, cottage food bakeries, and CPG brands.

## Why Use This MCP Server?

LLMs frequently hallucinate outdated pre-2020 FDA Daily Values (such as 300g carbs or 2400mg sodium) or apply standard math rounding instead of FDA's piecewise legal rounding increments (`<5 kcal → 0`, `5–50 kcal → nearest 5`, `>50 kcal → nearest 10`, micronutrient 2%/5%/10% `%DV` steps).

This server gives your AI assistant **100% local, zero-API-key, deterministic access** to the public federal regulation tables under **21 CFR 101.9**:

- **Zero API Keys & 100% Local**: Runs locally over stdio in Node.js with zero external network calls.
- **Public 21 CFR 101.9 Reference Dataset** (`data/fda-21cfr101-daily-values.json`): All 15 mandatory FDA Nutrition Facts nutrients with current 2020/2026 DRVs/RDIs, units, CFR citations, and rounding increments.
- **2 Focused MCP Tools + 1 JSON Resource**: Fast, minimal surface area designed for reliable agent tool calls.

## Available Tools

| Tool | Description |
|---|---|
| `lookup_fda_daily_value` | Look up the official FDA Daily Value (DRV/RDI), declaration unit, CFR citation, and rounding rule for any mandatory nutrient (e.g., `"sodium"`, `"added_sugars"`, `"vitamin_d"`, or `"all"`). |
| `round_fda_nutrition_value` | Apply official US FDA 21 CFR 101.9 piecewise rounding rules and compute `% Daily Value` (`%DV`) for raw per-serving numeric nutrient values. |

## Available Resource

- `fda://21cfr101/daily-values` — Structured JSON reference dataset of all 15 mandatory FDA Nutrition Facts nutrients (`application/json`).

## Quick Start

### 1. Clone, install, and test

```bash
git clone https://github.com/mazycc/fda-nutrition-facts-mcp.git
cd fda-nutrition-facts-mcp
npm install
npm test
```

### 2. Configure in Claude Desktop / Cursor / Claude Code

Add to your MCP config (`claude_desktop_config.json` or `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "fda-nutrition-facts": {
      "command": "node",
      "args": ["/absolute/path/to/fda-nutrition-facts-mcp/src/index.js"]
    }
  }
}
```

### 3. Run with Docker

```bash
docker build -t fda-nutrition-facts-mcp .
docker run -i --rm fda-nutrition-facts-mcp
```

## Example Prompts

- *"Look up the official FDA Daily Values for added sugars, sodium, and saturated fat."*
- *"Round these per-serving lab values per FDA 21 CFR 101.9: 217.2 calories, 11.93g total fat, 132mg sodium, and 17.01g added sugars."*
- *"Give me the complete 15-nutrient FDA Daily Value table as JSON."*

## Need Complete Recipe-to-Packaging Labels?

This MCP server intentionally covers only public FDA reference tables and numeric rounding rules. When you need end-to-end food packaging workflows, try the web tools on **[NutriLabelHub](https://nutritionlabelhub.com)**:

- **[FDA Nutrition Facts Label Generator](https://nutritionlabelhub.com)** — Generate Vertical, Tabular, and Linear 21 CFR 101.9 labels with print-ready Vector SVG, 300 DPI PNG, and Press-Ready PDF exports.
- **[Recipe Nutrition Calculator](https://nutritionlabelhub.com/recipe-nutrition-calculator)** — Paste English recipes (cups, tbsp, eggs, grams) with USDA FoodData Central lookup, baking moisture-yield loss, descending-weight ingredient lists, and US Top-9 allergen audits.
- **[Recipe Cost & Food COGS Calculator](https://nutritionlabelhub.com/recipe-cost-calculator)** — Track ingredient cost per serving and wholesale/retail food margins alongside nutrition totals.
- **[FDA Nutrition Label Requirements (2026 Guide)](https://nutritionlabelhub.com/fda-nutrition-label-requirements)** — Plain-English reference on FDA label formats, font sizes, rounding rules, and small-business exemptions.

## License

MIT — free to use, fork, and integrate with attribution to [NutriLabelHub](https://nutritionlabelhub.com).

TDQS

A3.8/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one retrieves FDA reference data (Daily Values, units, CFR citations, rounding rules), while the other performs numeric rounding and %DV calculation. An agent can easily determine which tool to use for lookup versus computation.

Naming Consistency5/5

Both names follow a consistent snake_case verb_noun pattern with a clear FDA domain prefix: lookup_fda_daily_value and round_fda_nutrition_value. The naming is predictable and readable.

Tool Count3/5

Two tools is thin for a server, even a narrowly scoped reference one. While each tool earns its place, the surface feels borderline minimal and may leave users wanting adjacent operations like unit conversion or validation.

Completeness4/5

The tools cover the core stated domain: looking up mandatory nutrient Daily Values and applying official rounding/%DV calculations. Minor gaps exist, such as no explicit unit conversion or label validation, but these are outside the narrowly stated scope.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues