Fatsecret Mcp

io.github.fliptheweb由 GitHub 账号 fliptheweb 发布v0.0.10更新于 Nov 1, 2026

MCP server for FatSecret API - food search, nutrition, diary, recipes, weight tracking (unofficial)

已验证STDIO仅桌面位置与生活数据与分析

概览

AI 生成的概览

非官方的 FatSecret MCP 服务器,让助手搜索食物与食谱、查询营养数据,并管理 FatSecret 饮食日记、体重和运动记录。

可以做什么
  • 搜索食物、查看详情与条码、自动补全,并浏览食物分类、子分类、品牌和食谱类型
  • 搜索食谱并查看含食材、做法和营养的详情
  • 读取、新增、编辑、删除和复制饮食日记条目,获取每月热量与宏量营养素汇总
  • 管理常用餐及其条目,以及收藏的食物和食谱
  • 记录体重并查看每月体重历史
  • 列出运动类型、调整运动时长、查看每月运动消耗、保存运动模板,并读取个人资料
适用场景
适合希望让助手查询营养信息、规划或记录饮食,并在同一对话中维护 FatSecret 日记、体重和运动记录,而不必切换到 FatSecret 应用或网站的场景。
运行要求
通过 npx 在本地运行,需要 Node.js 18 或更高版本。需要免费的 FatSecret Platform API 账户,以及 FATSECRET_CLIENT_ID、FATSECRET_CLIENT_SECRET 和 FATSECRET_CONSUMER_SECRET 三项凭据,可通过环境变量提供或经设置工具保存。个人资料类工具还需通过浏览器 PIN 流程对用户的 FatSecret 账户完成 OAuth 1.0 授权。部分工具仅限 FatSecret Premier 套餐。
安装前请注意
需要 API 密钥(FATSECRET_CLIENT_ID、FATSECRET_CLIENT_SECRET、FATSECRET_CONSUMER_SECRET);设置工具会把它们连同 OAuth 令牌写入主目录下的配置文件,桌面扩展则存入系统钥匙串。个人资料类工具会在真实 FatSecret 账户上新增、修改和删除日记条目、常用餐、收藏、体重和运动数据。部分工具仅限 Premier。它不是 FatSecret 官方服务器。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Fatsecret Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

FatSecret MCP Server [FatSecret Logo]

[!IMPORTANT] This is not an official MCP server by FatSecret. It uses the FatSecret Platform API which requires a free developer account.

An MCP (Model Context Protocol) server that connects Claude/Cursor to the FatSecret Platform API. Search foods, track your diet, manage recipes, and monitor weight directly from your AI assistant.

Available on NPM: npx fatsecret-mcp | Claude Desktop Extension: fatsecret-mcp.mcpb

✨ Features

  • 🔐 Authentication — Interactive credential setup and OAuth authorization
  • 🔍 Food Search — Search FatSecret's extensive food database with detailed nutrition data
  • 📷 Barcode Lookup — Find foods by GTIN-13 barcode
  • 🍳 Recipe Search — Browse and filter recipes by calories, macros, and prep time
  • 📝 Food Diary — Add, edit, copy, and delete food diary entries
  • 🍽️ Saved Meals — Create and manage reusable meal templates
  • ⚖️ Weight Tracking — Record and view weight history
  • 🏃‍♂️ Exercise Tracking — View exercises and manage activity entries
  • ⭐ Favorites — Manage favorite foods and recipes

🚀 Quick Start

Add to your MCP client configuration:

json
{  "mcpServers": {    "fatsecret": {      "command": "npx",      "args": ["-y", "fatsecret-mcp"]    }  }}

That's it! On first use, the AI will guide you through setup:

  1. check_auth_status — detects missing credentials and tells you what to do
  2. setup_credentials — you provide your API keys (saved to ~/.fatsecret-mcp/config.json)
  3. start_auth → complete_auth — authorize your FatSecret account for diary/weight tools

Alternatively, you can pass credentials as environment variables:

json
{  "mcpServers": {    "fatsecret": {      "command": "npx",      "args": ["-y", "fatsecret-mcp"],      "env": {        "FATSECRET_CLIENT_ID": "your_client_id",        "FATSECRET_CLIENT_SECRET": "your_client_secret",        "FATSECRET_CONSUMER_SECRET": "your_consumer_secret"      }    }  }}

