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.
Open Food Facts MCP Server
This is a Model Context Protocol (MCP) server implementation for the Open Food Facts project. It provides contextual information about food products to AI-powered development tools using the official Model Context Protocol specification.
Overview
What is the Model Context Protocol?
The Model Context Protocol (MCP) is a standardized way for AI-powered development tools to communicate with code repositories and other data sources. It allows AI tools to understand codebases better by providing structured access to:
- File content and project structure 
- Code relationships and architectural insights 
- Domain-specific knowledge and documentation 
- Interactive tools for code exploration 
How it Benefits Open Food Facts
This MCP server enables:
- Enhanced AI Assistance: LLMs can provide more accurate information about food products 
- Developer Productivity: Automated assistance for common Open Food Facts development tasks 
- Knowledge Sharing: Better understanding of the codebase for contributors 
- User Support: Improved answers to nutrition and product-related questions 
Server Modes
The MCP server supports two operational modes:
Standard Mode
The default mode focused on food product information for general users:
- Access to food product tools only 
- Limited resources focused on product information 
- Simplified interface for non-developer users 
- Optimized for nutritional analysis and food product questions 
Developer Mode
An enhanced mode with additional tools for Open Food Facts contributors:
- All standard food product tools 
- GitHub repository analysis tools 
- Codebase navigation and analysis tools 
- Development-specific resources and prompts 
- Technical documentation and guides 
Available Tools
Food Product Tools (Available in Both Modes)
- 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: Analyze a product from the Open Food Facts database using AI 
- compareProducts: Compare two products from the Open Food Facts database using AI 
- suggestRecipes: Get AI-powered recipe suggestions using a product from the Open Food Facts database 
GitHub Repository Tools (Developer Mode Only)
- analyzeGitHubIssue: Analyze a specific GitHub issue from Open Food Facts repositories using AI 
- analyzeGitHubIssuesByLabel: Analyze multiple GitHub issues with a specific label from Open Food Facts repositories 
- createGitHubIssueRoadmap: Generate a prioritized roadmap based on open GitHub issues from Open Food Facts repositories 
Developer Tools (Developer Mode Only)
- analyzeRepository: Analyze the structure and organization of Open Food Facts repositories 
- explainCode: Get detailed explanations of code segments in the Open Food Facts codebase 
- matchIssues: Find related issues and pull requests for a specific problem 
- generatePR: Generate a pull request template for a code change 
- generateTests: Create test cases for a function or module 
- gitHelper: Get assistance with git commands for Open Food Facts development 
Getting Started
Prerequisites
- Node.js (v16.x or higher) 
- npm or yarn 
- Access to the Open Food Facts API (no authentication required) 
Installation
- Clone the repository or navigate to the MCP server directory: 
- Install dependencies: 
- Build the server: 
- Start the server: 
Standard Mode (default):
Developer Mode:
VS Code Integration
Setting Up MCP in VS Code
- Install the "Model Context Protocol" extension for VS Code 
- Create or update - .vscode/mcp.jsonwith the appropriate configuration:
For Standard Users:
For Developers:
- Use the "MCP: Connect to Server" command in VS Code and select your preferred server mode 
Example Tool Prompts
Below are example prompts you can use with any AI assistant to trigger specific MCP tools. These show natural ways to phrase requests to access each tool's functionality.
Standard Mode Tool Examples
searchProducts
- "Search for chocolate cereals in the Open Food Facts database" 
- "Find products that contain almond milk" 
- "Look for organic yogurt products in Open Food Facts" 
getProductByBarcode
- "Get information about the product with barcode 3017620422003" 
- "What's in the product with EAN 5000159407236?" 
- "Show nutritional data for barcode 8076809513326" 
analyzeProduct
- "Can you analyze Nutella nutritionally?" 
- "Analyze Cheerios cereal and tell me if it's healthy" 
- "Give me an analysis of the ingredients in Oreo cookies" 
compareProducts
- "Compare Nutella and Nocciolata" 
- "Which is healthier: Coke or Pepsi?" 
- "Compare almond milk and soy milk nutritionally" 
suggestRecipes
- "What can I make with Greek yogurt?" 
- "Suggest some recipes using chickpeas" 
- "Give me recipe ideas for quinoa" 
Developer Mode Tool Examples
analyzeGitHubIssue
- "Analyze GitHub issue #1234 in the openfoodfacts-server repository" 
- "What's the status of issue #876 in openfoodfacts-server?" 
- "Give me a summary of GitHub issue #2468" 
analyzeGitHubIssuesByLabel
- "Analyze issues with the 'bug' label in the openfoodfacts-server repository" 
- "What are the common themes in issues labeled 'enhancement'?" 
- "Summarize all issues with the 'documentation' label" 
createGitHubIssueRoadmap
- "Create a roadmap for the openfoodfacts-server repository" 
- "Generate a short-term roadmap for the mobile app improvements" 
- "What should be prioritized for the product search functionality?" 
analyzeRepository
- "Analyze the structure of the Open Food Facts repository" 
- "Give me an overview of the codebase architecture" 
- "What's the overall design of the Open Food Facts codebase?" 
explainCode
- "Explain how the product search functionality works" 
- "How does the taxonomy system work in Open Food Facts?" 
- "Explain the code for handling product images" 
matchIssues
- "Find GitHub issues related to product image processing" 
- "Are there any issues about barcode scanning problems?" 
- "Match issues about the product search functionality" 
generatePR
- "Generate a PR template for fixing the product search endpoint" 
- "I need a pull request for adding a new field to the product schema" 
- "Create a PR for improving error handling" 
generateTests
- "Generate tests for the product search functionality" 
- "Create unit tests for the barcode validation function" 
- "I need test cases for the user authentication flow" 
gitHelper
- "How do I create a new branch for a feature in Open Food Facts?" 
- "What's the proper git workflow for contributing to this project?" 
- "What git commands should I use to update my fork?" 
LLM Connection Methods
You can connect various AI assistants to your Open Food Facts MCP server:
VS Code Extension with GitHub Copilot
- Install the MCP extension for VS Code 
- Configure in - .vscode/mcp.jsonas shown above
- Connect via the VS Code MCP extension UI 
Claude Desktop
- Start your MCP server using HTTP/SSE transport mode: 
- In Claude Desktop, connect to the MCP server at - http://localhost:28375/sse
Other AI Tools (Cursor AI, WindsurfAI, etc.)
- Start your MCP server in your preferred mode 
- Configure the AI tool to connect to your local MCP server 
- Use the example prompts above to access specific tools 
Resources and Prompts
The MCP server provides different sets of resources and prompts based on the active mode:
Standard Mode Resources
- Product information 
- Database schema 
- API documentation 
- Food categories taxonomy 
Developer Mode Additional Resources
- Project structure navigation 
- Code patterns and conventions 
- File organization guides 
- Development templates 
Prompts
The server offers pre-configured prompts for common tasks:
Standard Mode:
- Analyze a food product 
- Compare products 
- Check for additives 
Developer Mode (Additional):
- Debug Perl code 
- Explain codebase structure 
- Implement features 
- Optimize MongoDB queries 
- Create unit tests 
- Review pull requests 
- And many more development-focused prompts 
Using MCP Tools Effectively
For maximum effectiveness when using the MCP tools:
Product Information (Standard Mode)
- Finding Products: - Use - searchProductsto find products by name, brand, or category
- Use - getProductByBarcodewhen you have a specific product barcode
 
