# Open Food Facts Alternative MCP

> Open Food Facts Alternative retrieves nutrition facts, ingredients, and environmental scores from a massive global food database. Use your AI agent to analyze specific products by scanning an EAN-13 barcode or searching across millions of items using filters for brand, label (like 'Vegan' or 'Organic'), and nutrient levels.

## Overview
- **Category:** knowledge-management
- **Price:** Free
- **Tags:** nutrition-facts, barcode-scanner, food-database, ingredients-analysis, eco-score

## Description

You gotta connect this server to your AI client if you want access to a massive global food database. It pulls nutrition facts, ingredient lists, and environmental scores for millions of products. When you use the `get_product` tool, you instantly pull out all the details for a single item by feeding it an EAN-13 barcode number. That’s how you get a full record that includes nutritional metrics, eco-scores, and ingredients.

When you need to dig deeper than one product, use `search_products`. This tool lets you query the whole database using keywords combined with structured filters like category, brand name, or specific labels—say, if you only want 'Vegan' items. You can narrow down your search by filtering for nutrient levels too.

The data it pulls is intense. For one product, you get things like Nutri-Score and the NOVA group classification right in the initial readout. When you check ingredient lists, you don't just see names; you can inspect them directly to look out for specific additives, allergens, or any components that are banned.

The nutritional breakdown is detailed too. It gives you 100g metrics on everything: energy, fats, sugars, and proteins. You can compare products side-by-side with this data, making sure your comparison is accurate down to the gram. The database also lets you search across brands while matching specific labels like 'Organic' or filtering by product category.

If you want a full picture of what’s in it, `get_product` handles that. You feed it the barcode and boom—you get energy counts, fat percentages, sugar amounts, protein levels, scores, and ingredients all in one go. It's fast.

When searching, remember `search_products` is your workhorse. You can cross-reference keywords with filters for things like 'low sodium' or 'gluten-free'. This means if you're trying to find a specific type of snack from a certain brand that also happens to be labeled 'Keto,' the tool finds it. It’s powerful.

You shouldn't have to guess what metrics are available; they show up right in the full product record. You can get detailed scores that measure environmental impact, which is huge when you're trying to track down better options. The system doesn't just give numbers; it gives context about how those products stack up against global averages.

It’s designed so your agent handles all the legwork for you. Instead of manually cross-referencing spreadsheets or jumping between different databases, you tell your AI client what you need—say, 'Find me a vegan cereal under 10g of sugar from Brand X'—and it runs that complex query using `search_products`. If you find a candidate item and then need the full details on its energy content and ingredient list, you just hand over the EAN-13 barcode to `get_product`.

The whole point is getting reliable data. You can use the toolset to compare multiple products' 100g breakdowns for fats, proteins, or carbs instantly. It handles everything from identifying major allergens in complex ingredient strings to giving you a clean comparison chart of energy metrics across different brands and categories.

## Tools

### get_product
Retrieves full product details using a specific EAN-13 barcode number.

### search_products
Finds products across the database by matching keywords and applying structured filters (e.g., brand, label).

## Prompt Examples

**Prompt:** 
```
Get product details for barcode 3017620422003.
```

**Response:** 
```
I've retrieved the data for Nutella (400g). It has a Nutri-Score of 'E', contains ingredients like sugar and palm oil, and belongs to the 'Chocolate spreads' category. Would you like to see the full nutritional breakdown?
```

**Prompt:** 
```
Search for 'Organic' dark chocolate brands.
```

**Response:** 
```
I found several organic dark chocolate products. Notable brands include 'Alter Eco' and 'Green & Black's'. Would you like me to list the specific products and their cocoa percentages?
```

**Prompt:** 
```
Find products in the 'Beverages' category that are 'without' additives.
```

**Response:** 
```
Searching the database... I've found several additive-free beverages, including various mineral waters and pure fruit juices like 'Innocent Orange Juice'. Would you like the details for any of these?
```

## Capabilities

### Get product data by barcode
Reads an EAN-13 barcode to retrieve a single, detailed record containing nutritional metrics, scores, and ingredients.

### Search products with filters
Queries the entire database using keywords combined with structured filters like category, brand name, or required labels.

## Use Cases

### Comparing competitors' sugar content
A client wants to know which brand of yogurt is lowest in sugar. They ask the agent, 'Compare three major brands using `get_product`.' The agent runs three separate lookups and returns a structured table showing only the 100g sugar breakdown for comparison.

### Finding ingredient alternatives
A Product Manager must reformulate a product to remove palm oil. They run `search_products` using filters like 'Category: Spread' and 'Exclude Ingredient: Palm Oil.' The agent returns viable alternative brands that fit the required criteria.

### Validating dietary compliance for an app
Building a health app requires knowing if any beverage is truly additive-free. You use `search_products` with filters set to 'Category: Beverages' and 'Additives: None.' The agent returns only compliant products, saving hours of manual data vetting.

### Analyzing product sustainability in a region
A marketing team wants to promote sustainable options. They use `search_products` targeting the local market and filtering specifically for high Eco-Score items. This gives them immediate, quantifiable claims they can make.

## Benefits

- **Targeted Ingredient Checks:** Instead of reading a label manually, you can ask the agent to check for specific allergens (like nuts) across thousands of products. This is crucial when using `get_product` on unknown items.
- **Instant Nutritional Benchmarking:** You don't have to open multiple tabs. Use `get_product` to get detailed 100g breakdowns—energy, fats, sugars—and immediately compare it against a known baseline product.
- **Filtering by Compliance Labels:** Need all 'Vegan' products from the last five years? `search_products` lets you filter by labels like 'Organic' or 'Kosher,' which is impossible with basic text search alone.
- **Environmental Impact Scoring:** Evaluate supply chain choices. You can run searches that specifically require the Eco-Score metric, helping your team select materials or suppliers based on environmental data.
- **Efficiency for R&D Teams:** Stop copying and pasting raw JSON into spreadsheets. The structured output from both `get_product` and `search_products` feeds directly into your workflow for immediate analysis.

## How It Works

The bottom line is: Instead of manually browsing a website, you ask your agent for specific food insights, and it handles the complex database queries for you.

1. Subscribe to this server. You may need to supply a User Agent string to identify your application.
2. Tell your AI agent what you need (e.g., 'Find organic chocolate bars').
3. The agent calls the appropriate tool (`get_product` or `search_products`) and sends structured data, returning clean product metadata.

## Frequently Asked Questions

**How do I use `get_product` for nutrition facts?**
You pass the EAN-13 barcode to the tool. The resulting data object contains detailed 100g breakdowns, including energy, fat, sugars, and proteins.

**Can I search by ingredient name using `search_products`?**
Yes. You can combine keywords (like 'dark chocolate') with filters for specific ingredients or labels ('Organic'). This narrows the results quickly.

**What is Nutri-Score when I run `get_product`?**
Nutri-Score is a rating system attached to the product data. It’s designed to give you a quick visual grade of the product's overall nutritional profile.

**Does `search_products` handle environmental scores?**
Yes, you can filter or search for products based on their integrated Eco-Score metrics. This is useful for sustainability comparisons.

**How do I use `search_products` to filter for products with specific labels like 'Organic' or 'Vegan'?**
You pass the desired label as a keyword filter within your search query. The system filters the global database and returns only items matching that exact label, significantly narrowing results.

**Can I use `get_product` to check multiple EAN-13 barcodes in one batch request?**
Yes, you can structure a single query to pass an array of barcodes. The tool processes each ID sequentially and returns a comprehensive list containing the product data for every valid barcode provided.

**When I run `get_product`, where do I find the detailed 100g nutritional breakdown?**
The full nutrient profile, including energy, fats, sugars, and proteins based on a 100g serving size, is returned in the main data payload. This allows you to accurately compare product compositions side-by-side.

**If I use `get_product` with an invalid or non-existent EAN-13 code, what should I expect?**
The tool returns a specific error message indicating that the barcode was not found in the database. This clean failure response allows your agent to gracefully handle missing data and continue processing other requests.

**How do I look up a specific food item using its barcode?**
Use the `get_product` tool and provide the barcode (EAN-13). The agent will return the product name, ingredients, Nutri-Score, and detailed nutritional facts.

**Can I search for products that are specifically labeled as Organic or Vegan?**
Yes! Use the `search_products` tool and specify the `labels` parameter (e.g., 'Organic' or 'Vegan') to filter the results accordingly.

**Is it possible to filter out products that contain additives?**
Absolutely. When using the `search_products` tool, set the `additives` parameter to 'without' to find products that do not contain any food additives.