Skip to main content
Glama
ansonyuu

MyFitnessPal MCP Server

by ansonyuu

MyFitnessPal MCP Server

An MCP server that lets AI assistants read and log your MyFitnessPal nutrition data. Track calories, macros, search foods, and add meals — all through natural conversation.

Tools

Tool

Description

get_diary

Get food diary entries for a specific date

get_nutrition_summary

Get calories and macros summary for a date

get_goals

Get your daily calorie and macro targets

quick_add_calories

Quick-add calories (and optionally macros) to a meal

search_food

Search the MFP food database

get_food_details

Get nutrition info and serving sizes for a food item

add_food

Log a food item to your diary

Related MCP server: MyFitnessPal MCP Server

Setup

MyFitnessPal doesn't have a public API, so this server authenticates using your browser's session cookie.

  1. Log into MyFitnessPal in your browser

  2. Open DevTools (F12 or Cmd+Option+I)

  3. Go to ApplicationCookieswww.myfitnesspal.com

  4. Copy the full cookie string (or use the helper script below)

Or use the helper script:

npm run export-cookies

2. Configure environment

cp env.example .env

Fill in your values:

MFP_SESSION_COOKIE=your_session_cookie_value_here
MFP_USERNAME=your_username

3. Build

npm install
npm run build

Usage

Claude Code

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "myfitnesspal": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/myfitnesspal-mcp/dist/index.js"]
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "myfitnesspal": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/myfitnesspal-mcp/dist/index.js"]
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "myfitnesspal": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/myfitnesspal-mcp/dist/index.js"]
    }
  }
}

Replace /path/to/myfitnesspal-mcp with the actual path to this repo.

Remote Deployment (Cloudflare Workers)

The worker/ directory contains a Cloudflare Workers deployment for using this as a remote MCP server.

cd worker
npm install
npx wrangler login
npx wrangler deploy
npx wrangler secret put MFP_SESSION_COOKIE   # paste your cookie when prompted

Then connect from Claude Desktop:

{
  "mcpServers": {
    "myfitnesspal": {
      "command": "npx",
      "args": ["mcp-remote", "https://myfitnesspal-mcp.<your-subdomain>.workers.dev/mcp"]
    }
  }
}

Session Expiration

MFP session cookies expire roughly every 30 days. If you get auth errors, grab a fresh cookie from your browser and update your .env (or run npx wrangler secret put MFP_SESSION_COOKIE for the worker).

License

MIT

Disclaimer

Unofficial integration for personal use. Please respect MyFitnessPal's Terms of Service.

Available Tools

7 tools
add_foodA

Add a food item to your diary. Use search_food to find the food ID first. Optionally use get_food_details to find a specific serving size.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format. Defaults to today if not provided.
mealYesThe meal slot to add calories to
food_idYesThe food item ID from search results
quantityYesNumber of servings (e.g., 1, 0.5, 2)
serving_idNoServing size ID from get_food_details (uses default if not specified)

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral disclosure. It usefully indicates a prerequisite workflow (search first) and an optional step for serving sizes, but it does not describe side effects such as whether duplicate entries are created or whether the action is irreversible. It is not contradictory, but behavioral detail is modest.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no filler: the main action is front-loaded, and the supporting instructions are actionable. Every word contributes to making the tool callable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given full schema coverage and the procedural hints, an agent has all required information to invoke the tool correctly. The only gap is a note about response behavior or non-reversibility, which is a minor omission for a straightforward write operation with no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description's references to search_food and get_food_details reinforce what the schema already states for food_id and serving_id but add no new meaning. No parameter semantics are clarified beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action and target: 'Add a food item to your diary.' This is a specific verb-object statement that distinguishes it from read tools like get_diary. It does not explicitly name sibling tools like quick_add_calories, so it misses the top score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit procedural guidance: use search_food to find the food ID first, and optionally use get_food_details for a serving size. This tells an agent the correct sequencing. However, it does not state when to prefer quick_add_calories or other alternatives, so the exclusion guidance is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_diaryA

