SuperAPIAI Directory

myfitnesspal-mcp

github.com · AI developer platforms

MyFitnessPal MCP is a free and open-source MCP server for connecting MyFitnessPal to any MCP client such as Claude, Cursor, and VS Code. It authenticates via browser session cookies, supports logging meals through conversation, searching foods and macronutrients, tracking trends, exporting nutrition history, and can perform write operations directly on a real MyFitnessPal diary (log, modify, delete). The project is published as mfp-mcp on PyPI and the official MCP Registry under the MIT license. Note: this is an unofficial tool; MyFitnessPal has no public API, and it reverse-engineers the web app's endpoints, which may break as the site changes. Use at your own risk.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS

About this tool

MyFitnessPal MCP is a free, open-source MCP server designed to connect MyFitnessPal with AI assistants. It allows users to interact with Claude, Cursor, VS Code, or any MCP-compatible client through natural language to directly operate their own MyFitnessPal diary.

Purpose

This tool's main purpose is to let users manage food logging and nutrition tracking through conversation. Users can say "log a banana as a snack," "what did I eat yesterday?" or "chart my weight for this month," and the server translates these requests into actual operations on MyFitnessPal.

Key Capabilities

  • Food Logging: Supports logging, modifying, and deleting real diary entries, including foods, weight, water intake, and daily notes.
  • Food Search: Can search the food database and retrieve macronutrient information, using a "search first, then log" workflow to ensure accurate logging.
  • Trend Tracking: Reads a local SQLite cache (backfilling missing days from MyFitnessPal) to provide daily summaries and trend analysis.
  • Data Export: Supports exporting nutrition history.
  • Authentication and Auto-Refresh: Uses browser session cookies for authentication, with an optional auto-refresh feature that rotates tokens via a headless browser and automatically retries when calls fail.
  • Remote/HTTP Mode: Uses stdio transport by default, and also supports streamable HTTP mode (path /mcp), but has no built-in authentication and is not recommended for exposure to the public internet.

Usage

  1. Authentication: Run uvx mfp-mcp auth, and follow the prompts to paste the __Secure-next-auth.session-token cookie value copied from your browser DevTools. macOS users can use mfp-mcp auth --clipboard to automatically read it from the clipboard.
  2. Add to Client: Add the server configuration according to your client type. For example, Claude Code uses claude mcp add myfitnesspal -- uvx mfp-mcp; Claude Desktop, Cursor, Windsurf, Cline, etc. use the same JSON configuration:{"mcpServers":{"myfitnesspal":{"command":"uvx","args":["mfp-mcp"]}}}. VS Code can use code --add-mcp '{"name":"myfitnesspal","command":"uvx","args":["mfp-mcp"]}'。
  3. Start the conversation: Once installed, you can operate it via natural language instructions.

Use cases

Suitable for MyFitnessPal users who want to simplify meal logging and nutrition tracking with an AI assistant, especially users accustomed to MCP clients such as Claude and Cursor. Also suitable for scenarios requiring batch export or analysis of nutrition data.

Limitations

  • Unofficial tool: MyFitnessPal does not have a public API; this server reverse-engineers web endpoints and may break due to website changes.
  • Authentication relies on cookies: Sessions are valid for 30 days (from the last renewal), and you need to use it regularly or set up automatic refresh to keep it active.
  • HTTP mode without built-in authentication: Remote mode has no authentication and must be protected via VPN, reverse proxy, or OAuth gateway.
  • Data privacy: The server communicates only with MyFitnessPal; session cookies and local data are stored locally, but tool results are sent to the connected MCP client and model.
  • Requires uv: Running requires the uv tool to be installed.

This project is licensed under the MIT License, and parts of the code are adapted from python-myfitnesspal.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools