Complete guide to LoseIt MCP Server
Install the LoseIt MCP server with a single command:
curl -fsSL https://loseit.0x17.com/install.sh | sh
This downloads the binary for your platform, installs it to /usr/local/bin, and creates a config template at ~/.loseit-mcp/config.
Download the appropriate binary for your system:
loseit-mcp-darwin-arm64loseit-mcp-linux-amd64loseit-mcp-linux-arm64Make it executable with chmod +x and move to a directory in your PATH.
The MCP server reads configuration from ~/.loseit-mcp/config. This file uses a simple key=value format:
# LoseIt MCP configuration LOSEIT_USERNAME=your_email@example.com LOSEIT_PASSWORD=your_password # Optional: Apple Health export path APPLE_HEALTH_EXPORT_PATH=/path/to/export.xml
| Setting | Required | Description |
|---|---|---|
LOSEIT_USERNAME |
Yes | Your LoseIt account email address |
LOSEIT_PASSWORD |
Yes | Your LoseIt account password |
APPLE_HEALTH_EXPORT_PATH |
No | Path to Apple Health export.xml file |
After configuring, add the MCP server to Claude Code:
claude mcp add loseit -- loseit-mcp
You can also pass configuration via environment variables using claude mcp add-json:
claude mcp add-json loseit '{
"command": "loseit-mcp",
"env": {
"LOSEIT_USERNAME": "your_email@example.com",
"LOSEIT_PASSWORD": "your_password"
}
}'
The MCP server stores all data in ~/.loseit-mcp/:
| File | Description |
|---|---|
config |
Your credentials and settings |
tokens.json |
OAuth tokens (auto-managed) |
device.json |
Device ID for authentication |
cache.db |
SQLite cache of LoseIt data |
Apple Health integration enables body composition, vitals, sleep, and activity tracking. This is optional but recommended for comprehensive health insights.
export.zip to your computerexport.xmlAdd the path to your config file:
APPLE_HEALTH_EXPORT_PATH=/Users/you/Health/export.xml
Apple Health data is static after export. To get the latest data:
export.xml filerefresh_apple_health tool to reloadCore tools for tracking and analyzing your food intake from LoseIt.
Get daily food log with meals, macros, and exercise for a specific date.
date (YYYY-MM-DD format)Search your food history by name. Great for finding past meals.
query, limit (optional)Get weekly aggregated stats including average calories, macros, exercise, and weight change.
weeks (default: 4)Get detailed macro analysis for a date range with protein/carb/fat ratios.
start_date, end_dateGet user goal settings including calorie budget, goal weight, and plan type.
Get weight tracking data from LoseIt over time.
days (default: 30)Understanding the metrics used in analysis tools.
The total calories your body burns per day including all activity. Calculated from your actual weight loss: if you lost 1 lb, you had a ~3,500 calorie deficit over that period. TDEE = (food eaten + deficit) / days.
Calories burned at complete rest—just to keep your body functioning. Estimated as TDEE minus exercise calories. Can also be calculated using the Mifflin-St Jeor formula with height, weight, age, and sex.
Calculated BMR is derived from your actual weight loss data. Formula BMR uses standard equations. If calculated BMR is much higher than formula, you may be under-reporting food intake.
Food calories minus exercise calories burned. This is your effective caloric intake for the day.
Advanced analytics for understanding your nutrition patterns and progress.
Comprehensive energy balance analysis showing the complete picture of energy in vs energy out. Calculates food intake, exercise calories burned, net calories, and derives your TDEE and BMR from actual weight change. Shows how much of your deficit comes from eating less vs exercise.
days (default: 30)Analyze how accurately food is being tracked by comparing your calculated TDEE (derived from actual weight loss) against formula-based estimates using the Mifflin-St Jeor equation. Identifies missed logging days, suspiciously low-calorie days (<800 cal), and provides data quality warnings. Returns a tracking accuracy score showing if you may be under or over-reporting intake.
days (default: 30), age (for formula comparison), sex (male/female), activity_level (sedentary/light/moderate/active/very_active)Analyze calorie intake vs weight change to estimate TDEE and BMR. Includes exercise calories and net intake breakdown.
days (default: 30)Calculate actual vs target calorie deficit, compare projected vs actual weight loss. Shows exercise contribution to total burn and estimated BMR.
days (default: 30)Track how often you hit calorie and protein targets. Shows compliance percentages and streaks.
days, calorie_target, protein_target, toleranceAnalyze meal timing patterns. Are you a breakfast skipper? Late night snacker?
days (default: 30)Analyze intermittent fasting patterns including first/last meal times and eating window duration.
days (default: 30)Analyze nutrition and exercise patterns by day of week. Shows food intake, exercise calories, and net calories for each day.
weeks (default: 4)Compare nutrition between two date ranges to spot trends (e.g., this week vs last week).
start_date_a, end_date_a, start_date_b, end_date_bShow how often specific foods appear in your log. Find your most frequently eaten foods.
days, limit (default: 20)Get your highest calorie meals ever logged.
limit (default: 10)Get exercise history with totals and breakdown by exercise type.
days (default: 30)Get logging streak information including current and longest streaks.
Track body metrics from Apple Health including weight, body fat, and lean mass.
Get latest body composition metrics: weight, body fat %, lean body mass, and BMI.
Get body composition history over time.
days (default: 30)Analyze trends over time: weight change, body fat change, lean mass change.
days (default: 30)Monitor heart health, blood pressure, and cardiovascular fitness from Apple Health.
Get latest health vitals: resting heart rate, HRV, blood pressure, VO2 max, SpO2.
Get daily vitals history over time.
days (default: 30)Analyze resting heart rate and HRV trends. Lower resting HR and higher HRV indicate better fitness.
days (default: 30)Get blood pressure readings over time with averages.
days (default: 90)Analyze VO2 max cardio fitness trends. Higher values indicate better cardiovascular fitness.
days (default: 30)Track daily activity, sleep quality, mobility, and daylight exposure from Apple Health.
Get daily activity metrics: steps, distance, flights climbed, exercise minutes, active/basal calories.
days (default: 30)Get sleep analysis data including duration, efficiency, and sleep stages (deep, core, REM).
days (default: 30)Get movement quality metrics: walking speed, step length, asymmetry, steadiness, stair speed. Useful for injury prevention.
days (default: 30)Get time spent in daylight. Important for circadian rhythm, mood, and SAD awareness.
days (default: 30)Get a comprehensive health dashboard with all key metrics: body composition, vitals, activity, sleep, mobility, and daylight exposure.
Tools for managing data refresh and cache.
Force refresh of the LoseIt database cache to get the latest data. The cache normally refreshes every 12 hours.
Force refresh of the Apple Health data cache. Use after updating your export.xml file.