Get food diary entries for a specific date. Returns all meals with their food entries and calorie/macro totals.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format. Defaults to today if not provided.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral disclosure burden. It clearly indicates a read operation and describes the returned data, but it does not mention authentication, data scope, or any caveats. Adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that front-loads the verb and resource, then adds return information. There is no filler or redundant content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with one optional parameter, the description provides enough context for invoking it correctly and states the return shape. It lacks only explicit sibling differentiation and scope detail, which are minor at this complexity level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents the date parameter including format and default behavior. The description only rephrases 'specific date' and adds no meaningful semantic detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get') and resource ('food diary entries for a specific date'), and specifies the return content (meals, food entries, calorie/macro totals). This clearly distinguishes it from siblings like get_goals or get_nutrition_summary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'for a specific date' implies when to use it, but the description provides no explicit comparison or exclusions relative to sibling tools such as get_nutrition_summary. Usage guidance is largely left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_food_detailsA

Get detailed nutrition information and serving sizes for a specific food item. Use the food ID from search_food results.

ParametersJSON Schema
NameRequiredDescriptionDefault
food_idYesThe food item ID from search results

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It implies a read-only fetch via 'Get' and describes the return content, but it does not disclose behavior for invalid IDs, missing data, or whether any broader side effects exist. The description is adequate but not richly transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with no filler. The core purpose is front-loaded, and the prerequisite is stated in the second sentence. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple single-parameter fetch tool with no output schema, the description is mostly sufficient: it says what the tool returns and where the input comes from. It lacks explicit exclusion criteria or error/edge-case behavior, but the low complexity keeps the gap minor.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already explains food_id as 'The food item ID from search results'. The description reinforces this by naming search_food as the source, but adds little beyond the structured schema definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'Get' and the resource: detailed nutrition information and serving sizes for a specific food item. It specifically references food IDs from search_food results, which differentiates it from nearby tools like get_nutrition_summary or search_food.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly indicates when to use the tool: after search_food, to retrieve detailed nutrition data for a specific item. It gives a concrete prerequisite but does not explicitly list when not to use it or name alternative tools it competes with, so it falls just short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_goalsA

Get your daily calorie and macro goals from MyFitnessPal.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. 'Get' clearly signals a read-only operation, but no information is provided about authentication, response format, or whether daily goals are for the current day or general targets. This is minimally adequate but sparse.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no filler. It front-loads the action and the resource, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters, no output schema, and no annotations, the description is reasonably complete for a simple getter. However, it leaves ambiguity about whether 'daily' refers to the current day's values or a general daily target, and it does not mention any prerequisites or caveats.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters and 100% coverage, so the baseline is 4. The description adds useful semantic context by specifying 'daily calorie and macro goals,' which clarifies the expected output without needing parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get') and resource ('daily calorie and macro goals from MyFitnessPal'), clearly distinguishing it from sibling tools like get_diary or get_nutrition_summary. It precisely states what the tool returns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives such as get_diary or get_nutrition_summary. The description implies it is for goals, but does not state exclusions or conditions for choosing an alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_nutrition_summaryA

Get a nutrition summary for a specific date, including calories, carbs, fat, protein, sodium, and sugar with their goals.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format. Defaults to today if not provided.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral disclosure. The verb 'Get' indicates a read-only operation, and the description states what data is returned. It does not discuss edge cases like missing data for a date, but for a simple retrieval tool this is reasonable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one focused sentence that front-loads the action and resource, then lists the relevant output fields. There is no filler or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one optional parameter and no output schema, the description supplies the essential output fields and a clear call pattern. The only minor gap is not explicitly stating the default-date behavior, which the schema already covers.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with the date parameter already documented as YYYY-MM-DD and defaulting to today. The description merely restates the notion of a specific date and adds no new parameter syntax or constraints beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('Get'), a clear resource ('nutrition summary for a specific date'), and enumerates the returned fields (calories, carbs, fat, protein, sodium, sugar with goals). This is specific enough to differentiate from sibling tools like get_diary or get_goals, even without naming them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'for a specific date' implies when the tool is appropriate, and the nutrient list implies a daily-summary use case. However, it gives no explicit guidance about when to prefer this over siblings such as get_diary or get_goals, and no alternative conditions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

quick_add_caloriesB

Add calories to your diary using Quick Add. Optionally specify carbs, fat, and protein.

