FatSecret

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.

FatSecret MCP Server

[!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:

{
  "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:

{
  "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.

See Building Desktop Extensions with MCPB for more details.

Claude Desktop (Manual)

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

Claude Code (CLI)

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

Or with env vars:

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

npx fatsecret-mcp

Or with env vars:

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:

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.

Related Servers