Skip to content

i-am-neon/nutrition-mcp-server-python

Repository files navigation

Nutrition MCP Server Setup

YouTube Walkthrough

Prerequisites

Installation

  1. Download or clone the repo

  2. Create virtual environment and install: Navigate to the folder and run:

python3 -m venv nutrition-env
source nutrition-env/bin/activate
pip install -r requirements.txt
  1. Test the server:
USDA_API_KEY=your_key_here python main.py

Press Ctrl+C to stop.

Claude Desktop Configuration

  1. Generate config automatically:
python generate_config.py

This will output the exact configuration and file location for your system.

  1. Add your API key to the generated config, replacing YOUR_API_KEY_HERE

  2. Restart Claude Desktop

Usage

  • "Search for tofu products"
  • "Get nutrition for FDC ID 16213"
  • "What are the macros for chicken breast?"

Troubleshooting

  • Virtual environment: If source command fails, try nutrition-env\Scripts\activate on Windows
  • API errors: Verify your USDA API key is correct
  • Path errors: Use absolute paths from generate_config.py output
  • Python not found: Try python instead of python3 on Windows

Meal Planning Project Setup

Want to create AI-powered meal plans? Here's how to set up a nutrition-focused Claude project:

1. Create New Project

  • Open Claude Desktop
  • Click "+" to create new project
  • Name it "Meal Planner"

2. Add System Prompt

  • Click the settings icon in your project
  • Copy the system prompt from meal_planner_prompt.md
  • Edit the USER INPUTS section:
    • Change diet type (vegan, keto, etc.)
    • Update calorie/protein targets
    • Replace fixed meals with your breakfast/snacks and their macros

3. Usage

Start conversations with: "I want to plan lunch and dinner for this week. Let's brainstorm some ideas."

The AI will use the nutrition MCP server to calculate exact portions and create detailed meal plans with shopping lists.

About

Python MCP server for USDA nutrition data with meal planning system prompts. Get accurate macros, calories, and ingredients for any food item directly in Claude Desktop. Includes automated meal planner for diet-specific recipes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages