# MyFitnessPal MCP

> MyFitnessPal MCP is an open-source MCP server for health and science. Log meals, weight and water in MyFitnessPal by talking to your AI assistant. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows
- **Repository:** https://github.com/mason-levyy/myfitnesspal-mcp
- **MCP Registry name:** io.github.Mason-Levyy/mfp-mcp
- **Categories:** health and science
- **Listing updated:** 2026-11-15

## About

This unofficial server talks to MyFitnessPal's web endpoints, since the service has no public API, and lets an assistant search foods with macros and write real diary entries. Because MyFitnessPal sits behind Cloudflare and NextAuth, it signs in with your browser session cookie over a Chrome-like TLS fingerprint instead of a username and password. Sessions last 30 days from last renewal, and an optional headless browser profile can refresh an expired session and retry the call.

Food logging is draft-then-confirm: a draft tool returns numbered options with every serving size, filtered by calorie or macro targets, and a log tool then writes the chosen item, so the diary does not depend on search order. Other tools read totals and remaining macros for a day, edit or delete entries, mark a day complete, log weight and water, read exercise, and export a date range or trends.

The README warns it can break whenever MyFitnessPal changes its site. It is free and open source, published on PyPI as mfp-mcp, and needs uv.

## Features

- **Draft then log:** Choose from numbered food options before anything is written.
- **Macro-aware search:** Filter candidates by calorie and macro targets.
- **Weight and water logging:** Add water in several units and record weight.
- **Diary editing:** Modify, replace or delete entries.
- **Trends and export:** Report a metric over a range or export whole dates.
- **Session auto-refresh:** Optional headless profile renews expired sessions.

## Good for

- Say what you ate and have it logged
- Find a high-protein snack under a calorie limit
- Chart weight over a month
- Export a week of nutrition data

## Install

### Claude Code (Terminal)

```sh
claude mcp add mfp-mcp --env MFP_COOKIE='<MFP_COOKIE>' -- uvx mfp-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mfp-mcp": {
      "command": "uvx",
      "args": [
        "mfp-mcp"
      ],
      "env": {
        "MFP_COOKIE": "<MFP_COOKIE>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mfp-mcp": {
      "command": "uvx",
      "args": [
        "mfp-mcp"
      ],
      "env": {
        "MFP_COOKIE": "<MFP_COOKIE>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mfp-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mfp-mcp"
      ],
      "env": {
        "MFP_COOKIE": "<MFP_COOKIE>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mfp-mcp": {
      "command": "uvx",
      "args": [
        "mfp-mcp"
      ],
      "env": {
        "MFP_COOKIE": "<MFP_COOKIE>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mfp-mcp": {
      "command": "uvx",
      "args": [
        "mfp-mcp"
      ],
      "env": {
        "MFP_COOKIE": "<MFP_COOKIE>"
      }
    }
  }
}
```

## Tools

- `fitness_get_day`: Totals, goals, entries and notes for a day.
- `fitness_search_food`: Candidate foods with macros and servings.
- `fitness_draft_food`: Numbered options with servings, filtered by targets.
- `fitness_log_food`: Log a chosen food to the diary.
- `fitness_list_food_pins`: List remembered food choices.
- `fitness_clear_food_pin`: Forget remembered choices.
- `fitness_delete_food`: Remove a diary entry.
- `fitness_modify_food`: Replace an entry or change its quantity.
- `fitness_complete_day`: Check, mark or reopen a completed day.
- `fitness_log_weight`: Log a weight.
- `fitness_log_water`: Add or set water intake.
- `fitness_get_exercise`: Read the exercise diary.
- `fitness_get_exercise_entries`: List cardio and strength entries.
- `fitness_delete_exercise`: Remove an exercise entry.
- `fitness_get_note`: Read the daily diary note.
- `fitness_log_note`: Write the daily diary note.
- `fitness_log_feel`: Save a local how-I-feel note.
- `fitness_get_trends`: One metric over a date range.
- `fitness_bulk_export`: Export a whole date range.

## FAQ

### Is it official?

No. The README says MyFitnessPal has no public API and this reverse-engineers its web endpoints.

### How does login work?

You paste your __Secure-next-auth.session-token cookie via mfp-mcp auth.

### Can it write to my diary?

Yes, it can log, modify and delete entries.

### What does it cost?

Free and open source.

### Is MyFitnessPal MCP free?

Yes. MyFitnessPal MCP is open source, so you can use and self-host it for free.

### How do I add MyFitnessPal MCP to Claude Code?

Run this command in your terminal: claude mcp add mfp-mcp --env MFP_COOKIE='<MFP_COOKIE>' -- uvx mfp-mcp

### What are the best alternatives to MyFitnessPal MCP?

The closest alternatives to MyFitnessPal MCP are Tooluniverse, Oya Browser, Later Stages, MedXpert 标准检索连接器 and MedXpert 全球法规连接器 (reg-connector).

## Alternatives

- [Tooluniverse](https://ai-powered.com/mcp/tooluniverse): Tooluniverse is an open-source MCP server for health and science.
- [Oya Browser](https://ai-powered.com/mcp/oya-browser): Oya Browser is a freemium MCP server for browser automation.
- [Later Stages](https://ai-powered.com/mcp/later-stages): Later Stages is a free MCP server for health and science.
- [MedXpert 标准检索连接器](https://ai-powered.com/mcp/medxpert-2): MedXpert 标准检索连接器 is a free MCP server for legal and government.
- [MedXpert 全球法规连接器 (reg-connector)](https://ai-powered.com/mcp/medxpert-reg-connector): MedXpert 全球法规连接器 (reg-connector) is a free MCP server for legal and government.
- [Splyt](https://ai-powered.com/mcp/splyt): Splyt is a free MCP server for health and science.
- [Health Agent](https://ai-powered.com/mcp/health-agent): Health Agent is an MCP server for health and science.
- [Pausila](https://ai-powered.com/mcp/pausila): Pausila is a free MCP server for local services.

---
Source: https://ai-powered.com/mcp/myfitnesspal-mcp