ParametersJSON Schema
NameRequiredDescriptionDefault
fatNoFat in grams (optional)
dateNoDate in YYYY-MM-DD format. Defaults to today if not provided.
mealYesThe meal slot to add calories to
carbsNoCarbohydrates in grams (optional)
proteinNoProtein in grams (optional)
caloriesYesNumber of calories to add

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden, yet it only restates the action without covering side effects. It does not state whether this appends a new diary entry, whether the entry is editable afterward, or how it impacts nutrition summaries and goals. For a mutation tool with zero annotation coverage, this is a meaningful gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences totaling 17 words with the core action front-loaded in the first sentence. The second sentence adds only the optional-macro information and nothing is wasted. Structure is exemplary for the content it carries.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter mutation tool with no annotations and no output schema, the description is lean but adequate. The schema covers parameters and the description covers purpose and optionality, but nothing addresses success/return behavior or the boundary with add_food. An agent would benefit from one more sentence on what the call returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all six parameters, including optionality and the date default. The description's mention of optional carbs, fat, and protein is redundant with the schema but serves as harmless reinforcement. Baseline 3 applies because the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Add calories to your diary') and names the entry mode ('Quick Add'), which conceptually separates it from the read-only siblings and add_food. However, it never explicitly names add_food or explains how Quick Add differs from logging a specific food, so sibling differentiation remains implicit rather than explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance is given; the description never says 'use this when logging calories without a specific food item' or contrasts it with add_food. The 'Quick Add' phrasing implies the fast-entry use case, but an agent must infer when this tool is the right choice among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_foodA

Search the MyFitnessPal food database. Returns food items with calories and macros.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (default: 1)
queryYesSearch query (e.g., "banana", "chicken breast", "Chipotle burrito bowl")
max_resultsNoMaximum results to return (default: 20, max: 50)

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations, so the description carries the burden of explaining behavior. It communicates that this is a read-style search operation and specifies that results include calories and macros. However, it does not disclose pagination semantics, result structure, access requirements, or rate limits, which would be useful for a tool with no output schema and no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short declarative sentences with no filler. The core action is front-loaded, and the return value is stated immediately in the second sentence, making the tool easy to scan and invoke.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a low-complexity search tool this is adequate: the required query parameter is obvious and the return content is named. However, with no output schema and no annotation coverage, the absence of any return-format details and no guidance about get_food_details as an alternative leaves meaningful gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers all three parameters with descriptions, valid ranges, and examples, so the description is not required to explain them. The description adds no parameter-specific meaning beyond implying the query is a text search against the food database.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Search'), a clear resource ('the MyFitnessPal food database'), and the expected return payload ('food items with calories and macros'). This is distinct from sibling tools like get_diary or add_food, and it is not a tautology of the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly establishes the tool as the food-search entry point and implies it should be used when a user wants to find foods with nutritional data by query text. It does not explicitly name alternatives or exclusion cases, such as using get_food_details for a known food ID, so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 7 tool updatesv1.0.0
    • First observedadd_food
    • First observedget_diary
    • First observedget_food_details
    • First observedget_goals
    • First observedget_nutrition_summary
    • First observedquick_add_calories
    • First observedsearch_food

TDQS

A3.8/5.0

Scored across 7 tools

Disambiguation4/5

Most tools are clearly distinct: search_food and get_food_details relate to the food database, while get_diary and get_nutrition_summary relate to daily records. There is minor overlap between get_diary and get_nutrition_summary since both expose calorie/macro totals, but their descriptions clarify the different levels of detail.

Naming Consistency5/5

Tool names follow a consistent snake_case verb_noun pattern: get_diary, get_goals, search_food, add_food, quick_add_calories. The naming style is uniform and predictable across all seven tools.

Tool Count5/5

Seven tools is a well-scoped size for a nutrition diary server. Each tool covers a meaningful part of the workflow—viewing data, searching foods, and logging entries—without unnecessary redundancy.

Completeness3/5

The server covers core read and add workflows: viewing diary data, searching foods, getting details, and adding entries. However, it lacks update and delete operations for diary entries, which is a notable gap when correcting mistakes or modifying logged food.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers