Get the FREE Ultimate OpenClaw Setup Guide →

OpenFoodFacts

OpenFoodFacts-MCP is a project for managing, processing, and analyzing food product data using Open Food Facts APIs.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jagjeevanak-openfoodfacts-mcp node dist/index.js \
  --env TRANSPORT="stdio"

How to use

Open Food Facts MCP Server exposes a suite of tools that let AI assistants query the Open Food Facts database, retrieve product details by barcode, analyze nutritional information, compare products, and generate recipe ideas. Core tools include searchProducts, getProductByBarcode, analyzeProduct, compareProducts, and suggestRecipes. Category, brand, and advanced search capabilities (searchByCategory, searchByBrand, advancedSearch, autocomplete) help you find relevant products quickly. Nutrition and health tools (getNutriScore, getEcoScore, getAdditivesInfo, getAllergenCheck, checkMultipleAllergens) provide quick assessments of health and allergen considerations. AI Insights tools (getProductAIQuestions, getRandomAIQuestions, getProductInsights, getInsightTypes) offer AI-generated prompts and insights to guide human verification. Price tools (getProductPrices, searchPrices, getRecentPrices) let you explore pricing data.

To use the server with AI assistants, start the server (npm start) and connect via the supported transport methods. For local testing, you can use the included CLI/SDK prompts or connect via HTTP/SSE for browser-based tools. Example workflows show how an AI assistant would issue a sequence of tool calls to search for a product, fetch details by barcode, then run a nutritional analysis or a side-by-side comparison to help users make informed choices. The documentation also provides sample prompts for searching, analyzing, comparing, and creating recipe ideas using Open Food Facts data.

How to install

Prerequisites:

  • Node.js v16.x or higher
  • npm (or yarn)

Installation steps:

  1. Clone or download the repository:
git clone https://github.com/your-org/jagjeevanak-openfoodfacts-mcp.git
cd jagjeevanak-openfoodfacts-mcp
  1. Install dependencies:
npm install
  1. Build the server (if a build step is provided):
npm run build
  1. Start the MCP server:
npm start

Optional: If you deploy the server differently (e.g., via a script or process manager), ensure the server is started with a command matching the mcp_config below (node dist/index.js with the TRANSPORT environment variable).

Additional notes

Notes and tips:

  • The server is designed to be run with Node.js. Use the mcp_config example to integrate with agents that follow the MCP spec.
  • TRANSPORT can be set to stdio for local, in-process communication or to http/sse when using browser-based tools. If you switch transports, make sure the corresponding client is configured to connect to the correct endpoint.
  • To enable price lookups, ensure Open Prices or similar price data sources are accessible or mocked in your environment.
  • Common issues: module resolution errors after build, missing environment variables, or port conflicts when starting an HTTP/SSE transport. Verify the build output path (dist/index.js) and ensure it's accessible by the runtime command.
  • If you customize the server path, update the mcp_config accordingly, e.g., args: ["dist/index.js"] or the actual built entry file path.

Related MCP Servers

Sponsor this space

Reach thousands of developers