Skip to main content
Glama

MyFitnessPal MCP

English documentation. For the French version, see README.fr.md.

Local TypeScript MCP server that extracts a public MyFitnessPal food diary from the printable page and returns it as readable Markdown, with one block per day.

Before you start

For this MCP to work, your MyFitnessPal food diary must be visible to other users, and you need to know your exact MyFitnessPal username.

Make your diary public

MyFitnessPal states that the food diary is private by default. You need to set it to public so the public printable URL can be used by this MCP.

From the mobile app

  1. Open the MyFitnessPal app.

  2. Tap your profile photo at the top.

  3. Tap the gear icon in the top-right corner to open Settings.

  4. Open Diary Settings.

  5. Set Diary Sharing to Public.

From the web app

  1. Sign in to www.myfitnesspal.com.

  2. Click Settings.

  3. Open Diary Settings under Account Settings.

  4. Set Diary Sharing to Public.

Find your MyFitnessPal username

From the mobile app

MyFitnessPal indicates that the username can be viewed through the profile edit flow:

  1. Open the MyFitnessPal app.

  2. Tap your profile photo at the top.

  3. Your username appears at the top.

Simple method from the web app

  1. Sign in to www.myfitnesspal.com.

  2. At the top, you should see Hi, {username}.

Related MCP server: MyFitnessPal MCP Server

Exposed tool

get_food_diary_markdown

Parameters:

  • startDate: ISO date in YYYY-MM-DD

  • endDate: ISO date in YYYY-MM-DD

Constraints:

  • the range must cover exactly 1 day or 7 consecutive days

  • all visible table columns are preserved

  • the output includes Markdown text and a structuredContent payload with daily blocks

  • the username is defined when the server starts via args, not in the tool call

  • in 7-day mode, the server only returns days that are actually present in the diary

Installation in Perplexity App

This procedure targets the Perplexity macOS app. According to the Perplexity Help Center, local MCP support is currently available in the macOS app and relies on the PerplexityXPC helper.

1. Prepare the server

From this repository:

npm install
npm run install:browser
npm run build
which node

Note the output of which node. It will be used to launch the server with an absolute path. Example:

/opt/homebrew/bin/node

2. Add the MCP in Perplexity

  1. Open Perplexity.

  2. Go to Account Settings, then Connectors.

  3. If prompted, install the PerplexityXPC helper.

  4. Go back to Connectors, then click Add Connector.

  5. In the Simple tab, create a connector.

  6. Give it a name, for example MyFitnessPal Diary.

  7. In the command field, use an absolute command like this:

/opt/homebrew/bin/node /Users/fabio/Documents/Projects/mfp-mcp/dist/src/index.js --username=your_mfp_username
  1. Save it, then verify the status changes to Running.

  2. On the main Perplexity screen, enable this MCP in Sources.

3. Test

For example, ask:

Use get_food_diary_markdown to retrieve the diary from 2024-08-29 to 2024-08-29.

If Perplexity cannot find node, replace the command with the exact absolute path returned by which node.

Installation in Claude App

This procedure targets Claude Desktop on macOS.

1. Prepare the server

From this repository:

npm install
npm run install:browser
npm run build
which node

2. Open the Claude Desktop MCP config

In Claude Desktop:

  1. Open Settings.

  2. Go to Developer.

  3. Click Edit Config.

On macOS, the file is usually:

~/Library/Application Support/Claude/claude_desktop_config.json

3. Add this server

Add or merge this JSON block:

{
  "mcpServers": {
    "myfitnesspal-food-diary": {
      "command": "/opt/homebrew/bin/node",
      "args": [
        "/Users/fabio/Documents/Projects/mfp-mcp/dist/src/index.js",
        "--username=your_mfp_username"
      ]
    }
  }
}

If you already have other MCP servers, just add the myfitnesspal-food-diary entry inside mcpServers without overwriting the rest.

4. Restart Claude

  1. Save claude_desktop_config.json.

  2. Fully quit Claude Desktop.

  3. Reopen Claude Desktop.

The server should then appear in the available MCP tools.

5. Test

For example, ask:

Analyze my meals from yesterday on MyFitnessPal.

Quick troubleshooting

  • Always use absolute paths, not relative paths.

  • Check that npm run build generated dist/src/index.js.

  • Check that Playwright Chromium is installed with npm run install:browser.

  • If Claude does not see the server, inspect the logs in ~/Library/Logs/Claude.

  • If node is not found, replace command with the exact value returned by which node.

Output format

The returned text is Markdown, for example:

## Aug 29, 2024

### Breakfast

| Foods | Calories | Carbs | Fat | Protein | Cholest | Sodium | Sugar | Fiber |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Orange juice, 1 cup | 119 | 28g | 0g | 2g | 0mg | 5mg | 21g | 1g |

In weekly mode, the server also returns a markdownBlocks structure with a distinct Markdown block for each day.

Known limitations

  • parsing depends on the current HTML structure of the MyFitnessPal printable page

  • loading depends on Playwright/Chromium so the page can execute its JavaScript

  • if MyFitnessPal returns an anti-bot page, the server returns an explicit error

  • this server is meant for local use with a public diary and no authentication

Development

npm install
npm run install:browser
npm run build
npm test

Development in stdio mode:

npm run dev

Production build:

npm run build
npm start

The server needs a real browser rendering step so MyFitnessPal can execute its JavaScript. Install Chromium once:

npm run install:browser

References

Available Tools

1 tool
get_food_diary_markdownMyFitnessPal Food DiaryA

Fetch the public MyFitnessPal printable food diary for one day or seven consecutive days and return readable Markdown blocks per day for the username configured at server startup.

Inputs: endDate (required), startDate (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 1 tool

    Disambiguation5/5

    Only one tool exists, so there is no possibility of confusion with another tool. Its purpose—fetching a diary as Markdown—is clearly stated.

    Naming Consistency4/5

    The single name follows a clear verb_noun+format pattern (get_food_diary_markdown) and is descriptive. Consistency cannot be fully demonstrated with only one tool, so it falls short of a perfect score.

    Tool Count3/5

    A single tool is thin even for a narrow read-only server; basic related operations (e.g. nutrition totals, date lookup) are absent. The count is defensible for a minimal integration but feels under-scoped.

    Completeness2/5

    The surface covers only a fixed one-day or seven-day diary fetch for a preconfigured user, with no nutrition summary, no flexible date ranges, and no other diary reads. Common agent needs will hit dead ends quickly.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers