Skip to main content
Glama

Healthy Pokes

A calorie tracking MCP (Model Context Protocol) server that integrates meal logging with nutrition data and health metrics.

Features

  • šŸ“ø Process food photos and text descriptions using GPT-4o Vision

  • šŸ„— Automatic nutrition estimation via OpenNutrition MCP

  • šŸ“Š Google Sheets integration for personalized tracking

  • šŸƒ Apple Health integration for activity and weight data

  • šŸ“± SMS interface via Poke platform

Architecture

This MCP server acts as a bridge between multiple services:

  1. OpenAI GPT-4o: Extracts food items from photos/text

  2. OpenNutrition MCP: Provides nutrition data

  3. Google Sheets: Stores user data persistently

  4. Apple Health MCP: Retrieves fitness metrics

  5. Poke Platform: Handles messaging interface

Setup

Prerequisites

  • Python 3.9+

  • Google Cloud Project with Sheets & Drive APIs enabled

  • OpenAI API key

  • Poke API key

Installation

# Clone the repository git clone https://github.com/mattattacks/healthy-pokes.git cd healthy-pokes # Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Set up environment variables cp .env.example .env # Edit .env with your API keys

Environment Variables

Create a .env file with:

OPENAI_API_KEY=your_openai_key POKE_API_KEY=your_poke_key GOOGLE_SERVICE_ACCOUNT_JSON={"type":"service_account"...} HEALTH_DATA_DIR=/path/to/health/exports # Optional

Usage

Running Locally

python server.py

The MCP server will be available at http://localhost:8000/mcp

Deploying to Render

This project includes a render.yaml for easy deployment to Render.

MCP Tools

  • connect_user(email) - Set up Google Sheet for user

  • ingest_image(image_url) - Process food photo

  • parse_text(text) - Process text description

  • estimate_from_items(items) - Get nutrition data

  • log_rows(rows) - Save to Google Sheet

  • today_total() - Calculate daily intake

  • health_summary() - Get Apple Health metrics

  • send_message(text) - Reply via Poke

Development

Project Structure

healthy-pokes/ ā”œā”€ā”€ server.py # Main MCP server ā”œā”€ā”€ tools/ # MCP tool implementations │ ā”œā”€ā”€ __init__.py │ ā”œā”€ā”€ google_sheets.py │ ā”œā”€ā”€ nutrition.py │ ā”œā”€ā”€ vision.py │ └── messaging.py ā”œā”€ā”€ utils/ # Helper functions ā”œā”€ā”€ requirements.txt # Python dependencies ā”œā”€ā”€ render.yaml # Render deployment config └── .env.example # Environment template

Testing

pytest tests/

Contributing

Pull requests are welcome! Please ensure all tests pass and follow the existing code style.

License

MIT

Acknowledgments

Built for the HackMIT Poke Challenge

-
security - not tested
-
license - not tested
-
quality - not tested

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mattattacks/healthy-pokes'

If you have feedback or need assistance with the MCP directory API, please join our Discord server