Back to Browse

Fooddata Central MCP Server

Developer ToolsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

USDA FoodData Central: food search, nutrition data, and a quality-first find_food tool

About

USDA FoodData Central: food search, nutrition data, and a quality-first find_food tool

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

4 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

file_system

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

USDA FoodData Central API key. Get a free key at https://fdc.nal.usda.gov/api-guide. DEMO_KEY works for testing (30 req/hr limit).Required

Environment variable: FDC_API_KEY

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-trellislabs-hq-fooddata-central-mcp": {
      "env": {
        "FDC_API_KEY": "your-fdc-api-key-here"
      },
      "args": [
        "-y",
        "@trellis-labs/fooddata-central-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

FoodData Central MCP Server

[!WARNING] Withdrawn (2026-07-27). This package is deprecated on npm and delisted from the MCP registry. We launched it before the identity layer met our quality bar: on the 31 names in our adversarial benchmark that have no correct match in FDC's preferred data types, find_food still returns a confident wrong pick for 22 and a genuine refusal for none (see Reliability, tool by tool for the full, honest numbers). Rather than iterate on a weak foundation in public, we're rebuilding on a verified food knowledge base, and we intend to relaunch under this package name if and when it clears pre-defined acceptance criteria. Existing installs keep working; the raw FDC passthrough tools (search_foods, get_food, get_foods, list_foods) are unaffected by the identity-quality issues. The history below, including our public correction of an inaccurate claim, stays as-is.

An MCP server that exposes the USDA FoodData Central database — search foods, look up nutrient data by FDC ID, and find the canonical version of a food name without wading through thousands of near-duplicate manufacturer entries.

Not affiliated with the USDA. Food composition data is public domain (U.S. Government work); see Attribution below.

Quickstart

Add this to your MCP client config (Claude Desktop, Claude Code, etc.):

{
  "mcpServers": {
    "fooddata-central": {
      "command": "npx",
      "args": ["-y", "@trellis-labs/fooddata-central-mcp"],
      "env": {
        "FDC_API_KEY": "YOUR_KEY_HERE"
      }
    }
  }
}

For Claude Desktop, this goes in claude_desktop_config.json (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows).

Get an API key

Sign up for a free key at fdc.nal.usda.gov/api-guide — takes about a minute, no credit card. A registered key gets you 1,000 requests/hour.

Don't want to sign up right now? Use FDC_API_KEY=DEMO_KEY — USDA's shared demo key works immediately with no signup, limited to 30 requests/hour. Fine for trying the server out; get a real key before relying on it for regular use.

The cheddar problem (why find_food exists)

Search "cheddar cheese" directly against FDC's full catalog and you get 64,784 hits. Page 1 is ten near-identical Branded entries — different grocery chains' private-label cheddar, none of them the food you actually meant:

CHEDDAR CHEESE | Grafton Village Cheese Co, LLC
CHEDDAR CHEESE | Three Square Inc. (Crystal Farms)
CHEDDAR CHEESE | Weis Markets, Inc.
CHEDDAR CHEESE | Weis Markets, Inc.
CHEDDAR CHEESE | Weis Markets, Inc.
... (5 more brands, same product)

The canonical, lab-analyzed answer — Cheese, cheddar (FDC 328637, Foundation) — is nowhere on that page.

find_food("cheddar cheese") returns it first:

Best match for "cheddar cheese":
FDC ID: 328637 | Name: Cheese, cheddar | Type: Foundation
Nutrient summary: Carbohydrate: 2.44 G | Energy: 408 KCAL | Protein: 23.3 G | ...
Use get_food(fdcId: 328637) for the full nutrient breakdown.

Alternates:
FDC ID: 746767 | Name: Cheese, swiss | Type: Foundation
...

It does this by preferring Foundation (USDA lab-analyzed) and SR Legacy (classic reference) data over Branded (manufacturer-submitted) noise, and only falling back to Branded results if nothing else matches or you explicitly ask for it (includeBranded: true).

Tools

find_food (beta — see Reliability)

Find the best canonical match for a food name. This is the tool to reach for first when you just want "the" answer for a food, not a list to sift through. Identity resolution is genuinely hard and this resolver is under active, publicly-measured development — read the Reliability section before trusting confident matches on niche names.

  • Input: name (string, required), includeBranded (boolean, optional, default false)
  • Output: best match with FDC ID + key-nutrient summary, up to 3 alternates, and a one-line note when normalization/aliasing or a Branded fallback was used.
  • Handles plurals, common prep words ("sliced onion" → "onion"), and a small table of food-identity aliases for less common ingredient names (e.g. "paneer" → "paneer cheese", "nori" → "seaweed sheets").
  • No LLM calls happen inside this tool — it's a search/ranking pipeline. The calling model (you) is the disambiguation layer if the top match still isn't quite right; use the alternates or search_foods for more control.

search_foods

Search FDC by keyword. Full control over data type, brand owner, and pagination — use this when you want to see the raw candidate list rather than a single resolved answer.

  • Input: query (required), dataType, pageSize (1-50, default 10), pageNumber, brandOwner.
  • Data type guidance: prefer Foundation and SR Legacy over Branded unless you specifically need manufacturer nutrition-label data. Survey (FNDDS) covers dietary-survey composite foods (e.g. "chicken sandwich").

get_food

Full nutrient breakdown for a single food by FDC ID.

  • Input: fdcId (required), format (full default or abridged), nutrients (optional filter list).
  • Known FDC quirk: some Foundation records (e.g. 328637, 746767) return HTTP 404 on full-format detail even though the record exists and is fully searchable — abridged format works fine for the same ID. This server automatically retries with abridged on a full-format 404 and notes it in the output; you don't need to handle this yourself.

get_foods

Batch lookup of up to 20 foods by FDC ID in one call — more efficient than repeated get_food calls.

list_foods

Paginated browse of the full catalog by data type, without a search term. Useful for exploring what's available rather than looking something specific up.

Reliability, tool by tool

The data-access tools — search_foods, get_food, get_foods, list_foods — are thin, deterministic wrappers over the USDA API. They return exactly what FoodData Central returns, with typed schemas, key protection, and pagination handled for you. If you know what you're looking for (or you're browsing), these are dependable today and carry no matching heuristics at all.

find_food is different — treat it as a beta resolver. It tries to answer a genuinely hard question: which single FDC entry IS this household food name? USDA's own search can't answer that — it always returns a nearest neighbor, even for foods FDC has nothing for (ask it for "old bay seasoning" and raw USDA relevance will hand you bay scallops with a straight face). find_food layers identity heuristics and an honesty floor on top, and we measure it in public rather than pretending the problem is solved.

The benchmark (and how to read it honestly)

We test against 96 household food names drawn from our own recipe-pipeline curation. This is an adversarial challenge set, not a representative sample — it deliberately over-samples the hardest names we have ever seen, because those are the ones worth measuring. Two separate questions, two separate numbers (measured 2026-07-18, round-2 floor):

  • When no correct answer exists, do we say so? 31 of the names are human-verified to have no correct match in FDC's preferred data types. Raw FDC behavior always bluffs here — a confident wrong food, 31 out of 31. find_food today (round-2 floor, three-outcome scoring): 22 of 31 still return a confident wrong pick · 9 of 31 return a clearly-labeled Branded fallback · 0 of 31 refuse outright. The 9 fallbacks are honestly labeled as lower-confidence Branded data (ask for "Mrs. Dash seasoning" and you get a MRS. DASH Branded product, marked as a Branded fallback). The label is the honesty — the product behind it may still be a poor match, since these are names with no correct answer. We no longer count a labeled fallback as a refusal. Converting the remaining bluffs into genuine refusals is open, unshipped work.

    Correction (2026-07-26): an earlier version of this section claimed a 29.0% refusal rate with "every refusal is genuine — none are rescued by lower-quality data." That was wrong. Our scoring at the time counted any usedBranded result as a single "honest" outcome, and this prose then presented every honest outcome as a refusal. In fact all 9 were Branded rescues, and the true refusal count was and is 0 of 31. The eval harness now scores the three outcomes separately (refusal / labeled_branded_fallback / confident_wrong), so this distinction comes from the replay output rather than our prose.

  • When a correct answer exists, do we return exactly it? On the other 65 names, 12.3% of top-1 results and 24.6% of exposed top-4 results match the byte-exact human-ratified FDC ID. This scoring is deliberately merciless: returning "Cheese, parmesan, grated" when the ratified pin is a different parmesan entry counts as a miss. Many misses are reasonable-variety disagreements; some are genuinely wrong foods — the eval output distinguishes them, and we don't average the two questions into one comfortable number.

Practical guidance: for common, plainly-named foods a confident find_food match is usually what you want. For compound or niche names — seasoning blends, brand names, "X of choice" — treat a confident match skeptically and check the alternates. When a result is marked as a Branded fallback, take that label seriously: Branded entries are manufacturer-submitted data, not USDA lab reference data, and the label means our floor had lower confidence in the match.

Each release only ever tightens the floor: round 2 tripled the labeled-fallback rate (3 → 9 of 31) with zero top-1 answers lost (cost: one top-4 alternate on one name — a deliberate, documented trade; see eval/round2-delta.md). The full harness, scoring rules, per-name results, and dataset provenance are public in eval/ — run the replay yourself; it's deterministic and needs no API key.

Privacy & data flow

Every tool call goes directly from this server to api.nal.usda.gov, using the API key you provided. There is no intermediary service, no telemetry, and no analytics in this package — your queries and your key never pass through anything but your machine and USDA's API.

Data accuracy & scope

  • Not nutrition or medical advice. This server returns reference data from USDA FoodData Central. It's a lookup tool, not a substitute for professional dietary, medical, or allergen guidance — verify anything health-critical against the product label or a qualified professional.
  • Data quality varies by data type. Foundation and SR Legacy records are USDA lab-analyzed reference values. Branded records are manufacturer-self-reported nutrition-label data — values can differ across product samples, reformulations, and FDC data releases, and upstream errors are passed through as-is.
  • Freshness and availability follow USDA. Data currency tracks USDA's release cycle, and availability tracks the FDC API itself. The software is provided as-is under the MIT license, with best-effort support (below) and no SLA.

Support

This is a best-effort, bootstrapped open source project. Bug reports and feature requests are welcome via GitHub Issues — no guaranteed response time, but real issues get looked at.

Interested in a hosted version (no local setup, managed API key, higher rate limits)? Open a hosted-interest issue and tell us what you'd need.

Attribution & data source

Nutrition data is sourced from the U.S. Department of Agriculture's FoodData Central, a public domain U.S. Government resource. This project is an independent, unofficial client and is not affiliated with or endorsed by the USDA.

License

MIT — see LICENSE.

Reviews

No reviews yet

Be the first to review this server!