Skip to main content
Glama
mfp-mcp-vercel

mfp-mcp-vercel

by michadasis

mfp-mcp-vercel

MyFitnessPal connector for Claude, running on Vercel. A thin wrapper around delize/myfitness-mcp (installed as a pinned dependency) that makes it work serverless:

  • Stateless OAuth (stateless_oauth.py): client ids, auth codes and tokens are HMAC-signed payloads, so the connector stays authorized across restarts and redeploys.

  • Stateless MCP transport (app.py): fresh server task per request, JSON responses.

  • Cookies from env: MyFitnessPal session cookies come from MFP_COOKIES.

Environment variables

Variable

Required

Notes

MCP_OAUTH_PASSCODE

yes

Passcode you type once when connecting Claude. Changing it revokes all tokens.

MFP_COOKIES

yes

Raw Cookie header from a myfitnesspal.com request (DevTools, Network tab), or a JSON {name: value} dict.

MCP_RESOURCE_URL

no

Public base URL. Defaults to https://$VERCEL_PROJECT_PRODUCTION_URL.

MFP_TZ

no

Time zone for "today" in the diary. Default Europe/Athens.

MCP_ACCESS_TOKEN_TTL

no

Access token lifetime in seconds. Default 30 days.

Env var changes need a redeploy to take effect.

Related MCP server: mfp-mcp

Connect Claude

Settings, Connectors, Add custom connector, URL https://<project>.vercel.app/mcp. Leave client id/secret empty and enter the passcode on the login page.

Refreshing cookies

MyFitnessPal sessions expire (about 30 days). When tools start returning auth errors: log into myfitnesspal.com, copy the Cookie request header again, update MFP_COOKIES, redeploy.

Updating upstream

Bump the commit hash of myfitnesspal-mcp-service in pyproject.toml. app.py overrides MCP SDK internals, so keep mcp pinned and retest when bumping it.

Available Tools

18 tools
mfp_add_food_to_diaryA

Add a food item to your MyFitnessPal food diary for a specific date and meal.

This tool adds a food entry to your diary. You can search for foods using mfp_search_food to find the food ID (mfp_id) needed for this tool.

Args: params: AddFoodToDiaryInput containing: - mfp_id (str): MyFitnessPal food item ID (from mfp_search_food) - meal (str): Meal name - 'Breakfast', 'Lunch', 'Dinner', or 'Snacks' (default: 'Breakfast') - date (str, optional): Date in YYYY-MM-DD format, defaults to today - quantity (float): Number of default servings for this food (default: 1.0)

Returns: str: Confirmation message with details of the added food entry

Inputs: params (required). Returns: result

mfp_create_foodA

Create a new custom food in the MyFitnessPal database (via the v2 API).

Use this when a food is not already in MyFitnessPal (mfp_search_food returns nothing suitable) and you want it available to log. All nutrition values are entered PER ONE serving_size (e.g. serving_size='125 g' with the numbers for a 125 g portion).

On success the new food's id is returned as mfp_id; pass it to mfp_add_food_to_diary to log the food (it may take a short moment to also surface in mfp_search_food). Calling this repeatedly creates duplicate foods.

IMPORTANT: share_public=True submits the food to MyFitnessPal's shared public database and is IRREVERSIBLE -- public foods can no longer be edited or deleted. Leave it False (default) to create a private food you can later delete.

Args: params: CreateFoodInput containing: - description (str): Food name (required) - brand (str, optional): Brand/manufacturer - calories, fat, carbs, protein (float): Core macros per serving (required) - saturated_fat, polyunsaturated_fat, monounsaturated_fat, trans_fat, fiber, sugar, sodium, potassium, cholesterol, vitamin_a, vitamin_c, calcium, iron (float, optional): Additional nutrients per serving - serving_size (str): Serving-size label, e.g. '1 Serving', '125 g' (default '1 Serving') - servings_per_container (float): Servings per container (default 1.0) - share_public (bool): Submit to the public database; irreversible (default False)

Returns: str: JSON confirmation including the new food's mfp_id

Inputs: params (required). Returns: result

mfp_delete_food_entryA
Destructive

Delete an existing MyFitnessPal diary entry.

Deletes a diary entry identified by the entry_id returned by mfp_get_diary (use response_format='json' to get the entry_id).

Args: params: DeleteFoodEntryInput containing: - entry_id (str): Diary entry ID from mfp_get_diary JSON output - date (str, optional): Date in YYYY-MM-DD format, defaults to today

Returns: str: Confirmation message with the deleted entry's name and meal

