A Model Context Protocol (MCP) server for tracking daily calorie consumption through natural language interactions.
- Natural Language Meal Entry: Log meals using descriptions like "chicken salad and a glass of milk"
- Daily Summaries: Get total calorie intake with meal breakdowns
- Weekly Reports: View average consumption, trends, and achievement tracking
- Food Search: Look up calorie information for specific foods
- Persistent Storage: SQLite database for cross-session data retention
npm install -g daily-calorie-tracker-mcp- Clone this repository
- Install dependencies:
npm install
- Build the project:
npm run build
Add to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"daily-calorie-tracker": {
"command": "npx",
"args": ["-y", "daily-calorie-tracker-mcp"]
}
}
}{
"mcpServers": {
"daily-calorie-tracker": {
"command": "node",
"args": ["/path/to/daily-calorie-tracker/dist/index.js"]
}
}
}Add to your Cursor settings (~/.cursor/settings.json):
{
"mcpServers": {
"daily-calorie-tracker": {
"command": "npx",
"args": ["-y", "daily-calorie-tracker-mcp"]
}
}
}Add to your Continue configuration (~/.continue/config.json):
{
"models": [
{
"model": "claude-3-5-sonnet-latest",
"provider": "anthropic",
"mcpServers": [
{
"name": "daily-calorie-tracker",
"command": "npx",
"args": ["-y", "daily-calorie-tracker-mcp"]
}
]
}
]
}The server provides the following tools:
Log a meal with natural language description.
Parameters:
description(string, required): Natural language description of the meal (e.g., "chicken salad and a glass of milk")mealType(string, required): Type of meal - "breakfast", "lunch", "dinner", or "snack"
Example:
Add breakfast: oatmeal with banana and coffee
Get today's calorie intake summary with meal breakdown.
Parameters:
date(string, optional): Date in YYYY-MM-DD format (defaults to today)
Example:
Show today's calorie summary
Generate a weekly calorie consumption report with statistics.
Parameters:
startDate(string, optional): Start date in YYYY-MM-DD format (defaults to 7 days ago)
Example:
Generate weekly report
Search for calorie information of specific foods.
Parameters:
foodName(string, required): Name of the food to search
Example:
Search calories for pizza
Once configured, you can use natural language to track your calories:
- "Log breakfast: oatmeal with banana and coffee"
- "Add lunch: grilled chicken salad and apple juice"
- "Record dinner: pasta with tomato sauce and a glass of wine"
- "I had a snack: apple and yogurt"
- "Show today's calorie summary"
- "What did I eat today?"
- "Generate weekly report"
- "Show my calorie trends for this week"
- "Search calories for pizza"
- "How many calories in chicken breast?"
Data is stored in SQLite database at:
- MacOS/Linux:
~/.daily-calorie-tracker/calories.db - Windows:
%USERPROFILE%\.daily-calorie-tracker\calories.db
The server includes a comprehensive food database with 100+ common foods organized by categories:
- Proteins (chicken, beef, fish, eggs, tofu, etc.)
- Carbohydrates (rice, pasta, bread, potatoes, etc.)
- Vegetables (broccoli, spinach, tomatoes, etc.)
- Fruits (apples, bananas, berries, etc.)
- Beverages (milk, juice, coffee, tea, etc.)
- Dairy products (cheese, yogurt, butter, etc.)
- Common meals (hamburger, pizza, sandwiches, etc.)
- Snacks (chips, nuts, chocolate, etc.)
npm run dev- Run in development modenpm run build- Build for productionnpm start- Run production build
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details