- Analysis and Comparison: - Use - analyzeProductfor nutritional insights and health analysis
- Use - compareProductsto directly compare two products
- Use - suggestRecipesto get cooking ideas based on ingredients
 
Development Tasks (Developer Mode)
- Understanding the Codebase: - Use - analyzeRepositoryto grasp the overall structure
- Use - explainCodefor detailed code explanations
 
- Issue Management: - Use - analyzeGitHubIssuefor understanding specific issues
- Use - analyzeGitHubIssuesByLabelfor identifying patterns across issues
- Use - matchIssuesto find related issues for a problem
 
- Contributing Code: - Use - generatePRto create PR templates
- Use - generateTeststo add test coverage
- Use - gitHelperfor git workflow guidance
 
Example User Workflows
Standard Mode Workflow Examples
- Nutritional Analysis: User: "Is Nutella healthy?" MCP Flow: 1. searchProducts to find Nutella 2. getProductByBarcode with the found barcode 3. analyzeProduct for nutritional assessment
- Product Comparison: User: "Which is healthier, Nutella or Nocciolata?" MCP Flow: 1. searchProducts for each product 2. compareProducts using found barcodes 3. Structured comparison of nutritional values
- Recipe Ideas: User: "What can I make with Greek yogurt?" MCP Flow: 1. searchProducts to find Greek yogurt 2. suggestRecipes with the product
Developer Mode Workflow Examples
- Understanding the Codebase: User: "How is the product schema organized?" MCP Flow: 1. explainCode with focus on schema 2. analyzeRepository for related components
- Fixing Issues: User: "Help me debug this Perl error with product validation" MCP Flow: 1. matchIssues to find similar problems 2. explainCode to understand the validation logic
- Contributing: User: "I want to add a new field to the product schema" MCP Flow: 1. explainCode to examine schema structure 2. generatePR to create a PR template 3. generateTests for the new field
Implementation Details
Server Architecture
The MCP server is structured as follows:
- src/cli.ts: Command-line interface with developer mode flag parsing
- src/server.ts: Core server implementation with mode-specific configuration
- src/tools/: Contains all tool implementations- src/tools/index.ts: Central registry that conditionally registers tools based on mode
- src/tools/product-search.ts: Product search and barcode lookup tools
- src/tools/ai-analysis-tool.ts: AI-powered product analysis tools
- src/tools/github-issues-tool.ts: GitHub issue analysis tools (developer mode)
 
- src/resources/: Resource handlers and registry with mode filtering
- src/prompts/: Prompt definitions and handlers with mode filtering
- src/sampling/: Services for interacting with AI models
- src/transport/: Transport layer implementations (stdio, HTTP/SSE)
Command-Line Arguments
The server supports the following command-line arguments:
- --developer: Enable developer mode with additional tools and resources
- --transport=<type>: Set the transport type (stdio, http)
- --port=<number>: Set the HTTP port for HTTP/SSE transport
- --help: Show help information
Debugging and Troubleshooting
Common Issues
- Connection Problems: - Check that the server is running with the correct transport mode 
- Verify port availability when using HTTP/SSE transport 
- Ensure VS Code extension is properly configured 
 
- Missing Tools in Standard Mode: - Developer tools require - --developerflag
- Check if you started the server in standard mode 
 
- GitHub API Rate Limits: - The server uses unauthenticated GitHub API calls which have rate limits 
- Consider connecting to GitHub with authentication for higher limits 
 
Logs
The server outputs logs to help diagnose issues:
- Standard log output shows connection information and errors 
- Server mode and enabled capabilities are displayed at startup 
- Tool invocation and error details are logged 
Contributing
Contributions are welcome! Here are some ways you can improve the MCP server:
- Add more specialized tools for Open Food Facts-specific functionality 
- Enhance the existing tools with more detailed information 
- Improve error handling and validation 
- Add support for more data sources 
Development Workflow
- Make changes in the - src/directory
- Build with - npm run build
- Test both modes: standard and developer 
- Submit a PR with clear documentation of your changes 
License
This project is licensed under the GNU Affero General Public License, the same license as the Open Food Facts project.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
This MCP is used to get realtime food data from OpenFoodFacts database.
OpenFoodFacts is a largest food database in the world.
Related MCP Servers
- -security-license-qualityFastMCP is a comprehensive MCP server allowing secure and standardized data and functionality exposure to LLM applications, offering resources, tools, and prompt management for efficient LLM interactions.Last updated -3MIT License
- Asecurity-licenseAqualityThe MCP server provides an interface to the Datadog API, enabling seamless management of incidents, monitoring, logs, dashboards, metrics, traces, and hosts. Its extensible design allows easy integration of additional Datadog APIs for future expansions.Last updated -4,489103Apache 2.0
- Asecurity-licenseAqualityAn open-source MCP server that connects to various data sources (SQL databases, CSV, Parquet files), allowing AI models to execute SQL queries and generate data visualizations for analytics and business intelligence.Last updated -964MIT License
- Asecurity-licenseAqualityAn MCP server that transforms AI assistants into personal chefs by providing recipe recommendations and meal planning features based on the HowToCook repository.Last updated -5332617