← Back to directory
M

MyFitnessPal MCP Server

Community
Let AI assistants read and write your MyFitnessPal diary and health data
GitHub source repository ↗
★ 53 Stars Category · Other Popular
51FMRS · D

A broad, locally hosted MyFitnessPal MCP server with 20 tools covering diary reads and writes, food search, custom-food management, body measurements, exercises, nutrition goals, water and fasting writes plus nutrition reports, with Chromium browser auto-discovery for authentication. It is not an official project: MyFitnessPal has no public API, reads are scraped, and writes rely on undocumented internal endpoints that can change at any time; the README also states plainly that legacy form login mostly fails after MFP's move to NextAuth, so browser-session cookies are the reliable path. Suitable for individuals who accept those constraints; not suitable where official support or policy certainty is required, or where storing session cookies locally is unacceptable.

Reliability
9/20
Security and permissions
8/20
Maintenance
10/20
Documentation
14/20
Setup experience
10/20
Read the FMRS scoring method →

A locally hosted Model Context Protocol server that lets AI assistants such as Claude interact with your MyFitnessPal data: food diary, exercises, body measurements, nutrition goals, water intake and intermittent fasting. MyFitnessPal has no public API: reads are scraped from the website via python-myfitnesspal, diary writes go through MFP's internal v2 JSON API (the same one its web client uses, authenticated with your existing session token), and custom-food writes use a different family of cookie-authenticated web endpoints. The server runs locally over stdio; data is only transmitted between your machine and myfitnesspal.com.

Tools

mfp_get_diary
Get food diary entries for any date
mfp_search_food
Search the MyFitnessPal food database
mfp_get_food_details
Get detailed nutrition info for a food item
mfp_add_food_to_diary
Add a food item to your diary for a specific meal and date
mfp_remove_food_from_diary
Remove a logged entry from your diary
mfp_create_custom_food
Create a private custom food with a full nutrition panel
mfp_list_own_foods
List your own custom foods (private ones do not appear in search)
mfp_delete_custom_food
Delete one of your custom foods
mfp_get_measurements
Get weight/body measurement history
mfp_set_measurement
Log a new weight or body measurement
mfp_get_exercises
Get logged exercises (cardio & strength)
mfp_get_goals
Get daily nutrition goals
mfp_set_goals
Update daily nutrition goals
mfp_get_water
Get water intake for a date
mfp_set_water
Log water intake for a date
mfp_log_fast
Log a completed intermittent fasting window (start + end)
mfp_update_fast
Update the start/end times of an existing fasting entry
mfp_delete_fast
Delete a fasting entry by id
mfp_get_report
Get nutrition reports over a date range
refresh_browser_cookies
Extract and save session cookies from browser