Inputs: params (required). Returns: result

mfp_get_diaryA
Read-onlyIdempotent

Get the food diary for a specific date including all meals and their nutritional information.

Returns meals (Breakfast, Lunch, Dinner, Snacks) with each food entry's name, quantity, and complete nutrition breakdown (calories, protein, carbs, fat, etc.). Also includes daily totals and goals.

Args: params: GetDiaryInput containing: - date (str, optional): Date in YYYY-MM-DD format, defaults to today - response_format (str): 'markdown' or 'json'

Returns: str: Formatted diary data with meals, entries, nutrition, and goals

Inputs: params (required). Returns: result

mfp_get_exercisesA
Read-onlyIdempotent

Get logged exercises for a specific date.

Returns both cardiovascular and strength training exercises with their details (duration, calories burned, sets, reps, weight, etc.).

Args: params: GetExercisesInput containing: - date (str, optional): Date in YYYY-MM-DD format, defaults to today - response_format (str): 'markdown' or 'json'

Returns: str: List of exercises with details and calories burned

Inputs: params (required). Returns: result

mfp_get_food_detailsA
Read-onlyIdempotent

Get detailed nutritional information for a specific food item by its MFP ID.

Returns complete nutrition breakdown including calories, macros (protein, carbs, fat), fiber, sugar, sodium, cholesterol, vitamins, minerals, and available serving sizes.

Args: params: GetFoodDetailsInput containing: - mfp_id (str): MyFitnessPal food item ID from search results - response_format (str): 'markdown' or 'json'

Returns: str: Complete nutritional information for the food item

Inputs: params (required). Returns: result

mfp_get_frequent_foodsB
Read-onlyIdempotent

Get most-used foods from MyFitnessPal.

This is backed by the legacy load_most_used endpoint exposed by the add-to-diary page.

Args: params: GetFoodCollectionInput containing: - limit (int, optional): Max results (default 10, max 100) - response_format (str): 'markdown' or 'json'

Returns: str: List of most-used foods

Inputs: params (required). Returns: result

mfp_get_goalsA
Read-onlyIdempotent

Get the user's daily nutrition goals (calories, protein, carbs, fat, etc.).

Returns the configured daily targets for all tracked nutrients.

Args: params: GetGoalsInput containing: - date (str, optional): Date in YYYY-MM-DD format, defaults to today - response_format (str): 'markdown' or 'json'

Returns: str: Daily nutrition goals and targets

Inputs: params (required). Returns: result

mfp_get_measurementsA
Read-onlyIdempotent

Get body measurements (weight, body fat, etc.) over a date range.

Returns historical measurement data with dates and values. Useful for tracking weight loss progress and body composition changes.

Args: params: GetMeasurementsInput containing: - measurement (str): Type of measurement (default 'Weight') - start_date (str, optional): Start date, defaults to 30 days ago - end_date (str, optional): End date, defaults to today - response_format (str): 'markdown' or 'json'

Returns: str: Measurement history with dates and values

Inputs: params (required). Returns: result

mfp_get_my_foodsA
Read-onlyIdempotent

Get foods created or saved by the authenticated user.

This uses the legacy load_my_foods endpoint from the add-to-diary page, which remains accessible even when the modern My Foods page redirects away from authenticated sessions.

Args: params: GetFoodCollectionInput containing: - limit (int, optional): Max results (default 100, max 100) - response_format (str): 'markdown' or 'json'

Returns: str: List of foods created or saved by the account

Inputs: params (required). Returns: result

mfp_get_recent_foodsA
Read-onlyIdempotent

Get recently used foods from MyFitnessPal.

Uses the legacy diary-add AJAX endpoint that still works when newer account pages like /food/mine redirect away from authenticated sessions.

Args: params: GetFoodCollectionInput containing: - limit (int, optional): Max results (default 10, max 100) - response_format (str): 'markdown' or 'json'

Returns: str: List of recently used foods

Inputs: params (required). Returns: result

mfp_get_reportA
Read-onlyIdempotent

Get a nutrition report over a date range.

Returns daily values for the specified nutrient/metric over the date range. Useful for analyzing trends and patterns in nutrition intake.

Args: params: GetReportInput containing: - report_name (str): Report type (e.g., 'Net Calories', 'Protein') - start_date (str, optional): Start date, defaults to 7 days ago - end_date (str, optional): End date, defaults to today - response_format (str): 'markdown' or 'json'

Returns: str: Daily values and summary statistics for the report period

Inputs: params (required). Returns: result

mfp_get_waterA
Read-onlyIdempotent

Get water intake for a specific date.

Returns the number of cups/glasses of water logged for the day.

Args: params: GetWaterInput containing: - date (str, optional): Date in YYYY-MM-DD format, defaults to today

Returns: str: Water intake amount for the specified date

Inputs: params (required). Returns: result

mfp_search_foodA
Read-onlyIdempotent

Search the MyFitnessPal food database for food items.

Returns a list of matching foods with their name, brand, serving size, calories, and MFP ID (which can be used with mfp_get_food_details).

Args: params: SearchFoodInput containing: - query (str): Search query (e.g., 'chicken breast') - limit (int): Maximum results to return (default 10) - response_format (str): 'markdown' or 'json'

Returns: str: List of matching food items with basic nutrition info

Inputs: params (required). Returns: result

mfp_set_goalsA
Idempotent

Update daily nutrition goals (calories, protein, carbs, fat).

Sets new daily targets for the specified nutrients. Only updates the values that are provided; others remain unchanged.

Args: params: SetGoalsInput containing: - calories (int, optional): Daily calorie goal - protein (int, optional): Daily protein goal in grams - carbohydrates (int, optional): Daily carb goal in grams - fat (int, optional): Daily fat goal in grams

Returns: str: Confirmation message with updated goals

Inputs: params (required). Returns: result

mfp_set_measurementA

Log a new body measurement (weight, body fat, etc.) for today.

Records the measurement value in MyFitnessPal for tracking progress.

Args: params: SetMeasurementInput containing: - measurement (str): Type of measurement (default 'Weight') - value (float): Measurement value (e.g., 185.5)

Returns: str: Confirmation message with the logged value

Inputs: params (required). Returns: result

mfp_set_waterA

Log water intake for a specific date.

Sets the number of cups of water consumed for the day. MyFitnessPal uses cups as the unit (1 cup = ~237ml).

Args: params: SetWaterInput containing: - cups (float): Number of cups of water (e.g., 2.5 for 2.5 cups) - date (str, optional): Date in YYYY-MM-DD format, defaults to today

Returns: str: Confirmation message with the logged water amount

Inputs: params (required). Returns: result

mfp_update_food_entryA

Update an existing MyFitnessPal diary entry.

Supports changing the meal, quantity, serving size, and date for an entry previously returned by mfp_get_diary (use response_format='json' to get the entry_id). MyFitnessPal can rewrite an entry during edit and return a replacement row, so the response includes current_entry_id and entry_id_changed to keep callers tracking the right diary row.

Args: params: UpdateFoodEntryInput containing: - entry_id (str): Diary entry ID from mfp_get_diary JSON output - date (str, optional): Date in YYYY-MM-DD format, defaults to today - meal (str, optional): New meal name - quantity (float, optional): New number of servings - unit (str, optional): New serving-size label - weight_id (str, optional): Raw MFP serving-size option ID

Returns: str: Confirmation with the current entry id and whether it changed

Inputs: params (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools map to a distinct resource+action, making selection straightforward. The main risk is the cluster of food-collection readers (mfp_get_recent_foods, mfp_get_frequent_foods, mfp_get_my_foods) which share an identical input shape and are easy to confuse, though descriptions clarify the difference.

    Naming Consistency5/5

    Every tool follows a strict mfp_verb_noun pattern (get_diary, set_goals, add_food_to_diary, delete_food_entry, etc.), including the mfp_ prefix throughout. Verb choice is consistent (get/set/add/create/update/delete/search) and predictable.

    Tool Count4/5

    18 tools is on the high side but justified by a broad personal-tracking domain spanning diary, food database, measurements, goals, water, exercises, and reports. Each tool maps to a real operation, though the food-collection trio could be collapsed to reduce surface slightly.

    Completeness4/5

    Diary CRUD (get/add/update/delete) is fully covered and goals, water, and measurements have read+write pairs. Notable gaps remain: exercises are read-only (no logging tool) and there is no delete/update tool for created custom foods, despite mfp_create_food mentioning they 'can later delete'.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude to manage MyFitnessPal food diaries, nutrition goals, exercises, body measurements, and water intake via a remote MCP server using session cookie authentication.
      19
      4
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Connect MyFitnessPal to Claude or any MCP client. Log meals, search food database with macros, track trends, and export nutrition history against your real MyFitnessPal diary.
      18
      620 PyPI
      31
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to access your MyFitnessPal diary—foods, portions, meal and daily nutrition totals, water, exercise, steps, and weight—through a custom connector on web, desktop, and mobile.
      9 npm
      MIT