🔑 Where to Get Credentials

  1. Create a free account at platform.fatsecret.com
  2. Navigate to My Account → API Keys
  3. You'll see three values:
    • Client ID (used for both OAuth 2.0 and OAuth 1.0)
    • Client Secret (OAuth 2.0 - for public food/recipe search)
    • Consumer Secret (OAuth 1.0 - for user profile/diary access)

📖 Step-by-step guide: Getting Started with FatSecret API

Claude Desktop (Extension)

Download and open fatsecret-mcp.mcpb with Claude Desktop. You'll be prompted to enter your FatSecret credentials — secrets are stored securely in the OS keychain.

[!WARNING] If one-click install fails or the extension doesn't start, it may be a Claude Desktop bug (mcpb#281). Workaround: download fatsecret-mcp.zip, extract it, and use Settings → Extensions → Advanced settings → Install Unpacked Extension. Or use the npx config above.

See Building Desktop Extensions with MCPB for more details.

Claude Desktop (Manual)

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

Claude Code (CLI)

bash
claude mcp add fatsecret -- npx -y fatsecret-mcp

Or with env vars:

bash
claude mcp add fatsecret \  -e FATSECRET_CLIENT_ID=your_client_id \  -e FATSECRET_CLIENT_SECRET=your_client_secret \  -e FATSECRET_CONSUMER_SECRET=your_consumer_secret \  -- npx -y fatsecret-mcp

Verify with claude mcp list.

Cursor

  • Settings UI — Settings → MCP → + Add new MCP server, then fill in the command, args, and env
  • Project config — add JSON to .cursor/mcp.json in your project root
  • Global config — add JSON to ~/.cursor/mcp.json

🛠️ Available Tools

ToolDescription
🔐 Setup & Auth
check_auth_statusCheck if credentials and profile auth are configured. Call this first.
setup_credentialsSave FatSecret API credentials to persistent config
start_authStart OAuth 1.0 authorization — returns URL for user to visit
complete_authComplete OAuth with verifier PIN from authorization page
🔍 Food Search (public)
search_foodsSearch the food database
get_foodGet detailed nutrition info for a food
find_food_by_barcodeFind food by GTIN-13 barcode
autocomplete_foodsGet search autocomplete suggestions
🍳 Recipes (public)
search_recipesSearch recipes with filters
get_recipeGet recipe details with ingredients and directions
📚 Reference (public)
get_food_categoriesGet food categories
get_food_sub_categoriesGet food sub categories
get_brandsGet food brands
get_recipe_typesGet recipe types
📝 Food Diary (profile auth)
get_food_entriesGet food diary entries for a date
get_food_entries_monthGet monthly nutrition summary (calories & macros per day)
create_food_entryAdd a food diary entry
edit_food_entryEdit a food diary entry
delete_food_entryDelete a food diary entry
copy_food_entriesCopy entries from one date to another
copy_saved_meal_entriesCopy a saved meal to a date
⭐ Favorites (profile auth)
get_favorite_foodsGet favorite foods
delete_favorite_foodRemove food from favorites
get_most_eaten_foodsGet most eaten foods
get_recently_eaten_foodsGet recently eaten foods
get_favorite_recipesGet favorite recipes
add_favorite_recipeAdd recipe to favorites
delete_favorite_recipeRemove recipe from favorites
🍽️ Saved Meals (profile auth)
get_saved_mealsGet saved meals
create_saved_mealCreate a saved meal
edit_saved_mealEdit a saved meal
delete_saved_mealDelete a saved meal
get_saved_meal_itemsGet items in a saved meal
add_saved_meal_itemAdd food to a saved meal
edit_saved_meal_itemEdit saved meal item
delete_saved_meal_itemRemove item from saved meal
⚖️ Weight (profile auth)
update_weightRecord weight for a date
get_weight_monthGet weight history for a month
🏃‍♂️ Exercise (profile auth)
get_exercisesGet exercise types
edit_exercise_entriesShift exercise time between activities
get_exercise_entries_monthGet exercise data for a month
save_exercise_templateSave exercise template for weekdays
👤 Profile (profile auth)
get_profileGet user profile info
create_foodCreate a custom food (Premier)

