Nutrition MCPCook Basic & Pro
nutrition-mcp puts Cook's nutrition data inside the AI tools you already use. It is a
local MCP (Model Context Protocol) server for Claude Code, Claude Desktop, Cursor, ChatGPT and any
other MCP-capable client: your agent gets tools to look up nutrition, sum a whole recipe, convert
units, check allergens, and render Cooklang nutrition reports until every check passes.
It runs as a subprocess of your client over stdio, not as a network service, and calls the Nutrition API for the actual numbers. Nothing runs in the cloud except the lookup itself.
Install
Add this to your MCP client's configuration. The package is published on npm as @cookmd/nutrition-mcp; you need Node.js so that npx is available.
{
"mcpServers": {
"nutrition": {
"command": "npx",
"args": ["-y", "@cookmd/nutrition-mcp"]
}
}
}
Where the config lives
- Claude Code: run
claude mcp add nutrition -- npx -y @cookmd/nutrition-mcp, or add the block above to.mcp.jsonin your recipes folder. - Claude Desktop: add the block to
claude_desktop_config.json(Settings, Developer, Edit Config), then restart the app. - Cursor: add it to
.cursor/mcp.jsonin your project, or the global MCP settings. - Other clients: anything that can launch a stdio MCP server works; use the same command and arguments.
On first run the npm wrapper downloads the prebuilt binary for your platform from the releases page and verifies its SHA-256 checksum before installing. Supported platforms: macOS (Apple Silicon and Intel) and Linux (x86_64 and arm64, glibc 2.35 or newer). Windows builds aren't published yet.
First use: log in
The server needs to know who you are so your Cook subscription unlocks the data. Ask your agent to
run the login tool: it starts a cook.md device login, shows you a short code and a
cook.md/device link, and finishes authenticating in the background once you approve it in
the browser. You only do this once per machine; auth_status reports your login and
subscription state any time.
Using an organization API key instead? Set NUTRITION_API_TOKEN in the server's environment and
the login step is skipped.
Tools
| Tool | What it does |
|---|---|
render_report | The iterate-on-templates loop: renders a jinja nutrition report against a .cook recipe or .menu plan and returns the rendered text, the check results and any ingredients that failed to resolve, so the agent can fix the template or recipe and re-render until clean. |
get_nutrition | Nutrition facts for one ingredient amount. |
aggregate_nutrition | Sum nutrition across many ingredient lines (a whole recipe or meal). |
lookup_ingredient | Fuzzy-search the ingredient catalog for the canonical name and available preparations. |
convert_units | Convert an amount between mass, volume and count units. |
check_category | Check whether an ingredient belongs to a category (dairy, tree nuts, and so on). |
branded_lookup | Look up a packaged product by UPC or text search. |
reference_intakes | Daily reference-intake tables (RDA / DV) for a standard. |
login | cook.md device login. |
auth_status | Report login and subscription status. |
Workflow prompts
The server also ships three workflow prompts, which MCP clients surface as slash commands:
nutrition-report: write a nutrition report template for a recipe or plan and iterate withrender_reportuntil every check passes.meal-planning: build or evaluate a.menumeal plan against nutrition targets.nutrition-goals: adjust a recipe or plan until it hits numeric nutrition targets.
Things to ask
With the server connected and your recipes folder open, prompts like these just work:
- "How much protein and fibre is in
Salmon Bowl.cookper serving?" - "Add up the calories for everything in
Week of 14 Sep.menuand flag any day under 1,800 kcal." - "Write a nutrition report template for this recipe that fails if saturated fat is over 10 g, then fix the recipe until it passes."
- "Does anything in this recipe contain tree nuts?"
- "Convert 2 cups of cooked rice to grams."
The template functions available inside render_report are the same ones documented under
report template nutrition functions.
Environment variables
| Variable | Effect |
|---|---|
NUTRITION_API_URL | Nutrition service base URL. Default https://nutrition.cook.md. |
COOKMD_BASE_URL | cook.md base URL used for device login. Default https://cook.md. |
NUTRITION_API_TOKEN | Optional organization API key. When set, login is skipped and this credential is used instead. |
Who can use it
The server is free and open to install, but the nutrition data it fetches comes with
Cook Basic or Cook Pro. On a free account (or a legacy
free-sync account) login succeeds but the lookup tools return an authorization error.
Ingredient matching currently works for English ingredient names.
Your data
- Runs on your machine. The server is a local process started by your client. Reports render locally.
- Only ingredient lines leave. To resolve nutrition, the ingredient names, amounts, units and preparations from the recipes you point a tool at are sent to
nutrition.cook.md. Your recipe files and collection are not uploaded. - Your agent is yours. What your AI client sends to its own model provider is governed by that client, not by this server.
Troubleshooting
- "npx: command not found". Install Node.js (18 or newer) and restart the client so it picks up the new PATH.
- The server won't start on Windows. Windows builds aren't published yet. Use WSL (Linux x86_64) in the meantime.
- Tools return "unauthorized". Run
auth_status. If you're logged out, runlogin; if you're logged in on a free account, the data needs Cook Basic or Pro. density_unavailable. Cups and spoons need a recorded density. Ask for the amount in grams or ounces instead.ingredient_not_found. Trylookup_ingredientto find the canonical name, and check the ingredient is written in English.- Still stuck? Contact us with your client name and the tool's error text.
More detail lives in the MCP server guide on the API docs site, and releases are on GitHub.