Open Food Facts

v2.6.0
io.github.domdomegg/openfoodfacts-mcp Checked 14 hours ago Published 4 months ago

Search and contribute to the Open Food Facts database.

Values you need

VariableWhat it is
OFF_USER_AGENTrequired User-Agent string in format 'AppName/Version (email)'. Required by the Open Food Facts API.
OFF_USER_IDoptional Open Food Facts user ID (optional, needed for write operations).
OFF_PASSWORDoptional secret Open Food Facts password (optional, needed for write operations).
OFF_COUNTRYoptional Country subdomain (default: 'world').

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add openfoodfacts-mcp -e 'OFF_USER_AGENT=<OFF_USER_AGENT>' -- npx -y openfoodfacts-mcp@2.6.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "openfoodfacts-mcp": {
      "args": [
        "-y",
        "openfoodfacts-mcp@2.6.0"
      ],
      "command": "npx",
      "env": {
        "OFF_USER_AGENT": "<OFF_USER_AGENT>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "openfoodfacts-mcp": {
      "args": [
        "-y",
        "openfoodfacts-mcp@2.6.0"
      ],
      "command": "npx",
      "env": {
        "OFF_USER_AGENT": "<OFF_USER_AGENT>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "OFF_USER_AGENT",
      "id": "off-user-agent",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "openfoodfacts-mcp": {
      "args": [
        "-y",
        "openfoodfacts-mcp@2.6.0"
      ],
      "command": "npx",
      "env": {
        "OFF_USER_AGENT": "${input:off-user-agent}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.openfoodfacts-mcp]
command = "npx"
args = ["-y", "openfoodfacts-mcp@2.6.0"]
env = { "OFF_USER_AGENT" = "<OFF_USER_AGENT>" }

For AI agents

  1. Ask the user for: OFF_USER_AGENT. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: get_product, search_products_standard, search_products_lucene, autocomplete, add_or_edit_product, upload_image, select_image, call_api, ….
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json