API reference: FatSecret Postman Collection

🧪 Test Connection

bash
npx fatsecret-mcp

Or with env vars:

bash
FATSECRET_CLIENT_ID='...' FATSECRET_CLIENT_SECRET='...' FATSECRET_CONSUMER_SECRET='...' npx fatsecret-mcp

📋 Requirements

  • Node.js 18+
  • FatSecret Platform API account (platform.fatsecret.com)
  • MCP-compatible client (Claude Desktop, Cursor, etc.)

🔧 Development

  1. Clone the repository
  2. npm install
  3. Copy .env.example to .env and fill in your credentials
  4. npm run dev to run in development mode

Debugging with MCP Inspector:

bash
FATSECRET_CLIENT_ID=X FATSECRET_CLIENT_SECRET=X FATSECRET_CONSUMER_SECRET=X npx -y @modelcontextprotocol/inspector npx <local-path>/fatsecret-mcp

📄 License

MIT License - see LICENSE file for details.

来源:README.md,提交 0de2bef

工具

44

search_foods

Search the FatSecret food database. Returns food names, descriptions, and basic nutrition info. On the Basic plan only search_expression, page_number and max_results (max 50) are used.

输入参数regionlanguagefood_typemax_resultspage_numbersearch_expression必填include_food_imagesflag_default_servinginclude_sub_categoriesinclude_food_attributes

get_food

Get detailed nutritional information for a specific food by ID. Returns servings, calories, macros, and micronutrients.

输入参数regionfood_id必填languagepage_numberinclude_food_imagesflag_default_servinginclude_sub_categoriesinclude_food_attributes

find_food_by_barcode

Find food by barcode (GTIN-13). UPC-A, EAN-13 and EAN-8 supported. Premier exclusive.

输入参数regionbarcode必填languageinclude_food_imagesflag_default_servinginclude_sub_categoriesinclude_food_attributes

autocomplete_foods

Get autocomplete suggestions for a partial food search expression. Premier exclusive.

输入参数regionlanguageexpression必填max_results

search_recipes

Search recipes with optional filters for calories, macros, prep time, and recipe types.

输入参数sort_bycalories.tomax_resultspage_numberprep_time.torecipe_typescalories.fromprep_time.frommust_have_imagesfat_percentage.tosearch_expressioncarb_percentage.to另有 5 个

get_recipe

Get detailed recipe information by ID including ingredients, directions, and nutrition.

输入参数recipe_id必填max_resultspage_number

get_food_categories

Get the full list of food categories. Premier exclusive.

输入参数regionlanguage

get_food_sub_categories

Get food sub categories for a given food category. Premier exclusive.

输入参数regionlanguagefood_category_id必填

get_brands

Get the list of food brands, optionally filtered by starting letter and type. Premier exclusive.

输入参数regionlanguagebrand_typestarts_with

get_recipe_types

Get the full list of supported recipe type names.

无需输入参数。

get_food_entries

Get food diary entries for a date or a specific entry by ID. Requires profile auth (check_auth_status first).

输入参数datefood_entry_id

get_food_entries_month

Get daily nutrition summary for a month. Returns calories and macros per day. Requires profile auth (check_auth_status first).

输入参数date

create_food_entry

Add a food diary entry. Requires food_id, serving_id, and meal type. Requires profile auth (check_auth_status first).

输入参数datemeal必填food_id必填serving_id必填food_entry_name必填number_of_units必填

edit_food_entry

Edit an existing food diary entry. Cannot change the date. Requires profile auth (check_auth_status first).

输入参数mealserving_idfood_entry_id必填food_entry_namenumber_of_units

delete_food_entry

Delete a food diary entry by ID. Requires profile auth (check_auth_status first).

输入参数food_entry_id必填

copy_food_entries

Copy food entries from one date to another, optionally filtered by meal. Requires profile auth (check_auth_status first).

输入参数mealto_date必填from_date必填

copy_saved_meal_entries

Copy entries from a saved meal to a meal on a specific date. Requires profile auth (check_auth_status first).

输入参数datemeal必填saved_meal_id必填

get_favorite_foods

Get the user's favorite foods. Requires profile auth (check_auth_status first).

无需输入参数。

delete_favorite_food

Remove a food from the user's favorites. Requires profile auth (check_auth_status first).

输入参数food_id必填serving_idnumber_of_units

get_most_eaten_foods

Get the user's most eaten foods, optionally filtered by meal. Requires profile auth (check_auth_status first).

输入参数meal

get_recently_eaten_foods

Get the user's recently eaten foods, optionally filtered by meal. Requires profile auth (check_auth_status first).

输入参数meal

get_favorite_recipes

Get the user's favorite recipes. Requires profile auth (check_auth_status first).

无需输入参数。

add_favorite_recipe

Add a recipe to the user's favorites. Requires profile auth (check_auth_status first).

输入参数recipe_id必填

delete_favorite_recipe

Remove a recipe from the user's favorites. Requires profile auth (check_auth_status first).

输入参数recipe_id必填

get_saved_meals

Get the user's saved meals, optionally filtered by meal type. Requires profile auth (check_auth_status first).

输入参数meal

create_saved_meal

Create a new saved meal. Requires profile auth (check_auth_status first).

输入参数mealssaved_meal_name必填saved_meal_description

edit_saved_meal

Edit a saved meal name, description, or associated meals. Requires profile auth (check_auth_status first).

输入参数mealssaved_meal_id必填saved_meal_namesaved_meal_description

delete_saved_meal

Delete a saved meal. Requires profile auth (check_auth_status first).

输入参数saved_meal_id必填

get_saved_meal_items

Get all food items in a saved meal. Requires profile auth (check_auth_status first).

输入参数saved_meal_id必填

add_saved_meal_item

Add a food item to a saved meal. Requires profile auth (check_auth_status first).

输入参数food_id必填serving_id必填saved_meal_id必填number_of_units必填saved_meal_item_name必填

edit_saved_meal_item

Edit a food item in a saved meal (name or units). Cannot change serving_id. Requires profile auth (check_auth_status first).

输入参数number_of_unitssaved_meal_item_id必填saved_meal_item_name

delete_saved_meal_item

Remove a food item from a saved meal. Requires profile auth (check_auth_status first).

输入参数saved_meal_item_id必填

update_weight

Record the user's weight for a date. First weigh-in requires goal_weight_kg and current_height_cm. Requires profile auth (check_auth_status first).

输入参数datecommentheight_typeweight_typegoal_weight_kgcurrent_height_cmcurrent_weight_kg必填

get_weight_month

Get the user's weight entries for a month. Requires profile auth (check_auth_status first).

输入参数date

get_exercises

Get the full list of supported exercise types and their IDs. Requires profile auth (check_auth_status first).

无需输入参数。

edit_exercise_entries

Shift exercise time between activities for a date. Moves minutes from one exercise to another. Requires profile auth (check_auth_status first).

输入参数datekcalminutes必填shift_to_id必填shift_from_id必填shift_to_nameshift_from_name

get_exercise_entries_month

Get daily calories expended from exercise for a month. Requires profile auth (check_auth_status first).

输入参数date

save_exercise_template

Save the current day's exercise entries as a template for specified days of the week. Requires profile auth (check_auth_status first).

输入参数datedays必填

get_profile

Get profile status information for the authenticated user. Requires profile auth (check_auth_status first).

无需输入参数。

create_food

Create a custom food with nutrition info. Premier exclusive. Requires profile auth (check_auth_status first).

输入参数fat必填ironfibersugarsodiumcalciumprotein必填calories必填food_name必填potassiumtrans_fatvitamin_a另有 13 个

check_auth_status

Check if API credentials and profile authentication are configured. Call this first to understand what setup is needed.

无需输入参数。

setup_credentials

Configure FatSecret API credentials. Get them at https://platform.fatsecret.com/ → My Account → API Keys. Saves to persistent config file.

输入参数client_id必填client_secret必填consumer_secret必填

start_auth

Start the OAuth 1.0 authorization flow for profile access. Returns an authorization URL the user must visit. Requires API credentials (setup_credentials first).

无需输入参数。

complete_auth

Complete the OAuth 1.0 flow with the verifier code from the authorization page.

输入参数verifier必填

版本历史

2
  1. v0.0.10最新Nov 1, 2026
  2. v0.0.8Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分