Connect AI assistants to the Open Food Facts database to search food products, retrieve barcode information, and compare ingredients, nutritional values, Nutri-Score, NOVA, and Eco-Score. Includes Python source code, an interactive MCP Chat demo, and validation documentation.

Building AI applications that work with food products, ingredients, and nutritional information often requires integrating external databases, handling APIs, and processing complex product data.
The Open Food Facts MCP Server simplifies this process by connecting AI agents directly to the Open Food Facts database through the Model Context Protocol (MCP).
Developers can enable their AI assistants to search food products, retrieve detailed nutritional information, compare products, and explore food classifications using natural-language requests.
The server is read-only, requires no API key, and is designed for integration into MCP-compatible AI applications.

Integrate food product intelligence into a variety of AI applications:
AI Nutrition Assistants: Retrieve product ingredients, nutritional values, and Nutri-Score information.
Food Comparison Agents: Compare multiple products based on nutritional values, NOVA classification, and Eco-Score.
Shopping Recommendation Agents: Help users explore and compare food products based on available nutritional information and preferences.
Barcode Lookup Applications: Retrieve product information from barcodes.
Food Research Tools: Explore food categories, brands, labels, allergens, and product classifications.
The MCP server provides a reusable integration layer, allowing developers to focus on building AI applications rather than implementing the underlying product-data API calls.
The server exposes five tools that AI agents can call automatically.
MCP Tool | Function |
|---|---|
| Search products by name, brand, category, country, labels, stores, or nutritional classifications |
| Retrieve detailed product information using a barcode |
| Compare 2–10 products based on nutritional values and food classifications |
| Discover valid search filters, taxonomy identifiers, and autocomplete suggestions |
| Explore popular categories, brands, countries, labels, and nutritional grade distributions |
"Find breakfast cereals with Nutri-Score A available in Germany."
"Compare the nutritional values of these three products."
"What are the ingredients and allergens of this product barcode?"
"Find plant-based milk products and compare their nutritional information."
"Show me popular food categories and brands in Germany."
The AI assistant selects the appropriate MCP tools and uses the returned product information to answer the request.
You don't need to integrate the server into an existing AI application to explore its capabilities.
The downloadable package also includes MCP Chat, a local web application that allows you to interact with the MCP server through natural-language conversations.
With MCP Chat, you can:
Connect to an AI model through OpenRouter.
Search and compare food products using conversational questions.
Observe how the AI model selects and calls MCP tools.
Inspect tool arguments and returned results.
Experiment with different use cases before integrating the server into your own AI application.
The chat demo requires an OpenRouter API key and internet access. The MCP server itself does not require an API key, but it needs internet access to retrieve product data from Open Food Facts.
1. Download and extract the ZIP file
Download the asset from Alinme and extract it to your computer.
2. Install the dependencies
Make sure Python 3.10+ and uv are installed.
Open a terminal in the extracted MCP server directory:
uv sync3. Start the MCP server
uv run openfoodfacts-mcpThe server communicates through MCP's standard input/output (stdio) transport and can be connected to compatible AI clients.
4. Run the included MCP Chat demo
Open another terminal in the mcp-chat directory:
uv sync
uv run python app.pyOpen the following address in your browser:
http://127.0.0.1:8765
Configure your OpenRouter model and API key in the chat settings, select the Open Food Facts MCP server if necessary, and start exploring its capabilities.
5. Integrate it into your own AI application
You can connect the server to compatible clients such as Claude Desktop, Claude Code, or your own MCP-enabled application.
For example, configure Claude Desktop using:
{
"mcpServers": {
"openfoodfacts": {
"command": "uv",
"args": [
"run",
"--quiet",
"--directory",
"/absolute/path/to/openfoodfacts-mcp",
"openfoodfacts-mcp"
]
}
}
}Replace the example path with the directory where you extracted the asset.
The downloadable ZIP package includes:
Complete Python source code for the Open Food Facts MCP server.
Five read-only MCP tools for food product discovery, barcode lookup, and comparison.
MCP Chat application for testing and interacting with the tools using an AI model.
Automated tests for verifying MCP functionality.
API research and validation documentation covering supported endpoints, test results, data limitations, and integration behavior.
Setup instructions and configuration files for local development and integration.
MIT-licensed MCP implementation, allowing modification and reuse under the license terms.
Feature | Details |
|---|---|
Protocol | Model Context Protocol (MCP) |
Programming language | Python 3.10+ |
Transport | stdio |
Data source | Open Food Facts |
Product search | Search-a-licious |
Authentication | No API key required for product retrieval |
Network | Internet required |
Operations | Read-only |
MCP implementation license | MIT |
Product database license | ODbL |
This MCP server retrieves publicly available, community-contributed information from Open Food Facts.
Please consider the following limitations:
Product information may be incomplete, outdated, or inaccurate.
Some products may not contain Nutri-Score, NOVA, or Eco-Score information.
Search results may differ from current product details because the search index can lag behind live records.
Retailer-specific prices and real-time stock availability are not reliably supported.
External API rate limits apply, and some requests may take several seconds.
Product data and images have separate licensing and attribution requirements.
This implementation is unofficial and is not affiliated with or endorsed by Open Food Facts.
After exploring the MCP server using the included chat demo, developers can integrate it into their own AI applications or extend its functionality.
Possible next steps include:
Building personalized food recommendation agents.
Developing AI-powered grocery comparison applications.
Combining food product data with other authorized data sources.
Creating nutrition research assistants.
Integrating the MCP server into multi-agent workflows.
The included source code, automated tests, and validation documentation provide a foundation for further development.