Uses Codecov for code coverage reporting and tracking test coverage metrics
Supports Docker deployment with containerization and Docker Compose orchestration for production environments
Uses environment variable configuration management for API settings and rate limiting parameters
Integrates with Git version control for development workflow and repository management
Hosted on GitHub with CI/CD workflows, issue tracking, and collaborative development features
Uses npm for package management, dependency installation, and build script execution
Displays project status badges for test results, code coverage, and license information
Implemented in TypeScript with full type safety and comprehensive type definitions for food product data
Open Food Facts MCP Server
A comprehensive Model Context Protocol (MCP) server that provides AI assistants with access to the Open Food Facts database. Query detailed food product information, nutritional data, and environmental scores to help users make informed food choices.
🌟 Features
- Product Lookup: Get detailed information by barcode including nutritional facts, ingredients, and scores
- Smart Search: Find products with advanced filtering by categories, brands, nutrition grades, and more
- Nutritional Analysis: Interpret Nutri-Score, NOVA processing groups, and Eco-Score ratings
- Product Comparison: Compare multiple products side-by-side across different criteria
- Dietary Recommendations: Get suggestions based on dietary preferences and restrictions
- Rate Limiting: Built-in rate limiting respects Open Food Facts API constraints
- Docker Ready: Production deployment with Docker and Docker Compose
🚀 Quick Start
Docker Deployment (Recommended)
Local Development
🔧 Configuration
Configure the server via environment variables:
🛠 Available Tools
get_product
Retrieve comprehensive product information by barcode.
Returns: Product name, brand, nutritional scores, ingredients, nutrition facts, and metadata.
search_products
Search products with advanced filtering capabilities.
Filters: Categories, brands, countries, nutrition grades, NOVA groups, sorting options.
analyze_product
Get detailed nutritional analysis and score interpretations.
Returns: Score explanations, nutritional breakdown with health assessments, and processing level details.
compare_products
Compare multiple products across different aspects.
Focus Options: nutrition
, environmental
, processing
, ingredients
.
get_product_suggestions
Get personalized product recommendations.
Dietary Options: vegan, vegetarian, gluten-free, organic, low-fat, low-sugar, high-protein.
🤖 MCP Integration
Add to your MCP client configuration:
Or for local development:
📊 Data & Scores
Nutri-Score
- A-E rating indicating overall nutritional quality
- Green (A/B): Healthier choices
- Red (D/E): Less healthy options
NOVA Groups
- Group 1: Unprocessed/minimally processed foods
- Group 2: Processed culinary ingredients
- Group 3: Processed foods
- Group 4: Ultra-processed foods
Eco-Score
- A-E rating for environmental impact
- Considers packaging, transportation, and production methods
🧪 Development
Testing
Code Quality
Project Structure
📈 Performance
- Rate Limiting: Automatic enforcement of API limits
- Efficient Caching: Smart request deduplication
- Batch Operations: Optimized multi-product comparisons
- Error Recovery: Graceful handling of API failures
🔒 API Limits
The server respects Open Food Facts API rate limits:
- Product queries: 100 requests/minute
- Search queries: 10 requests/minute
- Facet queries: 2 requests/minute
Rate limits are enforced automatically with proper error messaging.
🌍 Data Source
All data comes from Open Food Facts, the largest open food database in the world:
- 900,000+ products from 150+ countries
- Collaborative data maintained by contributors worldwide
- Open Database License ensuring free access to food information
- Real-time updates from the global community
📝 Examples
Basic Product Information
Nutritional Analysis
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes with tests
- Run quality checks (
npm run validate
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Open Food Facts for providing the comprehensive food database
- Model Context Protocol for the MCP specification
- The global community of contributors maintaining food data quality
Need help? Open an issue or check the examples for detailed usage patterns.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI assistants to access the Open Food Facts database to query detailed food product information, nutritional data, and environmental scores. Supports product lookup by barcode, smart search with filtering, nutritional analysis, product comparison, and dietary recommendations to help users make informed food choices.
Related MCP Servers
- AsecurityAlicenseAqualityAllows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.Last updated -1768PythonMIT License
- AsecurityAlicenseAqualityEnables AI assistants to access protein information directly from UniProt, allowing retrieval of protein names, functions, sequences, and organism data by accession number.Last updated -28PythonMIT License
- AsecurityFlicenseAqualityEnables AI assistants to interact with the World Bank open data API, allowing for listing and analysis of indicators across available countries.Last updated -137Python
- -securityFlicense-qualityProvides grocery price and nutritional information search capabilities, allowing AI agents to search for food products, compare prices, and analyze nutritional content across different grocery stores.Last updated -Python