# FoodEx2 Encoder

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: FoodNotes-org
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/FoodNotes-org/foodex2-encoder
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/foodex2-encoder

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://foodex2-encoder.foodnotes.org/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http foodex2-encoder https://foodex2-encoder.foodnotes.org/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add foodex2-encoder --url https://foodex2-encoder.foodnotes.org/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "foodex2-encoder": {
            "url": "https://foodex2-encoder.foodnotes.org/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "foodex2-encoder": {
            "type": "http",
            "url": "https://foodex2-encoder.foodnotes.org/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http foodex2-encoder https://foodex2-encoder.foodnotes.org/mcp
```

## When to use it
- 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
- Encode “fried rice with chicken” in FoodEx2 and list the facets
- Run “orange juice” through `encode` and explain the base term you picked
- Encode “canned shellfish” and tell me what went into free text

## Similar
- [tao-train-mask-auto-encoder](https://affpapa.org/en/nevibecode/skills/tao-train-mask-auto-encoder.md) — skill · 1600 installs
- [rpg-encoder](https://affpapa.org/en/nevibecode/mcp/rpg-encoder.md) — MCP server · ★ 33 repo stars
- [vector-db-setup](https://affpapa.org/en/nevibecode/skills/vector-db-setup.md) — skill · 266 installs
- [zomato-ai-data-engineering-pipeline](https://affpapa.org/en/nevibecode/skills/zomato-ai-data-engineering-pipeline.md) — skill · 128 installs
- [llm-document-extraction](https://affpapa.org/en/nevibecode/skills/llm-document-extraction.md) — skill · 125 installs
- [embeddings-runtime-stinger](https://affpapa.org/en/nevibecode/skills/embeddings-runtime-stinger.md) — skill · ★ 96 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
