# MyFitnessPal

Connects an AI coding client to your MyFitnessPal diary for food logging, product lookup, and nutrition analysis.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 26
- Author: Mason-Levyy
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Mason-Levyy/myfitnesspal-mcp
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/myfitnesspal

## What it does

This MCP server lets Claude Code work with a MyFitnessPal diary through chat. It can add, edit, and remove diary entries, find foods with macro data, inspect daily meals, follow weight trends, and export nutrition history.

The process runs with `uvx mfp-mcp` and authenticates through a browser session cookie. You need `uv` and `MFP_COOKIE` before connecting it; the client configuration also uses `MFP_USERNAME`. Optional session renewal relies on a headless browser profile and `Playwright`. MyFitnessPal has no public API, so the server depends on private web endpoints and can stop working when the site changes.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `MFP_COOKIE`, `MFP_USERNAME` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env MFP_COOKIE=<MFP_COOKIE> --env MFP_USERNAME=<MFP_USERNAME> --transport stdio myfitnesspal -- uvx mfp-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mfp-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add myfitnesspal --env MFP_COOKIE=<MFP_COOKIE> --env MFP_USERNAME=<MFP_USERNAME> -- uvx mfp-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mfp-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "myfitnesspal": {
            "command": "uvx",
            "args": [
                "mfp-mcp"
            ],
            "env": {
                "MFP_COOKIE": "<MFP_COOKIE>",
                "MFP_USERNAME": "<MFP_USERNAME>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mfp-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "myfitnesspal": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mfp-mcp"
            ],
            "env": {
                "MFP_COOKIE": "<MFP_COOKIE>",
                "MFP_USERNAME": "<MFP_USERNAME>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mfp-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MFP_COOKIE=<MFP_COOKIE> -e MFP_USERNAME=<MFP_USERNAME> myfitnesspal uvx mfp-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mfp-mcp <command>

## When to use it
- log meals into a MyFitnessPal diary
- find foods together with macro values
- review what was eaten on a given day
- track weight and nutrition trends
- export diary history for analysis

## Example prompts
- Log a banana as a snack in MyFitnessPal.
- Show what I ate yesterday and group the entries by meal.
- Chart my weight for this month.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
