# openfoodfacts-mcp-server [Health: Active]

**Category:** 🔎 Search & Data Extraction  
**Repository:** https://github.com/cyanheads/openfoodfacts-mcp-server  
**GitHub Stars:** 1  
**npm Downloads (last month):** 1340  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/openfoodfacts-mcp-server

## Description
Barcode lookup, nutrition search, and product comparison for 3M+ crowd-sourced food products.

## Tools
Capabilities this server exposes over MCP:

- **off_get_product** — Fetch a packaged food product by barcode (4–40 digits: EAN-13, EAN-8, UPC, and the shorter and longer codes Open Food Facts also holds) from Open Food Facts. Returns the product name, brand, quantity, ingredients (raw text and parsed list), declared allergens, trace allergens the label warns about, additives, the product-level vegan/vegetarian/palm-oil analysis, computed scores (Nutri-Score a–e, NOVA 1–4, Green-Score), nutrition per serving and per 100 g, or per 100 ml for liquids, categories, labels, packaging, origins, countries of sale, image URL, and data completeness. Open Food Facts is a crowd-sourced database — a missing field means "not yet entered by contributors," not that the attribute is absent from the actual product. Computed scores carry regional formula caveats and are indicators, not absolute rankings. Data is under ODbL 1.0 — cite Open Food Facts in downstream use.
- **off_search_products** — Search Open Food Facts by full-text query, structured tag filters, or both at once. Returns a summary list with barcodes, product names, brands, Nutri-Score, NOVA group, and categories — enough for triage and selection, not full label data. Use off_get_product on the returned barcodes for complete details. A text query and tag filters combine: every word of the query must match the product name, generic name, categories, labels, or brand, and every filter provided must hold (e.g. query "dark chocolate" with labels_tag "en:organic" and countries_tag "en:france" returns organic chocolate sold in France); numeric nutrient_filters express thresholds per 100 g, or per 100 ml for liquids, such as sugars below 8 g, and combine the same way, and each row then carries the indexed values the thresholds were checked against; additives_tag is the one exception, filtering only on searches carrying neither query nor nutrient_filters. Tag filter values are canonical tag IDs (e.g. "en:organic", "en:no-gluten") — use off_browse_taxonomy to resolve human terms to tag IDs. A case variant, synonym, or singular of a tag is resolved to its canonical ID where Open Food Facts recognizes it; anything else is matched exactly. exclude_allergens and exclude_traces drop products that declare an allergen or a "may contain" trace, but a product with no allergen or trace data entered passes them, so confirm a candidate with off_get_product before relying on it. At least one search parameter is required. The two paths read different indexes: a search carrying query is answered by the text index, a snapshot that lags the live database, while a tag-only search reads the live database and is current — so a recently contributed product can be missing from a text search and present in the same search without query. Data is crowd-sourced; result count reflects contributed products, not all products in the market. Data under ODbL 1.0 — cite Open Food Facts in downstream use.
- **off_compare_products** — Side-by-side nutrition and scoring comparison for 2–10 products per call by barcode; a repeated barcode is compared once, so two identical barcodes yield one row, and barcodes past the 10th distinct one are listed in unprocessed rather than fetched. Returns a normalized table of energy (kcal), fat, saturated fat, sugars, salt, protein, and fiber per 100 g, or per 100 ml for liquids, plus Nutri-Score, NOVA group, and Green-Score. Designed for "which of these cereals is healthiest?" or "compare these pasta brands" workflows. Missing nutrition data for any product is preserved as absent — comparisons are not imputed. A batch is not all-or-nothing: barcodes that resolve are returned even when others fail, with confirmed-missing barcodes listed in not_found and failed fetches listed separately in failed. Scores carry regional formula caveats. Data under ODbL 1.0 — cite Open Food Facts in downstream use.
- **off_browse_taxonomy** — Resolve a human term to the canonical Open Food Facts tag ID that off_search_products filters on. Covers categories, labels/certifications, allergens, additives, countries, NOVA groups, and Nutri-Score grades. Pass a search term to resolve against the Open Food Facts vocabulary, which holds tens of thousands of tags; omitting it returns only a small reference list for each facet except NOVA groups and Nutri-Score grades, which are complete. Most tag IDs use the "en:" prefix (e.g. "en:organic", "en:no-gluten", "en:crustaceans"); NOVA groups return bare digits "1"-"4" and Nutri-Score grades bare letters "a"-"e". Pass the id through to off_search_products exactly as returned. Category tags are frequently plural ("kombucha" resolves to "en:kombuchas"), so use the returned id rather than constructing one.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "openfoodfacts-mcp-server": {
    "command": "npx",
    "args": ["-y","@cyanheads/openfoodfacts-mcp-server"]
  }
}
```

## Documentation

## What openfoodfacts-mcp-server does

openfoodfacts-mcp-server exposes four MCP tools for working with Open Food Facts product data:

- `off_get_product` retrieves a product from a barcode, including ingredients, parsed ingredient structure, allergens, traces, additives, nutrition, tags, images, and Open Food Facts scores.
- `off_search_products` finds products using a text query, canonical tags, allergen or trace exclusions, and nutrient thresholds. Results include identifying and summary fields such as barcodes, names, brands, categories, and scores.
- `off_compare_products` compares products by barcode on nutrition, Nutri-Score, NOVA, and Green-Score. It accepts up to 10 distinct products for processing in one call.
- `off_browse_taxonomy` turns a human term or synonym into canonical IDs for categories, labels, allergens, additives, countries, NOVA groups, and nutrition grades.

Nutrition values are returned per serving and per 100 g, or per 100 ml for liquids where applicable. Product fields come from contributor-entered data, while the listed food grades are returned as Open Food Facts calculates them.

## How it works

The server can communicate over STDIO or Streamable HTTP. A hosted instance is available at `https://openfoodfacts.caseyjhand.com/mcp`; it can also be installed as the npm package `@cyanheads/openfoodfacts-mcp-server` or run through the published Docker image.

Search filters are combined with AND logic. Text searches and nutrient-filtered searches use an index that may lag the live database and only reaches the first 10,000 results. Tag-only searches use the live database through page 10. The taxonomy tool helps agents obtain the exact IDs expected by tag filters, such as a language-qualified category or allergen tag.

The server includes the identifying User-Agent required by Open Food Facts and does not require an API key. Requests use endpoint-specific budgets, and transient failures are retried up to four times.

## Setup and configuration

Install the server in a supported MCP client using its package command, or configure a client to use the hosted Streamable HTTP endpoint. The repository provides direct installation links for Claude Desktop, Cursor, and VS Code. The package also includes an MCP bundle for installation workflows that support it.

No environment variables are required for the Open Food Facts connection. The underlying MCP framework supports optional authentication and storage integrations, but those are framework capabilities rather than requirements for using the food-data tools.

## Tools and capabilities

`off_get_product` accepts a digits-only barcode and can limit the returned fields. Its response distinguishes an explicit “no traces” label from a product for which trace information has not been entered.

`off_search_products` supports up to 18 nutrient filters, tag filters, exclusion lists, sorting, and pagination. Search results report conditions such as capped page sizes, omitted results, truncation, and exclusion coverage.

`off_compare_products` preserves input order, reports missing or failed barcodes separately, and leaves unavailable nutrition values absent instead of estimating them. `off_browse_taxonomy` can search synonyms and returns IDs ready to pass into product searches.

## Limitations and notes

Open Food Facts data is crowd-sourced, so missing fields indicate that information has not been recorded rather than confirming that a product lacks the attribute. Search indexing can be behind the live database, and large result sets are bounded by the documented page and index limits. Regional formula differences apply to Nutri-Score, NOVA, and Green-Score. Taxonomy lookup can fall back to a small offline sample when the live taxonomy is unavailable, with a notice in the response.

_Full upstream README: https://allmcps.com/mcp/openfoodfacts-mcp-server/readme_

