
Open Food Facts
io.github.domdomegg由 GitHub 账号 domdomegg 发布v2.6.0更新于 Oct 24, 2026
Search and contribute to the Open Food Facts database.
概览
让助手搜索 Open Food Facts 数据库中的产品、营养与配料信息,并可选择性地贡献产品数据。
- 可以做什么
- 封装 Open Food Facts API,提供按条码获取产品信息、按品牌、类别或 Nutri-Score 进行结构化搜索、使用 Lucene 语法进行布尔搜索,以及品牌、类别和标签自动补全等工具。需要认证的工具可新增或编辑产品、上传产品图片,并对图片进行选择、裁剪和旋转。通用工具 call_api 可访问任意 Open Food Facts 接口,get_api_docs 返回 API 文档。
- 适用场景
- 适合助手需要食品产品信息的场景:热量、配料、Nutri-Score,或按品牌与类别查询,以及按营养标准筛选产品。若希望助手不仅读取、还能新增或更新 Open Food Facts 中的条目,也同样适用。
- 运行要求
- 以 stdio 方式在本地运行,通常通过 npx 从 npm 包 openfoodfacts-mcp 启动。需要设置 MCP_TRANSPORT 和 OFF_USER_AGENT 环境变量;OFF_USER_AGENT 必须符合 'AppName/Version (email)' 格式,这是 Open Food Facts API 的要求。OFF_COUNTRY 可选,用于指定国家子域(默认 world)。写入操作还需要 OFF_USER_ID 和 OFF_PASSWORD。需要访问 Open Food Facts 的网络连接。
安装
在 SourceWeft 中
- 打开 控制台中的 Open Food Facts,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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
Tools
Contributing
Pull requests are welcomed on GitHub! To get started:
- Install Git and Node.js
- Clone the repository
- Install dependencies with
npm install - Run
npm run testto run tests - Build with
npm run build
Releases
Versions follow the semantic versioning spec.
To release:
- Use
npm version <major | minor | patch>to bump the version - Run
git push --follow-tagsto push with tags - Wait for GitHub Actions to publish to the NPM registry.
来源:README.md,提交 be8b293
工具
0版本历史
1- v2.6.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分