Cook Nutrition API

MCP server

nutrition-mcp is a local MCP server that puts nutrition evaluation and cooklang report rendering inside AI agent tools — Claude Code, Claude Desktop, Cursor, and any other MCP client. It talks stdio, so it runs as a subprocess of the client rather than as a network service, and calls the same HTTP API documented on this site.

Add it to your client

{
  "mcpServers": {
    "nutrition": {
      "command": "npx",
      "args": ["-y", "@cookmd/nutrition-mcp"]
    }
  }
}

The server is published on npm as @cookmd/nutrition-mcp; prebuilt binaries are on the releases page of cook-md/nutrition-mcp.

First-use auth

On first use, ask the agent to run the login tool — it walks through a cook.md device login (shows a code + URL to approve in the browser, then authenticates in the background). Alternatively, set NUTRITION_API_TOKEN to an org API key to skip login entirely. auth_status reports the current login and Cook Pro subscription state at any time.

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 {rendered, checks, resolve_failures} so an 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).
lookup_ingredient Fuzzy-search the ingredient catalog.
convert_units Convert an amount between units (mass/volume/count).
check_category Check whether an ingredient belongs to a category slug.
branded_lookup Look up a branded/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 + Cook Pro subscription status.

Workflow prompts

The server also ships three workflow prompts that MCP clients surface as slash commands:

Environment variables

Env var Effect
NUTRITION_API_URL Nutrition service base URL. Default https://nutrition.cook.md.
COOKMD_BASE_URL cook.md base URL for device login. Default https://cook.md.
NUTRITION_API_TOKEN Optional org API key/token override — bypasses login when set.

Next steps