
FoodEx2 Encoder
org.foodnotes由 foodnotes.org 發布官方發布者v1.0.0更新於 Oct 30, 2026
Turn an English food description into an EFSA FoodEx2 code.
概覽
遠端 MCP 伺服器,把英文食品描述轉換成 EFSA FoodEx2 編碼,並附上基礎術語、面描述元與自由文字。
- 可以做什麼
- 把食品描述編碼成 FoodEx2 代碼,回傳代碼、基礎術語、面描述元、自由文字、符合度、方法與簡短說明。
- 以詞法比對與向量檢索查找目錄術語,再走訪 MTX 目錄選出基礎術語。
- 把代碼無法表達的內容(例如目錄中拆成多個術語的群組名稱)記錄為帶標籤的自由文字。
- 適用情境
- 當你需要為食品描述取得 FoodEx2 編碼時使用,例如準備 EFSA 風格的膳食暴露或食品分類資料。它適合逐筆快速編碼,而非批次瀏覽、解碼或驗證目錄。
- 執行需求
- 透過 streamable HTTP 存取的遠端端點,需 OAuth 登入;託管版本未宣告本機安裝或環境變數。自行部署的核心需要 Node.js 20+、用於一次性建置目錄的 Python 3,以及附 API 金鑰(如 FOODEX2_LLM_API_KEY)的 OpenAI 相容模型端點。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 FoodEx2 Encoder,將其新增到工作區。
- 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/org.foodnotes%2Ffoodex2-encoder/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。
{
"mcpServers": {
"foodex2-encoder": {
"type": "http",
"url": "https://foodex2-encoder.foodnotes.org/mcp"
}
}
}README
foodex2-encoder
Library and stdio MCP server that turns an English food description into an EFSA FoodEx2 code (MTX catalogue): base term, facet descriptors, and labelled free text for what the code cannot express.
This repository is the core. A hosted version is available at https://foodex2-encoder.foodnotes.org/ .
Limitations
Check every code before you use it. In particular:
- English input only, including foreign food names commonly used in English.
- Group names the catalogue splits are kept as free text. When a description
uses a name that the catalogue only has as several separate terms, that part
goes to free text instead of the code. For example, canned shellfish is coded
as Canned seafood with
source-commodity=shellfishin free text, rather than Canned seafood made from crustaceans and molluscs. The code is not wrong, but it is broader than the description: Canned seafood also covers other marine animals, such as sea urchins.
What you need
- Node.js 20+
- Python 3 (one-time catalogue build from the vendored EFSA
.ecf) - An OpenAI-compatible model endpoint and API key (OpenRouter is the default)
Install
data/ is generated locally (~25 MB) and is gitignored. Rebuild after updating
the vendor/efsa-catalogues submodule.
The coding rules in src/rules/ (EFSA business rules, facet cardinality, our
own checks) are shared with the FoodEx2 Atlas validator. Their data comes from
rules/cardinality.yaml, rules/conflicts.yaml and
vendor/efsa-business-rules/; after editing those, regenerate the committed
src/rules/rules-data.json with npm run build:rules. Sources, licence and
limits are in rules/efsa-business-rules.md.
Model endpoint
Copy .env (or export the same variables). OpenRouter needs only a key:
Any other OpenAI-compatible endpoint works the same way (FOODEX2_LLM_BASE_URL,
FOODEX2_LLM_API_KEY, FOODEX2_MODEL). The server calls that endpoint for
classify / select / residual steps; your chat client’s subscription is separate.
Try it (CLI)
Lexical hits return in about a second. Descriptions that need a catalogue walk typically take 15–25 seconds.
Try it (MCP stdio)
Point a client at that process. Cursor example (mcp.json):
Tool: encode. It returns the code, base term, facets, free text, fit,
method, and a short explanation. Catalogue lookups, decoding, validation
and EFSA guidance are in the free
FoodEx2 Atlas MCP.
Tests and eval
eval/encode-base-term.yaml is a small, focused regression set: one realistic
case per capability (catalogue synonym, model synonym, named dish, restraint,
and so on). Gold rules can require or forbid facets and free-text fragments;
expected may list several acceptable base codes (any-of).
npm run encode-eval records the model and MTX version, and on a complete run
writes eval/results/encode-base-term.json for publishing or sharing with the
public core repo. Always cite the model named in that file’s _provenance.
Layout
Licence
MIT — see LICENSE. Copyright (c) 2026 e-accent BV.
That grant covers this software. EFSA catalogue files under vendor/efsa-catalogues/
(and generated data/ derived from them) remain subject to EFSA’s terms.
Attribution (eval inputs)
Some food names used as evaluation cases under eval/ were drawn from national
food composition databases. We use food names only (not nutrient values). Those
databases remain under their publishers’ terms:
- CIQUAL (ANSES, France) — ciqual.anses.fr. Cite as: Anses. Table de composition nutritionnelle des aliments Ciqual. Data are available under the Etalab Open Licence 2.0.
- CoFID (UK) — McCance and Widdowson’s Composition of Foods Integrated Dataset, GOV.UK. Contains public sector information licensed under the Open Government Licence v3.0.
來源:README.md,提交 1bf05fe
工具
0版本歷史
1- v1.0.0最新Oct 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分