Nutrition MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Nutrition MCP
Introduction
A calorie and macronutrient tracker built around an MCP server. A single Bun process exposes a streamable-HTTP MCP API backed by the OpenNutrition dataset (SQLite + FTS search) and serves a Vue 3 web app — search foods, build recipes, compute macros, and log what you eat.
Tools exposed to your LLM client:
searchIngredient— FTS-backed food search with category/tag filtersgetIngredientMacros— per-100g and per-serving nutrition with measured/unmeasured flagscomputeRecipeMacros— deterministic macro summation for a recipefilterFoods— nutrient ranges and dietary presets (keto, high-protein, …)convertUnits— unit conversion, food-aware where possiblegetServerRecipes— returns every recipe from the server'srecipes/directory (one JSON file per recipe), validated against the export envelope; invalid files are skipped and reported. Directory is read fresh on each call, so newly added files appear without a restart.
All arithmetic happens server-side, so the model never does math or invents nutrition data. Single-user by design: logs, recipes, and favorites live in your browser's IndexedDB and never leave your machine.
Related MCP server: nutrition-mcp
Usage
Requirements: Bun and Docker (for server deployment only).
Clone repository
Download latest OpenNutrition dataset from https://www.opennutrition.app/download and extract to local directory (e.g.
external/opennutrition-dataset-YYYY/)(First run only) Install dependencies and create OpenNutrition.sqlite database
bun install && bun run build:sqlite external/opennutrition-dataset-2025.1/opennutrition_foods.tsvThe TSV is gitignored — obtain the OpenNutrition dataset release first and place it at that path. The build writes
opennutrition.sqlitenext to the TSV.Recommended organization:
mkdir -p data/recipes mv external/opennutrition-dataset-YYYY.MM/opennutrition.sqlite data/Dev Server (Vite) Copy or symlink database to
server/data/and recipes folder toserver/data/recipes/Docker Deploy Adjust the bind mount paths in
docker-compose.yml:... volumes: - "./data/opennutrition.sqlite:app/server/data/opennutrition.sqlite:ro" - "./data/recipes:/app/server/data/recipes:ro" ...Docker Start the container:
docker compose up -d --buildOn Linux, if your user is not uid 1000 and you bind-mount the metrics store, match the container'sbunuser to your uid so mounted files stay owned by you:HOST_UID=$(id -u) HOST_GID=$(id -g) docker compose up -d --build
Web app: http://<host>:3000/nutrition-tracker/
MCP endpoint: http://<host>:3000/mcp — point your chat client (Claude Desktop, OpenWebUI, etc.) at this URL
Metrics & logging
Opt-in server usage/performance metrics (ADR-0031), off by default. Enable with NUTRITION_ENABLE_LOGGING=1 (all variables are documented, commented, in examples/example.env):
Variable | Default | Meaning |
|
|
|
|
| Directory for the writable |
| unset | When set, also append snapshot lines to |
|
|
|
|
|
|
| unset | JSON |
|
| Snapshot windows and log-file rollover follow the container's local clock |
What gets recorded — per request, in a separate SQLite store: UTC timestamp, endpoint (http:/mcp, http:static, http:static:404, mcp:tool:<name>), duration, error flag, a per-day anonymous client hash, and a coarse client bucket (browser, claude-code, codex, opencode, other, unknown). Never recorded: IPs, request payloads, tool arguments, full User-Agents, or anything linkable to a person. Unique clients are counted via a salted hash whose salt is discarded daily — it cannot be reversed, linked across days, or recomputed later.
Output, single-line JSON on stdout:
{"type":"usage-hourly","window":"2026-10-03T12:00:00–12:59:30-04:00","timezone":"America/New_York","requests":{"http:/mcp":37,"mcp:tool:searchIngredient":25},"total":159}
{"type":"usage-daily","window":"2026-10-02T00:00:00–23:59:30-04:00","timezone":"America/New_York","endpoints":{"http:/mcp":{"requests":812,"avgMs":23.4,"errors":3},"mcp:tool:searchIngredient":{"requests":700,"avgMs":41.2,"errors":1}},"uniqueClients":4,"uaBuckets":{"browser":132,"claude-code":668},"total":812}Hourly snapshots emit at H:59:30 local, the daily snapshot at 23:59:30 — so every line belongs to the local day it describes. Idle hours print nothing; snapshots missed by a restart are backfilled from the store on startup.
License
See LICENSE.md
Contributing
See CONTRIBUTING.md
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Nutrition tracking from any MCP client. Free on web and app; MCP access is part of Munch Premium.
A calorie MCP that looks up calories and macros from a 4M+ food catalog, not model guesses.
Food logging, nutrition summaries, and meal photo calorie and macro estimates.
Log meals, check calories and macros, set up a nutrition plan, and search foods.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA remote MCP server for personal nutrition tracking that enables logging meals, tracking macros, and reviewing nutrition history through conversation.40 npm91MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for USDA nutrition data lookup, meal logging, and daily macro tracking.40 npmMIT
- AlicenseBqualityBmaintenanceA local-first nutrition MCP server for food search, barcode lookup, meal estimation, intake logging, hydration, and nutrition coaching workflows.46492 npm11MIT
- AlicenseAqualityAmaintenanceMCP server for Cronometer nutrition tracking, enabling food diary management, nutrition data retrieval, food search, and biometric tracking via Cronometer's mobile REST API.1971MIT