Setup

  1. Make sure Python 3.10–3.12 is installed (3.13+ is unsupported because lxml has no wheels for it).
  2. Clone the repository and enter it: git clone https://github.com/YOUR_USERNAME/myfitnesspal-mcp-python.git && cd myfitnesspal-mcp-python.
  3. Create a virtual environment: python3 -m venv venv, then activate it (macOS/Linux: source venv/bin/activate; Windows: .\venv\Scripts\activate).
  4. Upgrade pip: pip install --upgrade pip.
  5. Install in editable mode: pip install -e .
  6. Verify it starts: python -m mfp_mcp.server (it communicates over stdio; press Ctrl+C to stop).
  7. Edit the Claude Desktop config file (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Windows: %APPDATA%\Claude\claude_desktop_config.json) and add the mcpServers entry with an absolute path to the venv Python and args ["-m", "mfp_mcp.server"].
  8. Fully quit and restart Claude Desktop; a hammer icon indicates the tools are loaded.
  9. For authentication, log into myfitnesspal.com in any Chromium-based browser (recommended on macOS) or Firefox; you can alternatively set MFP_USERNAME / MFP_PASSWORD in the env block (legacy form login largely fails against MFP's NextAuth backend).
claude_desktop_config.json
{
  "mcpServers": {
    "myfitnesspal": {
      "command": "/Users/yourname/myfitnesspal-mcp-python/venv/bin/python",
      "args": ["-m", "mfp_mcp.server"]
    }
  }
}

Fit and risk

Best for

  • Individuals who want to view and organize MyFitnessPal food, exercise and weight records in natural language
  • macOS Claude Desktop users who are comfortable authenticating with browser cookies
  • People automating entries (e.g. inferring fasts from a sleep window plus first-meal timestamp) or correcting logs programmatically
  • Technical users who accept a scraping-based approach and know the interface can break

Not for

  • Production use requiring official support or a stable public API
  • Users unwilling to keep session cookies or account credentials on their machine
  • Environments on Python 3.13+ or where lxml cannot be built
  • MCP clients other than Claude Desktop (only a Claude Desktop config example is documented)
  • Anyone who needs to read fasting history — MFP exposes no read endpoint for it

Required permissions

  • Read and modify your MyFitnessPal account data (diary, goals, measurements, water, fasting)
  • Write to ~/.mfp_mcp/cookies.json (mode 0600; equivalent to a password with full account access)
  • On macOS, read each browser's '<Browser> Safe Storage' keychain entry to decrypt its cookie database
  • Read browser cookies (Chromium-based or Firefox) or credentials from the MFP_USERNAME / MFP_PASSWORD environment variables
  • Optionally read MFP_SECRET_KEY from the environment or OS keychain to decrypt credentials

Risks and side effects

  • The server can modify your diary, goals, measurements and water — mistaken calls change real data
  • Session cookies grant full account access and are stored locally in ~/.mfp_mcp/cookies.json; leaking that file is leaking the account
  • Storing plain credentials in the client config puts your MyFitnessPal password in plaintext on disk, readable by anything running as your user
  • Reads and writes depend on MFP's undocumented interfaces, which can change without notice (the author notes it already happened once)
  • Scraping and internal API use may conflict with MyFitnessPal's terms of service
  • If MFP_SECRET_KEY is stored alongside the encrypted values in the same config file, the encryption provides little protection

Troubleshooting

  1. 'python: command not found' or wrong version: check with python3 --version (needs 3.10–3.12); on macOS run brew install [email protected] and recreate the venv
  2. 'pip install -e .' fails with 'setup.py not found': run pip install --upgrade pip first
  3. Authentication failures: log into myfitnesspal.com in a Chromium browser, or call refresh_browser_cookies with browser set to arc, chrome, edge, brave, firefox or auto
  4. First macOS run shows a keychain prompt: click 'Always Allow'; if Claude Desktop spawns the server in the background the prompt is easy to miss, so bring it to the foreground and retry
  5. 'No module named mfp_mcp': make sure you use the venv Python, reinstall with pip install -e ., and use absolute paths in the config
  6. Tools not appearing in Claude Desktop: validate the JSON, use absolute paths, fully restart Claude Desktop, and check the log directories
  7. Authentication succeeds but responses are empty: confirm you have entries for that date and use YYYY-MM-DD format
  8. Food logging suddenly breaks: MFP changed its internal endpoints (the old /food/diary/{user}/add now returns 404), which is the most likely cause

Use cases

Read today's or any date's food diary and see what was eaten yesterday
Search food in MyFitnessPal and pull nutrition details with an AI assistant
Add food to Breakfast, Lunch, Dinner or Snacks
Review weight history and monthly trend, and log a new weight
Compare daily nutrition goals against actual intake and check protein progress
Review logged exercises for today or yesterday
Generate nutrition reports over a week or a month
Update daily calorie, protein, carbohydrate and fat goals
Query and log daily water intake in cups
Log, update or delete intermittent fasting entries
Create private custom foods for repeat logging

Supported clients

Claude DesktopFull support