mcpField
O
Open Food Facts

Open Food Facts

Local
github.comHealth3Updated 4d ago

About Open Food Facts

Open Food Facts is an MCP server for searching and contributing to the Open Food Facts food database. It supports product lookups, filtered searches, and authenticated data edits.

Key features

  1. 01Look up products by barcode
  2. 02Search with structured filters or Lucene
  3. 03Autocomplete brands and categories
  4. 04Add or edit product entries
  5. 05Upload and adjust product images
  6. 06Access API endpoints and documentation

Use cases

  1. 01Check nutrition for a named product
  2. 02Find ingredients using a barcode
  3. 03Search cereals by Nutri-Score
  4. 04Add product details or an image

MCP support

Open Food Facts exposes product search, lookup, editing, image, and API-documentation tools to MCP clients. Write operations require credentials.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"domdomegg-openfoodfacts": {
"command": "npx",
"args": [
"-y",
"openfoodfacts-mcp"
],
"env": {
"OFF_USER_AGENT": "<OFF_USER_AGENT>",
"OFF_USER_ID": "<OFF_USER_ID>",
"OFF_PASSWORD": "<OFF_PASSWORD>",
"OFF_COUNTRY": "<OFF_COUNTRY>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>"
}
}
}
}
Run commandnpx -y openfoodfacts-mcp
Environment variables to set
OFF_USER_AGENTUser-Agent string in format 'AppName/Version (email)'. Required by the Open Food Facts API.
OFF_USER_IDOpen Food Facts user ID (optional, needed for write operations).
OFF_PASSWORDSecretOpen Food Facts password (optional, needed for write operations).
OFF_COUNTRYCountry subdomain (default: 'world').
MCP_TRANSPORTTransport type.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmopenfoodfacts-mcp2.6.0

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

openfoodfacts-mcp

MCP server for the Open Food Facts API - search, read, and contribute to the world's largest open food database.

Use Cases

Look up a product by name: "How many calories in a Sainsbury's buffalo chicken wrap?" -> searches by name, finds the product, and returns nutrition data.

Look up a product by barcode: "What's in this product with barcode 3017620422003?" -> fetches Nutella's ingredients, Nutri-Score, and nutrition data.

Find healthy options: "Search for breakfast cereals with Nutri-Score A" -> searches with category and nutrition grade filters.

Contribute data: "Add the product name and brand for barcode 12345678" -> creates or updates a product entry on Open Food Facts.

Explore the database: "What brands of organic chocolate are in the database?" -> uses autocomplete and search to explore.

Setup

Follow the instructions on install-mcp, which generates the right config for your MCP client (Claude Code, Claude Desktop, Cursor, Cline, VS Code, and more).

Set OFF_USER_AGENT to identify your app (e.g. openfoodfacts-mcp/1.2.0 ([email protected])). For write operations (adding/editing products, uploading images), also set OFF_USER_ID and OFF_PASSWORD.

Environment Variables

VariableRequiredDescription
OFF_USER_AGENTYesUser-Agent string, e.g. "AppName/1.0 ([email protected])"
OFF_USER_IDNoOpen Food Facts username (for write operations)
OFF_PASSWORDNoOpen Food Facts password (for write operations)
OFF_COUNTRYNoCountry subdomain (default: world)

Tools

ToolDescriptionAuth
get_productGet product info by barcodeNo
search_products_standardSearch with structured filters (brand, category, Nutri-Score)No
search_products_luceneSearch with Lucene syntax, negation, and boolean logicNo
autocompleteAutocomplete brands, categories, labels, etc.No
add_or_edit_productAdd or update a productYes
upload_imageUpload a product imageYes
select_imageSelect, crop, and rotate an imageYes
call_apiCall any OFF API endpoint directlyDepends
get_api_docsGet OFF API documentationNo

Contributing

Pull requests are welcomed on GitHub! To get started:

  1. Install Git and Node.js
  2. Clone the repository
  3. Install dependencies with npm install
  4. Run npm run test to run tests
  5. Build with npm run build

Releases

Versions follow the semantic versioning spec.

To release:

  1. Use npm version <major | minor | patch> to bump the version
  2. Run git push --follow-tags to push with tags
  3. Wait for GitHub Actions to publish to the NPM registry.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.