AgentSkillsCN

Skill

技能

SKILL.md

Nutrition MCP Server

USDA FoodData Central integration for nutrition lookup, meal logging, and macro tracking.

Server

bash
cd nutrition-mcp && node src/server.js

Requires USDA_API_KEY env var (free at https://fdc.nal.usda.gov/api-key-signup).

Common Workflows

Search for a food and get details

  1. nutrition { action: "search", query: "chicken breast" } → get fdcId from results
  2. nutrition { action: "get", fdcId: "171477" } → full macro breakdown

Log a meal

  1. Search for the food (above)
  2. meal_log { action: "log", fdcId: "171477", servings: 1, mealType: "lunch" }

Check daily progress

  1. targets { action: "set", calories: 2000, protein: 150, carbs: 200, fat: 65, fiber: 30 } (one-time)
  2. targets { action: "progress" } → shows consumed vs remaining

Compare foods

  • nutrition { action: "compare", fdcIds: ["171477", "171078"] } → side-by-side macros

View meal history

  • meal_log { action: "daily_summary" } → today's totals by meal
  • meal_log { action: "weekly_summary" } → weekly averages
  • meal_log { action: "list", date: "2025-01-15" } → all entries for a date

Storage

  • Logs: ~/.nutrition-mcp/logs/YYYY-MM.json
  • Targets: ~/.nutrition-mcp/targets.json
  • Cache: ~/.nutrition-mcp/cache/ (24h TTL)

Nutrient IDs Reference

Energy=1008, Protein=1003, Fat=1004, Carbs=1005, Fiber=1079, Sugar=2000, Sodium=1093, Cholesterol=1253