nutritionapis
v0.1.0
Published
MCP server for nutrition data — search foods, calculate meals, track daily intake. Powered by USDA FoodData Central + Open Food Facts.
Maintainers
Readme
NutritionAPIs
MCP server for nutrition data. Search foods, calculate meals, track daily intake — powered by USDA FoodData Central and Open Food Facts.
Install
npx nutritionapisOr install globally:
npm install -g nutritionapisConfigure in Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"nutritionapis": {
"command": "npx",
"args": ["-y", "nutritionapis"]
}
}
}With your own USDA API key (optional, higher rate limits):
{
"mcpServers": {
"nutritionapis": {
"command": "npx",
"args": ["-y", "nutritionapis"],
"env": {
"USDA_API_KEY": "your-key-here"
}
}
}
}Get a free key at https://fdc.nal.usda.gov/api-key-signup.
Tools
| Tool | Description |
|------|-------------|
| search_food | Search USDA + Open Food Facts for foods. Returns nutrition per 100g. |
| get_food | Get full nutrition profile for a food by ID with portion scaling. |
| calculate_meal | Calculate total nutrition for multiple foods with portions. |
| log_meal | Log foods to daily intake tracker. |
| daily_summary | Get daily nutrition totals and meal log. |
| save_favorite | Save a food with default portion for quick access. |
| list_favorites | List saved favorites with nutrition. |
| remove_favorite | Remove a saved favorite. |
| compare_foods | Side-by-side nutrition comparison table. |
| delete_meal_entry | Remove a logged meal entry. |
Data Sources
- USDA FoodData Central — 400,000+ foods, government-quality data. Foundation and SR Legacy databases.
- Open Food Facts — 3M+ packaged products with barcodes. Community-maintained, global.
All data is cached locally in SQLite (~/.nutritionapis/nutrition.db) for fast repeat lookups.
Examples
"What's in a chicken breast?"
→ Agent calls search_food with query "chicken breast"
"I had 3 eggs and 2 slices of toast for breakfast"
→ Agent calls search_food for each, then log_meal with portions
"How does salmon compare to chicken for protein?"
→ Agent calls search_food for both, then compare_foods
"What have I eaten today?"
→ Agent calls daily_summary
License
MIT
