FoodEx2 Encoder — Claude Code MCP server: FoodEx2 codes
FoodEx2 Encoder takes a food description written in English and returns an EFSA FoodEx2 code, with the base term, facets and free text for whatever the code cannot hold.
MIT updated 2026-10-23
claude mcp add --transport http foodex2-encoder https://foodex2-encoder.foodnotes.org/mcpWhat FoodEx2 Encoder does
The server works through the MTX catalogue in stages: lexical lookup first, then a walk down the tree, term selection and residuals. There is a single tool, encode. It answers with the code, base term, facets, free text, a fit score, the method used and a short explanation.
Lexical matches come back in roughly a second. Anything that needs a catalogue walk usually runs 15–25 seconds. Input has to be English, foreign dish names included when English already uses them.
Node.js 20+ is required, plus Python 3 for the one-time catalogue build from the vendored .ecf file and a key for an OpenAI-compatible endpoint (OpenRouter by default). Check each code yourself. Where the catalogue only knows a name as several separate terms, that part lands in free text and the code ends up broader than the description.
What it helps with
- get a FoodEx2 code for a dish name
- split a product description into base term and facets
- move what the code cannot express into free text
- encode a batch from the CLI without a chat client
- compare model output against the gold set in
eval/encode-base-term.yaml
Example prompts for the agent
- Encode “fried rice with chicken” in FoodEx2 and list the facets
- Run “orange juice” through
encodeand explain the base term you picked - Encode “canned shellfish” and tell me what went into free text
How to install FoodEx2 Encoder
Platform CLI: remote server
claude mcp add --transport http foodex2-encoder https://foodex2-encoder.foodnotes.org/mcpPlatform CLI: remote server
codex mcp add foodex2-encoder --url https://foodex2-encoder.foodnotes.org/mcpConfig file
{
"mcpServers": {
"foodex2-encoder": {
"url": "https://foodex2-encoder.foodnotes.org/mcp"
}
}
}Config file
{
"servers": {
"foodex2-encoder": {
"type": "http",
"url": "https://foodex2-encoder.foodnotes.org/mcp"
}
}
}Platform CLI: remote server
gemini mcp add -t http foodex2-encoder https://foodex2-encoder.foodnotes.org/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about FoodEx2 Encoder
How do I install FoodEx2 Encoder in Claude Code?
Run claude mcp add --transport http foodex2-encoder https://foodex2-encoder.foodnotes.org/mcp. That connects the hosted server over HTTP.
What does FoodEx2 Encoder do?
It maps an English food description to an EFSA FoodEx2 code and returns the base term, facets and free text for the parts the code misses.
Why is the returned code sometimes broader than the description?
Some names exist in the catalogue only as several separate terms. The server then picks the more general term and puts the detail in free text — “canned shellfish” becomes canned seafood with the shellfish noted separately.