Myfitnesspal Mcp Python — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Myfitnesspal Mcp Python (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your MyFitnessPal data, including food diary, exercises, body measurements, nutrition goals, and water intake.
| Tool | Type | Description |
|---|---|---|
mfp_get_diary | Read | Get food diary entries for any date |
mfp_search_food | Read | Search the MyFitnessPal food database |
mfp_get_food_details | Read | Get detailed nutrition info for a food item |
mfp_add_food_to_diary | Write | Add a food item to your diary for a specific meal and date |
mfp_get_measurements | Read | Get weight/body measurement history |
mfp_set_measurement | Write | Log a new weight or body measurement |
mfp_get_exercises | Read | Get logged exercises (cardio & strength) |
mfp_get_goals | Read | Get daily nutrition goals |
mfp_set_goals | Write | Update daily nutrition goals |
mfp_get_water | Read | Get water intake for a date |
mfp_set_water | Write | Log water intake for a date |
mfp_get_report | Read | Get nutrition reports over a date range |
refresh_browser_cookies | Utility | Extract and save session cookies from browser |
python3 --version)pip install --upgrade pip)This MCP supports multiple authentication methods:
| Method | Setup | Persistence |
|---|---|---|
| Credentials in config | Add MFP_USERNAME and MFP_PASSWORD to Claude Desktop config | Automatic (session cached 30 days) |
| Browser cookies | Log into myfitnesspal.com in Chrome/Firefox | Until browser session expires |
# Clone the repository
git clone https://github.com/YOUR_USERNAME/myfitnesspal-mcp-python.git
cd myfitnesspal-mcp-python
# Create virtual environment (use python3.10+ on macOS/Linux)
python3 -m venv venv
# On macOS, you may need to specify version: python3.12 -m venv venv
# Activate virtual environment
source venv/bin/activate # macOS/Linux
# On Windows: .\venv\Scripts\activate
# Upgrade pip (required for pyproject.toml support)
pip install --upgrade pip
# Install the package in editable mode
pip install -e .pip install mfp-mcpNote: Option 2 requires the package to be published to PyPI. For now, use Option 1.
After installation, verify the server can start:
# With venv activated
python -m mfp_mcp.serverYou should see the server waiting for input (it communicates via stdio). Press Ctrl+C to stop.
To test authentication (optional):
MFP_USERNAME="your_email" MFP_PASSWORD="your_password" python -c "
from mfp_mcp.server import get_mfp_client
client = get_mfp_client()
print('Authentication successful!')
"| OS | Config File Location |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
If the file doesn't exist, create it. Add or merge the following configuration:
#### Option A: With Credentials (Recommended - No Browser Required)
macOS Example:
{
"mcpServers": {
"myfitnesspal": {
"command": "/Users/yourname/myfitnesspal-mcp-python/venv/bin/python",
"args": ["-m", "mfp_mcp.server"],
"env": {
"MFP_USERNAME": "[email protected]",
"MFP_PASSWORD": "your_password"
}
}
}
}Windows Example:
{
"mcpServers": {
"myfitnesspal": {
"command": "C:\\Users\\YourName\\myfitnesspal-mcp-python\\venv\\Scripts\\python.exe",
"args": ["-m", "mfp_mcp.server"],
"env": {
"MFP_USERNAME": "[email protected]",
"MFP_PASSWORD": "your_password"
}
}
}
}#### Option B: Without Credentials (Browser Cookie Fallback)
macOS Example:
{
"mcpServers": {
"myfitnesspal": {
"command": "/Users/yourname/myfitnesspal-mcp-python/venv/bin/python",
"args": ["-m", "mfp_mcp.server"]
}
}
}⚠️ Important: Use full absolute paths to the Python executable in your virtual environment. Replaceyourname/YourNamewith your actual username.
After saving the config file, completely quit and restart Claude Desktop for the changes to take effect.
In Claude Desktop, you should see a hammer icon (🔨) indicating MCP tools are available. Try asking:
"Show my MyFitnessPal diary for today"
The MCP server supports three authentication methods, tried in this order:
Set MFP_USERNAME and MFP_PASSWORD in your Claude Desktop config's env section. This is the most reliable method and doesn't require a browser.
"env": {
"MFP_USERNAME": "[email protected]",
"MFP_PASSWORD": "your_password"
}After successful authentication, session cookies are saved to ~/.mfp_mcp/cookies.json. These persist for 30 days, so you won't need to re-authenticate frequently.
If no credentials are provided and no stored cookies exist, the server falls back to reading cookies from Chrome or Firefox. You must be logged into myfitnesspal.com in your browser.
Your MyFitnessPal credentials in the Claude Desktop config are stored locally on your machine. The config file is only readable by your user account. However, if you're concerned about storing credentials:
~/.mfp_mcp/cookies.json with restricted permissionsOnce configured, you can interact with your MyFitnessPal data through Claude:
"Show me what I ate today"
"Get my food diary for 2026-01-05"
"What meals did I log yesterday?""Show my weight history for the past 30 days"
"Log my weight as 232.5 pounds"
"What's my weight trend this month?""Search MyFitnessPal for chicken breast"
"Find nutrition info for Greek yogurt"
"Look up calories in a banana""Compare my nutrition goals to what I actually ate today"
"Am I on track with my protein intake?"
"How many calories do I have left today?""What exercises did I log today?"
"Show my workout from yesterday""Show my calorie intake over the past week"
"What's my average protein intake this week?"
"Generate a nutrition report for January"myfitnesspal-mcp-python/
├── Dockerfile # Container deployment
├── pyproject.toml # Package configuration
├── README.md # This file
└── src/
└── mfp_mcp/
├── __init__.py # Package initialization
└── server.py # MCP server implementation# Clone and enter directory
git clone https://github.com/YOUR_USERNAME/myfitnesspal-mcp-python.git
cd myfitnesspal-mcp-python
# Create virtual environment (Python 3.10+ required)
python3 -m venv venv
source venv/bin/activate
# Upgrade pip and install with dev dependencies
pip install --upgrade pip
pip install -e ".[dev]"pytestblack src/
isort src/
ruff check src/mypy src/⚠️ Note: Docker deployment requires mounting your browser's cookie database for authentication.
# Build the image
docker build -t mfp-mcp .
# Run with Chrome cookies mounted (Linux example)
docker run -it --rm \
-v ~/.config/google-chrome:/root/.config/google-chrome:ro \
mfp-mcpProblem: Python is not in PATH or you need to specify version.
Solutions:
python3 instead of pythonpython3 --version (must be 3.10+)brew install [email protected]python3.12 -m venv venvProblem: Your pip version is too old to support pyproject.toml builds.
Solution: Upgrade pip first:
pip install --upgrade pip
pip install -e .Problem: The server can't authenticate with your credentials or read browser cookies.
Solutions:
Problem: Package not installed or wrong Python environment.
Solutions:
pip install -e . /path/to/project/venv/bin/python # macOS/Linux
C:\path\to\project\venv\Scripts\python.exe # WindowsProblem: MCP server not connecting.
Solutions:
~ or relative paths)~/Library/Logs/Claude/%APPDATA%\Claude\logs\Problem: Authentication works but no data returned.
Solutions:
Problem: VS Code/Cursor Python extension bug with venv prompt.
Solutions:
venv/bin/activate: # Change from:
PS1="("'(venv) '") ${PS1:-}"
# To:
PS1="(venv) ${PS1:-}"Get food diary for a specific date.
date (optional): YYYY-MM-DD format, defaults to todayresponse_format: "markdown" or "json"Search the MyFitnessPal food database.
query (required): Search termlimit (optional): Max results (default 10, max 50)response_format: "markdown" or "json"Get detailed nutrition for a food item.
mfp_id (required): MyFitnessPal food ID from search resultsresponse_format: "markdown" or "json"Add a food item to your diary for a specific meal and date.
mfp_id (required): MyFitnessPal food ID from search results (use mfp_search_food first)meal (optional): Meal name - "Breakfast", "Lunch", "Dinner", or "Snacks" (default: "Breakfast")date (optional): YYYY-MM-DD format (default: today)quantity (optional): Number of servings (default: 1.0)unit (optional): Unit/serving size description (e.g., "1 cup", "100g")Example workflow:
mfp_search_food to find a food item and get its mfp_idmfp_add_food_to_diary with the mfp_id to add it to your diaryGet body measurement history.
measurement (optional): "Weight", "Body Fat", "Waist", etc.start_date (optional): YYYY-MM-DD (default 30 days ago)end_date (optional): YYYY-MM-DD (default today)response_format: "markdown" or "json"Log a body measurement for today.
measurement (optional): Type (default "Weight")value (required): Numeric valueGet exercise log for a date.
date (optional): YYYY-MM-DD (default today)response_format: "markdown" or "json"Get daily nutrition goals.
date (optional): YYYY-MM-DD (default today)response_format: "markdown" or "json"Update nutrition goals.
calories (optional): Daily calorie goalprotein (optional): Daily protein in gramscarbohydrates (optional): Daily carbs in gramsfat (optional): Daily fat in gramsGet water intake for a date.
date (optional): YYYY-MM-DD (default today)Log water intake for a date.
cups (required): Number of cups of water (e.g., 2.5 for 2.5 cups). Note: MyFitnessPal uses cups as the unit (1 cup = ~237ml)date (optional): YYYY-MM-DD format (default: today)Get nutrition report over a date range.
report_name (optional): "Net Calories", "Protein", "Fat", "Carbs"start_date (optional): YYYY-MM-DD (default 7 days ago)end_date (optional): YYYY-MM-DD (default today)response_format: "markdown" or "json"~/.mfp_mcp/cookies.json for 30 days.MIT License - See LICENSE file for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.