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 分