Query your LoseIt health tracking data directly in Claude Desktop using the Model Context Protocol (MCP).
This MCP server lets you ask Claude natural language questions about your LoseIt health data:
- "What was my weight on November 15th?"
- "Show me my calorie intake for the past week"
- "How has my weight changed over the past month?"
- "What did I eat for breakfast yesterday?"
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Claude Desktop │ --> │ MCP Server │ --> │ PostgreSQL DB │
│ │ │ (loseit.mcpb) │ │ (local/remote) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Key Features:
- ✅ MCP bundle is lightweight and data-free (~2MB vs 16MB)
- ✅ Update your data without touching the MCP bundle
- ✅ Database can be local (Docker) OR remote (cloud)
- ✅ No filesystem dependencies - data lives in PostgreSQL
- ✅ Fast queries with proper database indexing
git clone <your-repo>
cd loseit
npm install# Start PostgreSQL in Docker
npm run db:start
# Set up your LoseIt credentials
cp .env.example .env
# Edit .env and add your LoseIt email and password
# Export data from LoseIt.com (automated, headless)
npm run data:export
# Process and load into database
npm run data:process
npm run db:load# Build the MCP bundle
npm run mcp:bundle
# Install loseit.mcpb in Claude Desktop
# Drag into Settings → ExtensionsIn Claude Desktop, configure the database URL:
- Default:
postgresql://loseit:password@localhost:5432/loseit
Restart Claude Desktop and start asking questions!
When you want to refresh your LoseIt data:
npm run data:updateThis downloads the latest export, processes it, and loads it into PostgreSQL using incremental updates (only new/changed records are updated). No need to rebuild or reinstall the MCP bundle!
By default, npm run db:load performs an incremental update:
- Upserts records for tables with unique date constraints (markers, activity, calories, macros)
- For the food table, deletes existing records for dates in the new export, then inserts fresh data
- Faster and preserves any manual database changes outside the date range
For a complete refresh, use:
npm run db:load:fullThis performs a full reload:
- Deletes all existing data from all tables
- Inserts all records from the export
- Use this for the initial load or if you want a clean slate
The MCP server provides 7 core tools:
- get_weight - Weight and body fat measurements
- get_calories - Calorie intake, expenditure, and budget
- get_activity - Steps, sleep, and exercise data
- get_macros - Protein, carbs, fiber intake
- get_food_logs - Detailed food entries with filtering
- get_daily_summary - Comprehensive daily overview
- get_trends - Trend analysis with aggregation (day/week/month)
Process Apple Health XML exports to supplement activity data with:
- Detailed workout sessions
- Heart rate monitoring
- Sleep analysis
- Comprehensive activity metrics
See apple_health/README.md for details.
Parse freeform weightlifting notes from Obsidian to track:
- Strength progression
- Personal records (PRs)
- Training volume
- Workout frequency
See obsidian/README.md for details.
- SETUP.md - Complete setup guide with troubleshooting
- EXAMPLES.md - Example queries and use cases
- SCHEMA.md - Database schema documentation
Create a .env file with your LoseIt credentials:
LOSEIT_EMAIL=your-email@example.com
LOSEIT_PASSWORD=your-passwordThese are used for automated data export via headless browser automation.
npm run data:export- Download data from LoseIt.com (requires .env file)npm run data:process- Transform CSVs to database formatnpm run data:update- Complete data refresh workflow
npm run db:start- Start PostgreSQL in Dockernpm run db:stop- Stop database servernpm run db:load- Load processed data (incremental upsert)npm run db:load:full- Full reload (delete all, then insert)npm run db:psql- Open PostgreSQL shellnpm run db:ui- Start pgAdmin web UI
npm run mcp:bundle- Build the .mcpb bundlenpm run mcp:validate- Validate manifest.jsonnpm run mcp:info- Show bundle info
npm run setup- Complete initial setup (db + data + bundle)
Want to use a cloud database instead of local Docker?
- Set up PostgreSQL on Railway, Supabase, or Neon
- Get your connection URL:
postgresql://user:pass@host:port/database - Load your data:
export DATABASE_URL="your-connection-url" npm run db:load
- Configure the URL in Claude Desktop settings
See SETUP.md for details.
- Node.js >= 18.0.0
- Docker (for local database) OR PostgreSQL server access
- Claude Desktop
- npm package manager
npm run db:stop
npm run db:start
npm run db:logs- Verify database is running:
docker ps - Test connection:
npm run db:psql - Check URL in Claude Desktop settings
# Verify data is loaded
npm run db:psql
# Then: SELECT COUNT(*) FROM markers;See SETUP.md for more help.
MIT