DM

delize/myfitness-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

4 stars 5 forks 质量 82 趋势 32MIT

An http streamable MyFitnessPal MCP server, to access your nutrition data on the go

概览

A deployable Model Context Protocol (MCP) server for MyFitnessPal that works as a : food diary, food search, exercises, body measurements, nutrition goals, water intake, and nutrition reports. This is a fork of AdamWalt/myfitnesspal-mcp-python (MIT, tool implementations) restructured for remote deployment with the OAuth 2.1 / streamable-http transport skeleton from garmin-mcp-service. MyFitnessPal access is via coddingtonbear/python-myfitnesspal. mfp_get_recent_foods, mfp_get_frequent_foods, and mfp_get_my_foods each take an optional limit (recent/frequent default 10, my-foods default 100, max 100) and response_format (markdown or json). They intentionally use the (/food/load_recent, /food/load_most_used, /food/load_my_foods) rather than the newer /food/mine, /meal/mine, or /food/new pages, which can redirect to /account/logout even when diary reads and API-token fetches still work. mfp_get_diary with response_format=json now surfaces an entry_id for each meal entry.

README

以下为原文 README 节选,完整内容请查看原文。

MyFitnessPal MCP Service

A deployable Model Context Protocol (MCP) server for MyFitnessPal that works as a remote Claude connector: food diary, food search, exercises, body measurements, nutrition goals, water intake, and nutrition reports.

This is a fork of AdamWalt/myfitnesspal-mcp-python (MIT, tool implementations) restructured for remote deployment with the OAuth 2.1 / streamable-http transport skeleton from garmin-mcp-service. MyFitnessPal access is via coddingtonbear/python-myfitnesspal.

Tools

Tool Type Description
mfp_get_diary Read Food diary (meals, entries, nutrition, totals, goals) for a date
mfp_search_food Read Search the MyFitnessPal food database
mfp_get_food_details Read Full nutrition breakdown for a food by MFP ID
mfp_get_recent_foods Read Recently used foods from the authenticated account
mfp_get_frequent_foods Read Most-used foods from the authenticated account
mfp_get_my_foods Read Foods created or saved by the authenticated account
mfp_get_measurements Read Body measurement history (Weight, Body Fat, …)
mfp_set_measurement Write Log a body measurement for today
mfp_get_exercises Read Logged cardio/strength exercises for a date
mfp_get_goals Read Daily nutrition goals
mfp_set_goals Write Update daily nutrition goals
mfp_get_water Read Water intake for a date, in ml
mfp_set_water Write Set the day’s water total (milliliters, or legacy cups)
mfp_add_food_to_diary Write Add a food entry to a meal
mfp_create_food Write Create a new custom food in the MyFitnessPal database
mfp_update_food_entry Write Update an existing diary entry by entry_id
mfp_delete_food_entry Write Delete an existing diary entry by entry_id
mfp_get_report Read Nutrition report (e.g. Net Calories) over a date range
mfp_get_steps Read Daily step counts synced from Apple Health / devices

Food collections (recent / frequent / my foods)

mfp_get_recent_foods, mfp_get_frequent_foods, and mfp_get_my_foods each take an optional limit (recent/frequent default 10, my-foods default 100, max 100) and response_format (markdown or json). They intentionally use the legacy add-to-diary AJAX endpoints (/food/load_recent, /food/load_most_used, /food/load_my_foods) rather than the newer /food/mine, /meal/mine, or /food/new pages, which can redirect to /account/logout even when diary reads and API-token fetches still work.

Editing diary entries

mfp_get_diary with response_format=json now surfaces an entry_id for each meal entry. Pass that id to:

在 GitHub 查看完整 README

安装

docker run -d -p 8000:8000 \
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "myfitnesspal": { "command": "python", "args": ["-m", "myfitnesspal_mcp.server"], "env": { "MFP_FIREFOX_PROFILE_DIR": "/home/you/.mozilla/firefox/abcd1234.default-release" } } } }