Nutrition

Provides image-based food analysis with calories, protein facts, and nutrition knowledge via MCP-backed FastAPI server.
  • python

1

GitHub Stars

python

Language

4 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "sunilpowar5-langgraph-mcp-nutrition-analyzer": {
      "command": "uvicorn",
      "args": [
        "backend.server:app",
        "--host",
        "0.0.0.0",
        "--port",
        "8000"
      ],
      "env": {
        "GEMINI_API_KEY": "YOUR_API_KEY",
        "LANGCHAIN_API_KEY": "YOUR_API_KEY",
        "NUTRITIONIX_APP_ID": "YOUR_APP_ID",
        "NUTRITIONIX_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You have an MCP server that analyzes food images to identify items, calculates calories and protein, and answers nutrition questions. It combines vision, nutrition data, and knowledge sources to give you actionable insights through an easy-to-use interface while keeping a memory of your conversations for quick follow-ups.

How to use

Upload a food image (jpeg/jpg/png) through the Streamlit-based frontend. The system will identify visible food items, fetch calories and protein information from Nutritionix, and present a concise nutrition breakdown.

Ask follow-up questions to deepen the analysis. For example, you can inquire about the protein content, health implications, or nutrition benefits of specific items. The MCP server supports interactive Q&A by leveraging the connected data sources and memory to recall prior context.

Start a new session at any time to reset the context and begin a fresh analysis.

Example workflow: Upload an image containing a banana and milk. The system will return itemized nutrition like Banana: 105 calories, 1.3g protein; Milk: 103 calories, 8g protein; Total: 208 calories, 9.3g protein. You can then ask what benefits milk provides, and the system will fetch information from Wikipedia.

How to install

Prerequisites: you need Python and a working command line, and you will install dependencies for the backend and frontend components.

# Clone the project repository
git clone https://github.com/sunilpowar5/LangGraph-MCP-Nutrition-Analyzer.git
cd LangGraph-MCP-Nutrition-Analyzer

# Create and activate a virtual environment
python -m venv .venv
# Activate (Windows)
.venv\Scripts\activate
# Activate (macOS/Linux)
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Additional setup and runtime details

Environment variables required by the MCP server components include API keys and IDs for external services.

GEMINI_API_KEY=your_google_gemini_api_key
NUTRITIONIX_APP_ID=your_nutritionix_app_id
NUTRITIONIX_API_KEY=your_nutritionix_api_key
LANGCHAIN_API_KEY=your_langchain_api_key

Run the frontend and backend

To start the Streamlit frontend that provides the user interface, run the frontend entry point.

streamlit run frontend/app.py

Optional: run the backend MCP server locally

If you want to run the backend MCP server locally, start the FastAPI app using a standard ASGI server.

uvicorn backend.server:app --host 0.0.0.0 --port 8000

Available tools

food_recognition

Identifies visible food items in an uploaded image using vision models and returns item names with confidence scores.

nutrition_facts

Fetches calories, protein, and other nutrition facts for identified items from the Nutritionix API.

qa_answer

Answers follow-up nutrition questions by querying the integrated knowledge sources and maintaining context.

wikipedia_lookup

Retrieves nutrition benefits and related information from Wikipedia to supplement item analysis.

memory_saver

Maintains conversation history and supports context-aware follow-ups during a session.

streamlit_ui

Provides a simple, interactive frontend for uploading images and viewing results.

mcp_backend

Exposes the FastAPI MCP server that serves nutrition tools and handles requests.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational