Offers git workflow assistance through the gitHelper tool to support Open Food Facts development processes.
Provides tools for analyzing GitHub issues, creating issue roadmaps, and accessing Open Food Facts repositories for development tasks.
Enables connection to the Open Food Facts MCP server through VS Code extension to enhance AI assistance with food product information and development tools.
Supports optimization of MongoDB queries in developer mode with specific prompts for database operations.
Required for running the MCP server and supported as part of the development environment.
Supported as a package manager for installing and managing the MCP server dependencies.
Provides development support for Perl code with debugging assistance and code explanation tools for the Open Food Facts codebase.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenFoodFacts-mcpwhat's the Nutri-Score for Nutella?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Open Food Facts MCP Server
This is a Model Context Protocol (MCP) server implementation for Open Food Facts. It enables AI assistants to access food product information, providing nutritional analysis, product comparisons, and recipe suggestions using the official Model Context Protocol specification.
Benefits for Food-Aware Consumers
This MCP server enables:
Nutritional Intelligence: Get AI-powered analysis of food products and their health implications
Informed Choices: Compare products to make better dietary decisions
Recipe Ideas: Discover recipes based on products you have
Dietary Support: Understand allergens, additives, and dietary compatibility
Available Tools
Core Product Tools
searchProducts: Search for products in the Open Food Facts database by name, brand, category, or other keywords
getProductByBarcode: Get detailed information about a product by its barcode (EAN, UPC, etc.)
analyzeProduct: Get AI-powered nutritional analysis of a food product
compareProducts: Compare two products with AI-powered insights
suggestRecipes: Get AI-powered recipe suggestions using a product
Category & Search Tools
searchByCategory: Search products within a specific food category (e.g., beverages, snacks, dairy, cereals)
searchByBrand: Find all products from a specific brand
advancedSearch: Advanced product search with multiple filters including category, brand, Nutri-Score, Eco-Score, NOVA group, allergen-free options, labels, and country
autocomplete: Get autocomplete suggestions for categories, brands, labels, ingredients, allergens, or additives
Nutrition & Health Tools
getNutriScore: Get the Nutri-Score grade (A-E) for a product - quick health assessment at a glance
getEcoScore: Get the Eco-Score (environmental impact rating A-E) for a product
getAdditivesInfo: List all additives in a product with their E-numbers and NOVA processing level
getAllergenCheck: Check if a product contains a specific allergen (gluten, milk, eggs, nuts, peanuts, soy, fish, shellfish, etc.)
checkMultipleAllergens: Check if a product contains any of multiple allergens at once
AI Insights Tools
getProductAIQuestions: Get AI-generated questions about a product that need human verification
getRandomAIQuestions: Get random AI-generated questions from Robotoff that need human verification - great for community contribution
getProductInsights: Get AI-generated insights about products (detected labels, categories, ingredients issues, etc.)
getInsightTypes: Get a summary of available AI insight types in Robotoff
Price Tools
getProductPrices: Get price history and current prices for a product from Open Prices
searchPrices: Search for prices with filters (currency, country, date range)
getRecentPrices: Get recently added prices to discover what's available
Related MCP server: mcp-server-datadog
Getting Started
Prerequisites
Node.js (v16.x or higher)
npm or yarn
Installation
Clone or download this repository
Install dependencies:
Build the server:
Start the server:
Using with AI Assistants
Claude Desktop
Start the MCP server:
Add to your Claude Desktop configuration (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS):
VS Code with GitHub Copilot
Install the "Model Context Protocol" extension for VS Code
Create
.vscode/mcp.json:
Other AI Tools
The server supports HTTP/SSE transport for browser-based AI tools:
Then connect your AI tool to http://localhost:3000/sse
Example Conversations
Here are natural ways to ask your AI assistant to use the Open Food Facts tools:
Searching for Products
"Search for chocolate cereals in the Open Food Facts database"
"Find products that contain almond milk"
"Look for organic yogurt products"
Getting Product Details
"Get information about the product with barcode 3017620422003"
"What's in the product with EAN 5000159407236?"
"Show me nutritional data for barcode 8076809513326"
Analyzing Products
"Can you analyze Nutella nutritionally?"
"Analyze Cheerios cereal and tell me if it's healthy"
"Give me a health analysis of Oreo cookies"
"Is the product with barcode 3017620422003 healthy?"
Comparing Products
"Compare Nutella and Nocciolata"
"Which is healthier: Coke or Pepsi?"
"Compare almond milk and soy milk nutritionally"
"Compare the products with barcodes 3017620422003 and 5000159407236"
Recipe Suggestions
"What can I make with Greek yogurt?"
"Suggest some recipes using chickpeas"
"Give me recipe ideas for quinoa"
"What recipes can I make with the product 3017620422003?"
Category & Brand Searches
"Show me all products in the beverages category"
"Find all Nestlé products"
"Search for organic products with Nutri-Score A"
"Find vegan snacks with good Eco-Score"
Allergen Checks
"Does Nutella contain gluten?"
"Check if this product is safe for someone allergic to milk and eggs"
"Is barcode 3017620422003 peanut-free?"
"What allergens are in Cheerios?"
Price Lookups
"What's the current price of Nutella?"
"Show me recent prices for products in France"
"Compare prices for barcode 3017620422003"
Resources and Prompts
The MCP server provides helpful resources and prompts:
Resources
The server provides educational resources to help you understand food data:
Quick Help Guide: How to use the Open Food Facts tools - quick reference
Nutri-Score Guide: Understanding Nutri-Score health ratings (A-E)
Eco-Score Guide: Understanding Eco-Score environmental ratings (A-E)
Allergens Reference: Common food allergens and where they hide
Food Additives Guide: Understanding E-numbers and food additives
NOVA Processing Guide: Understanding food processing levels (1-4)
Prompts
Pre-configured prompts help you get started quickly:
analyze-product: Get detailed nutritional analysis
compare-products: Compare two products side-by-side
find-healthy-alternatives: Find healthier alternatives to a product
check-allergens: Check if a product is safe for your allergies
whats-for-dinner: Get recipe ideas using a product
How It Works
The MCP server acts as a bridge between AI assistants and the Open Food Facts database:
Your Question: You ask your AI assistant about food products
Tool Detection: The AI recognizes it needs Open Food Facts data
MCP Request: The AI calls the appropriate MCP tool
Data Retrieval: The server fetches data from Open Food Facts
AI Analysis: The AI processes the data and responds to you
Example Workflows
Making Healthier Choices
Comparing Options
Recipe Planning
Technical Details
Server Architecture
The server follows a modular architecture for maintainability and scalability:
Core Server
src/index.ts: Entry pointsrc/server.ts: Core MCP server implementation with resource and prompt registrationsrc/cli.ts: CLI interface for development
Tools (Modular Design)
src/tools/index.ts: Tool registration orchestrator and core product toolssrc/tools/product-search.ts: Product search and barcode lookup utilitiessrc/tools/category-tools.ts: Category and brand search toolssrc/tools/nutrition-tools.ts: Nutrition scores, allergen checks, and additive informationsrc/tools/insights-tools.ts: AI-generated insights from Robotoffsrc/tools/price-tools.ts: Product pricing data from Open Pricessrc/tools/types.ts: Shared type definitions and interfacessrc/tools/helpers.ts: Reusable helper functions for all tools
Resources & Services
src/resources/: Resource handlers for guides and documentationresource-registry.ts: Resource registration systemstatic-resources.ts: Static resource content (guides, references)
src/sampling/: AI model integration for analysis and recipe generationsampling-service.ts: MCP sampling integration for AI-powered features
Infrastructure
src/transport/: Communication layer (stdio for CLI/editors, HTTP for browsers)src/config/: Server configuration
Data Source
All product data comes from Open Food Facts, a free, open, collaborative database of food products from around the world.
Troubleshooting
Server Won't Start
Ensure Node.js v16+ is installed
Run
npm installto install dependenciesCheck that port 3000 is available (for HTTP mode)
AI Can't Find Tools
Verify the MCP server is running
Check your AI assistant's MCP configuration
Ensure the transport type matches (stdio vs HTTP)
Product Not Found
Try searching first with
searchProductsVerify the barcode is correct (8-14 digits)
Some products may not be in the database yet
Slow Responses
The server fetches real-time data from Open Food Facts
First requests may be slower as data is retrieved
Internet connection speed affects performance
Contributing
We welcome contributions! You can help by:
Adding support for more food databases
Improving AI analysis prompts
Enhancing error handling
Adding new tools for dietary tracking
Improving documentation
About Open Food Facts
Open Food Facts is a food products database made by everyone, for everyone. It's a collaborative project that collects information about food products from around the world, including:
Ingredients
Nutritional facts
Allergens
Environmental impact
Health scores (Nutri-Score, NOVA)
Learn more at https://world.openfoodfacts.org/
License
This project is licensed under the GNU Affero General Public License v3.0, consistent with the Open Food Facts project.
Support
Open Food Facts Website: https://world.openfoodfacts.org/
Open Food Facts GitHub: https://github.com/openfoodfacts
Model Context Protocol: https://modelcontextprotocol.io/
Made with care for food-aware consumers everywhere