Odel
Nutrition MCP

Nutrition MCP

@akutishevskyDeveloper Tools17TypeScriptMITUpdated 1w ago

Personal nutrition tracking — log meals, track macros, and review history through conversation.

Server endpointStreamable HTTP

This is the third-party server itself — Odel doesn't run it. Hitting this URL directly talks straight to the upstream server with no auth or proxying. Connect through Odel to front it with managed auth.

Nutrition MCP

A remote MCP server for personal nutrition tracking — log meals, track macros, and review nutrition history through conversation.

Help me pay for the servers on Patreon

Quick Start

Already hosted and ready to use — just connect it to your MCP client:

https://nutrition-mcp.com/mcp

On Claude.ai: Customize → Connectors → + → Add custom connector → paste the URL → Connect

On first connect you'll be asked to register with an email and password. Your data persists across reconnections.

Demo

Demo

Read the story behind it: How I Replaced MyFitnessPal and Other Apps with a Single MCP Server

Tech Stack

  • Bun — runtime and package manager
  • Hono — HTTP framework
  • MCP SDK — Model Context Protocol over Streamable HTTP
  • Supabase — PostgreSQL database + user authentication
  • OAuth 2.0 — authentication for Claude.ai connectors

MCP Tools

ToolDescription
log_mealLog a meal with description, type, calories, macros, notes
get_meals_todayGet all meals logged today
get_meals_by_dateGet meals for a specific date (YYYY-MM-DD)
get_meals_by_date_rangeGet meals between two dates (inclusive)
get_nutrition_summaryDaily nutrition totals + goal progress for a date range
update_mealUpdate any fields of an existing meal
delete_mealDelete a meal by ID
set_nutrition_goalsSet daily calorie, macro, and water targets
get_nutrition_goalsGet the current daily targets
get_goal_progressGet intake vs. targets for a given day (default: today)
log_waterLog a hydration entry in milliliters
get_water_todayGet today's water intake total and entries
get_water_by_dateGet water intake for a specific date
delete_waterDelete a water log entry by ID
get_trends7/14/30-day averages, std dev, streaks, day-of-week, best/worst day
get_meal_patternsPre-aggregated behavioural patterns (breakfast effect, late dinner, weekend vs weekday, outliers)
set_timezoneSet the user's IANA timezone (e.g. America/Los_Angeles)
get_timezoneGet the user's configured timezone
delete_accountPermanently delete account and all associated data

MCP Resources

URIDescription
nutrition://weekly-summaryRolling 7-day digest (averages vs targets, best/roughest day) for proactive pulls

Self-hosting

1. Supabase setup

  1. Create a Supabase project.

  2. Enable Email Auth (Authentication → Providers → Email) and disable email confirmation.

  3. Apply the schema. The full schema lives in supabase/migrations/. With the Supabase CLI:

    supabase link --project-ref <your-project-ref>
    supabase db push
    

    This creates every table, index, RLS policy, and foreign key the app needs. No local Postgres is involved — migrations run against your hosted project.

  4. Copy the service role key from Project Settings → API and use it as SUPABASE_SECRET_KEY.

2. Environment variables

VariableDescription
SUPABASE_URLYour Supabase project URL
SUPABASE_SECRET_KEYSupabase service role key (bypasses RLS)
OAUTH_CLIENT_IDRandom string for OAuth client identification
OAUTH_CLIENT_SECRETRandom string for OAuth client authentication
PORTServer port (default: 8080)

Note: The HTML files in public/ include a Google Analytics tag (G-1K4HRB2R8X). If you're self-hosting, remove or replace the gtag snippet in public/index.html, public/login.html, and public/privacy.html.

Generate OAuth credentials:

openssl rand -hex 16   # use as OAUTH_CLIENT_ID
openssl rand -hex 32   # use as OAUTH_CLIENT_SECRET

Development

bun install
cp .env.example .env   # fill in your credentials
bun run dev             # starts with hot reload on http://localhost:8080

Connect to Claude.ai

  1. Open Claude.ai and click Customize
  2. Click Connectors, then the + button
  3. Click Add custom connector
  4. Fill in:
    • Name: Nutrition Tracker
    • Remote MCP Server URL: https://nutrition-mcp.com/mcp
  5. Click Connect — sign in or register when prompted
  6. After signing in, Claude can use your nutrition tools. If you reconnect later, sign in with the same email and password to keep your data.

API Endpoints

EndpointDescription
GET /healthHealth check
GET /.well-known/oauth-authorization-serverOAuth metadata discovery
POST /registerDynamic client registration
GET /authorizeOAuth authorization (shows login page)
POST /approveLogin/register handler
POST /tokenToken exchange
GET /favicon.icoServer icon
ALL /mcpMCP endpoint (authenticated)

Deploy

The project includes a Dockerfile for container-based deployment.

  1. Push your repo to a hosting provider (e.g. DigitalOcean App Platform)
  2. Set the environment variables listed above
  3. The app auto-detects the Dockerfile and deploys on port 8080
  4. Point your domain to the deployed URL

License

MIT