myfitnesspal
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., "@myfitnesspal get my calorie and macro summary for today"
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.
MyFitnessPal MCP Server
A FastMCP server that retrieves your MyFitnessPal nutrition data through the Model Context Protocol.
Quick Start
Local Development
Prerequisites: Python 3.12+, uv, MyFitnessPal account
Install dependencies:
uv syncLog into MyFitnessPal in your browser (Chrome, Firefox, Safari, or Edge)
Test the server:
uv run python test_client.py
Deployment (Server/Docker)
For environments without a browser:
Export cookies from your local browser:
uv run python export_cookies.pyDeploy with the generated
.envfile - no browser needed!
See Deployment Guide for Docker, systemd, and cloud deployment options.
Related MCP server: fitatu-wrapper
Features
Daily nutrition summary (calories, macros, water)
Detailed meal-by-meal breakdown
Exercise tracking (cardio + strength)
Macro & micronutrient analysis
Water intake monitoring
Date range summaries with trends
Configuration
Add to your MCP client config (e.g., .cursor/mcp.json):
{
"mcpServers": {
"myfitnesspal": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/mfp-mcp", "python", "main.py"]
}
}
}Documentation
Full Documentation - Complete setup and usage guide
Deployment Guide - Docker, server, and cloud deployment
Quick Start Guide - Fast setup instructions
Project Summary - Architecture and design decisions
Implementation Notes - Technical details
How It Works
Uses the python-myfitnesspal library (GitHub version) which:
Extracts cookies from your browser automatically
Scrapes MyFitnessPal website for data
No credentials stored in files
Works with Chrome, Firefox, Safari, and Edge
Cookie Authentication
Browser-based (default):
Automatically extracts cookies from your local browser
Works out of the box if you're logged into MyFitnessPal
Environment variable (for Docker/servers):
Set
MFP_COOKIESenvironment variable with exported cookiesUse
export_cookies.pyutility to extract cookies beforehand:uv run python export_cookies.pyPerfect for environments without browser access (Docker containers, remote servers, etc.)
Cookies expire after ~30 days, re-export when needed
Project Structure
mfp-mcp/
├── docs/ # All documentation
├── myfitnesspal/ # External library (GitHub)
├── main.py # FastMCP server
├── api_client.py # Client wrapper
├── utils.py # Helper functions
├── test_client.py # Test script
└── pyproject.toml # DependenciesRequirements
Python 3.12+
uv package manager
Active MyFitnessPal session in browser
fastmcp 2.12+
lxml, browser-cookie3, measurement
License
For personal use and educational purposes. Respect MyFitnessPal's Terms of Service.
Credits
python-myfitnesspal: https://github.com/coddingtonbear/python-myfitnesspal
FastMCP: https://github.com/jlowin/fastmcp
Available Tools
6 toolsget_daily_exerciseA
Get exercise activities: cardio (duration, calories) and strength (sets, reps, weight).
Args: date: Date in YYYY-MM-DD format (defaults to today)
Inputs: date.
get_daily_macrosB
Get comprehensive macro and micronutrient breakdown with all tracked nutrients.
Args: date: Date in YYYY-MM-DD format (defaults to today)
Inputs: date.
get_daily_mealsA
Get detailed meal-by-meal breakdown with all foods, servings, and calories.
Args: date: Date in YYYY-MM-DD format (defaults to today)
Inputs: date.
get_daily_summaryA
Get daily nutrition overview: calories consumed/remaining, macro breakdown, water, and goals.
Args: date: Date in YYYY-MM-DD format (defaults to today)
Inputs: date.
get_date_range_summaryA
Get aggregate nutrition data over a date range with trends and insights.
Args: start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format
Inputs: start_date (required), end_date (required).
get_water_intakeA
Get water consumption for a specific day.
Args: date: Date in YYYY-MM-DD format (defaults to today)
Inputs: date.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct data aspect: exercise, macros, meals, summary, date range summary, and water. There is no overlap; even the summary tool is clearly a high-level overview.
All tool names follow the consistent pattern 'get_daily_<aspect>' or 'get_date_range_summary' and 'get_water_intake', all using snake_case.
With 6 tools, the server is well-scoped for a read-only fitness data retrieval API. The count is appropriate for the domain.
The tool surface covers all typical daily data retrieval needs (exercise, macros, meals, water, summary, and date range). Missing write operations or weight tracking, but these may be out of scope.
Maintenance
Related MCP Connectors
Read your Fitzap workout and nutrition data and create workout drafts and recipes for review.
1Log meals, check calories and macros, set up a nutrition plan, and search foods.
Nutrition tracking: log meals and macros, USDA and Open Food Facts lookups, history, app import.
Nutrition tracking from any MCP client. Free on web and app; MCP access is part of Munch Premium.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables retrieval and analysis of MyFitnessPal nutrition data including daily summaries, meal breakdowns, exercise tracking, and macro/micronutrient analysis. Uses browser cookie authentication to access your personal MyFitnessPal account data through natural language queries.6-
- AlicenseCqualityDmaintenanceEnables programmatic access to Fitatu nutrition tracking via MCP tools for login, food search, product lookup, daily nutrition read, and adding entries.9MIT
- FlicenseNot gradedqualityCmaintenanceEnables querying Yazio food logs including meals, daily summaries, and nutrition totals through MCP tools.-
- FlicenseNot gradedqualityCmaintenanceSyncs and retrieves daily nutrition data (meals and macros) from Fitatu via MCP tools, with SQLite caching and HTTP Streamable transport.2-