Calorie Tracker MCP Server

by thitiph0n

326 downloads
Not rated
GitHub

About

MCP server for tracking daily calorie intake with accurate BMR/TDEE calculations. Built on Cloudflare Workers with D1 database.

Details

Author
thitiph0n
Downloads
326
Categories
Other

- Food tracking with add, update, delete and macros
- Profile management with BMR/TDEE calculations
- Historical data for weight and body composition
- Secure API key authentication with role-based access
- Admin tools for user registration and revocation

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Calorie Tracker MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies with pnpm install, create and migrate the D1 database using Wrangler, then run the development server with pnpm run dev. Configure Claude Desktop by adding the server to mcpServers with a bearer token, and use tools like add_entry, list_entries, and get_profile to interact.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "calorie tracker mcp server": {
            "calorie-tracker-mcp-server": {
                "command": "npx",
                "args": [
                    "wrangler",
                    "d1",
                    "create",
                    "calorie-tracker"
                ]
            }
        }
    }
}

McpServers

{
    "calorie-tracker-mcp-server": {
        "command": "npx",
        "args": [
            "wrangler",
            "d1",
            "create",
            "calorie-tracker"
        ]
    }
}

Calorie Tracker MCP Server

Calorie Tracker MCP Server

MCP server for tracking daily calorie intake with accurate BMR/TDEE calculations. Built on Cloudflare Workers with D1 database.

Features

- Food Tracking: Add, update, delete food entries with macros
- Profile Management: BMR/TDEE calculations using Harris-Benedict equation
- Historical Data: Track weight, body composition over time
- Secure: API key authentication with role-based access

Quick Setup

pnpm install
npx wrangler d1 create calorie-tracker
npx wrangler d1 migrations apply calorie-tracker
pnpm run dev

Update wrangler.jsonc with your database ID.

Claude Desktop Config

{
  "mcpServers": {
    "calorie-tracker": {
      "command": "npx", 
      "args": ["mcp-remote", "http://localhost:8787/sse"],
      "env": {
        "BEARER_TOKEN": "YOUR_ADMIN_API_KEY"
      }
    }
  }
}

Tools

Food Tracking:

- list_entries - List food entries with pagination
- add_entry - Add food entry with macros
- update_entry - Update existing entry
- delete_entry - Delete entry

Profile Management:

- get_profile - Get profile with BMR/TDEE calculations
- update_profile - Update profile data (height, weight, activity level)
- get_profile_history - Historical tracking data

Admin:

- register_user - Register new user
- revoke_user - Revoke user access

BMR/TDEE Calculations

Uses Harris-Benedict equation (1984 revision):

Male: BMR = 88.362 + (13.397 × weight) + (4.799 × height) - (5.677 × age)
Female: BMR = 447.593 + (9.247 × weight) + (3.098 × height) - (4.330 × age)

TDEE: BMR × Activity Multiplier (1.2 - 1.9)

Development

pnpm test              # Run tests
pnpm run deploy        # Deploy to production
pnpm run type-check    # TypeScript validation

Tech Stack

- Runtime: Cloudflare Workers
- Database: D1 (SQLite)
- Language: TypeScript
- Validation: Zod
- Testing: Vitest

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.