Get the FREE Ultimate OpenClaw Setup Guide →

openfoodfacts

MCP Server for OpenFoodFacts using the Parquet product database

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio noot-app-openfoodfacts-mcp-server ./openfoodfacts-mcp-server --stdio \
  --env ENV="development" \
  --env DATA_DIR="/full/path/to/openfoodfacts-mcp-server/data" \
  --env OPENFOODFACTS_MCP_TOKEN="your-secret-token"

How to use

This MCP server provides access to the Open Food Facts dataset via a fast DuckDB-backed store with Parquet data. It supports two execution modes: STDIO for local Claude Desktop integration and HTTP for remote deployments. In STDIO mode you run the server with the --stdio flag, and communication happens over stdio pipes. In HTTP mode (default), the server serves JSON-RPC 2.0 requests over HTTP with Bearer token authentication (except the /health endpoint). The server exposes tools to search products and fetch by barcode, including a lightweight variant that reduces returned fields to save on token usage.

Available tools:

  • search_products_by_brand_and_name: Search products by name and brand, returning a rich set of fields.
  • search_by_barcode: Find a product by its barcode (UPC/EAN).
  • search_products_by_brand_and_name_simplified: A lighter version of the search that returns fewer fields to save on token usage.

To use them, build or run the server according to your environment, then issue JSON-RPC calls to the /mcp endpoint in HTTP mode or use the stdio bridge in STDIO mode. For Claude Desktop integration, supply the correct command and arguments in your Claude MCP config and provide any required environment variables (e.g., authentication token and data directory).

How to install

Prerequisites:

  • Git
  • Go (for building from source) or prebuilt binary
  • Optional: Docker if you prefer containerized usage

Install from source (STDIO or HTTP):

  1. Clone the repository git clone https://github.com/noot-app/openfoodfacts-mcp-server.git cd openfoodfacts-mcp-server

  2. Build the binary (Go-based project setup shown in README examples) script/build --simple

    Alternatively, build directly from Go sources if provided, e.g.:

    go build -o openfoodfacts-mcp-server ./cmd/openfoodfacts-mcp-server

  3. Fetch the database (once or on update) ./openfoodfacts-mcp-server --fetch-db

  4. Run in STDIO mode for Claude Desktop integration ./openfoodfacts-mcp-server --stdio

  5. Run in HTTP mode for remote deployment ./openfoodfacts-mcp-server

If you prefer Docker, you can containerize using the Dockerfile provided in the repo and run with appropriate environment variables for token, data directory, and DuckDB tuning.

Additional notes

Tips and considerations:

  • In HTTP mode, protect the MCP with a Bearer token (OPENFOODFACTS_MCP_TOKEN). The /health endpoint is unauthenticated.
  • Configure DATA_DIR to control where the parquet dataset is stored locally. A dedicated data directory helps with backups and upgrades.
  • DuckDB tuning: adjust DUCKDB_MEMORY_LIMIT, DUCKDB_THREADS, and DUCKDB_CHECKPOINT_THRESHOLD based on available memory and workload.
  • When using STDIO mode, ensure Claude Desktop is configured with the correct path to the openfoodfacts-mcp-server binary and pass --stdio as an argument.
  • The server automatically handles dataset updates and uses file locking to ensure safe concurrent access.
  • If you encounter indexing or performance issues with large parquet datasets, consider increasing DUCKDB_THREADS and enabling DUCKDB_PRESERVE_INSERTION_ORDER depending on your workload.

Related MCP Servers

Sponsor this space

Reach thousands of developers