Calorie Tracker MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Calorie Tracker MCP Serverlog my lunch: chicken salad with 300 calories"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 Mifflin-St Jeor equation
Historical Data: Track weight, body composition over time
Secure: OAuth 2.1 authentication with PKCE support
Related MCP server: Food Tracker MCP Server
Quick Setup
pnpm install
# Create resources and update wrangler.jsonc with IDs
npx wrangler d1 create calorie-tracker
npx wrangler kv:namespace create OAUTH_KV
# Run migrations and start dev server
npx wrangler d1 migrations apply calorie-tracker --local
pnpm run devOAuth Client Registration
Set an admin API key:
# Development: Update wrangler.jsonc vars.ADMIN_API_KEY
# Production: Use secrets
npx wrangler secret put ADMIN_API_KEYRegister an OAuth client to obtain credentials:
curl -X POST http://localhost:8787/oauth/register \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_ADMIN_API_KEY" \
-d '{
"client_name": "Claude Desktop",
"redirect_uris": ["http://127.0.0.1/callback", "http://localhost/callback"],
"user_id": "admin"
}'Note: Claude Desktop will specify its callback URL during the OAuth flow. If you get a redirect URI mismatch error, check Claude Desktop's OAuth logs for the actual callback URL it expects.
Response:
{
"client_id": "uuid-client-id",
"client_secret": "generated-secret",
"client_name": "Claude Desktop"
}Claude Configuration
Option 1: Bearer Token (Personal/Pro/Max)
Simple authentication using client secret as bearer token:
Register OAuth client:
curl -X POST http://localhost:8787/oauth/register \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_ADMIN_API_KEY" \ -d '{ "client_name": "Claude Desktop", "redirect_uris": ["https://claude.ai/api/mcp/auth_callback"], "user_id": "admin" }'Save the
client_secretfrom response.Claude Desktop config (
claude_desktop_config.json):{ "mcpServers": { "calorie-tracker": { "command": "npx", "args": ["mcp-remote", "http://localhost:8787/sse"], "env": { "BEARER_TOKEN": "<client_secret from registration>" } } } }
Option 2: OAuth with Client Credentials (Team/Enterprise Only)
Private connector with Client ID/Secret:
Register OAuth client with callback URL
https://claude.ai/api/mcp/auth_callbackAdd custom connector in Claude:
Name: Calorie Tracker
Remote MCP server URL:
https://YOUR-WORKER.workers.dev/sseOAuth Client ID:
<client_id from registration>OAuth Client Secret:
<client_secret from registration>
Production Deployment
Deploy to Cloudflare Workers for mobile/web access:
pnpm run deploy
pnpm run migrate
npx wrangler secret put ADMIN_API_KEYTools
Food Tracking:
list_entries- List food entries with paginationadd_entry- Add food entry with macrosupdate_entry- Update existing entrydelete_entry- Delete entry
Profile Management:
get_profile- Get profile with BMR/TDEE calculationsupdate_profile- Update profile data (height, weight, activity level)get_profile_history- Historical tracking data
Admin:
register_user- Register new userrevoke_user- Revoke user access
BMR/TDEE Calculations
Uses Mifflin-St Jeor equation (gold standard):
Male: BMR = (10 × weight) + (6.25 × height) - (5 × age) + 5
Female: BMR = (10 × weight) + (6.25 × height) - (5 × age) - 161
TDEE: BMR × Activity Multiplier (1.2 - 1.9)
Development
pnpm test # Run tests
pnpm run type-check # TypeScript validation
pnpm run deploy # Deploy to production
pnpm run migrate # Run migrations on remoteTech Stack
Runtime: Cloudflare Workers
Database: D1 (SQLite)
Language: TypeScript
Validation: Zod
Testing: Vitest
This server cannot be deployed
Maintenance
Related MCP Connectors
Calorie tracker app for ChatGPT and Claude: read meals, macros, weight and log meals from chat.
1Free AI calorie & macro tracker: tell your AI what you ate and it logs it to your private food diary
Know your goal-weight date. Log food, sync Garmin, get a daily AI coach in Telegram.
AI-powered calorie tracking with photo recognition, barcode scanning, and voice logging
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables users to log meals, track daily and weekly calorie intake, and manage diet records. Supports both local and network modes for flexible meal logging across devices.-
- AlicenseNot gradedqualityFmaintenanceEnables tracking food intake and nutrition using the USDA FoodData Central database. Supports logging meals, setting daily nutrition goals, viewing food diaries, and analyzing nutrition trends over time with local SQLite storage.14 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables users to track daily calorie consumption by logging meals through natural language and searching a comprehensive food database. It provides daily summaries, weekly reports, and persistent SQLite storage to monitor dietary trends and goals.13 npmMIT
- FlicenseAqualityDmaintenanceA local, JSON-first calorie and protein tracker for agents and shell workflows, providing a CLI and MCP server for meal tracking, goal management, and summaries with SQLite storage.11-