Skip to main content
Glama
fatsecret-mcp-server

fatsecret-mcp-server

by Yurzs

FatSecret MCP Server

MCP server for managing your food diary, nutrition tracking, meal planning, and weight logging via the FatSecret Platform API.

Tools Available

Tool

Description

fatsecret_search_food

Search food database by name

fatsecret_get_food

Get full nutrition details for a food

fatsecret_create_food_entry

Log food to diary

fatsecret_edit_food_entry

Edit existing diary entry

fatsecret_delete_food_entry

Delete diary entry

fatsecret_get_food_entries

Get all entries for a date

fatsecret_get_food_entries_month

Monthly diary summary

fatsecret_create_saved_meal

Create reusable meal template

fatsecret_add_food_to_saved_meal

Add food to a saved meal

fatsecret_get_saved_meals

List saved meal templates

fatsecret_copy_saved_meal_to_diary

Paste saved meal into diary

fatsecret_update_weight

Log weight for a date

fatsecret_get_weights_month

Monthly weight history

fatsecret_get_recently_eaten

Recently logged foods

fatsecret_copy_day

Copy all entries between dates

Related MCP server: io.github.rwestergren/cronometer-api-mcp

Setup

1. Register for FatSecret API

  1. Go to https://platform.fatsecret.com/register

  2. Create a developer account

  3. Note your IP address and add it to the IP whitelist on the developer dashboard (required for OAuth 2.0 — can take up to 24h to propagate)

2. Get API Credentials

FatSecret uses separate credentials for OAuth 1.0a and OAuth 2.0:

On your developer dashboard, you'll find two credential sections:

Section

Key

Secret

Used for

REST API OAuth 1.0 Credentials

Consumer Key

Consumer Secret

Food diary, weight, saved meals (user-level access)

OAuth 2.0 Credentials

Client ID

Client Secret

Food search, food details (app-level access)

The Consumer Key and Client ID are the same value. The secrets are different — this is a common source of confusion.

3. Get User OAuth Tokens (3-legged OAuth 1.0a)

For diary and weight tools, you need user-level access tokens. Run the included setup script:

FATSECRET_CLIENT_ID=your_consumer_key \
FATSECRET_CLIENT_SECRET=your_consumer_secret \
node scripts/oauth-setup.js

This will:

  1. Start a local web server at http://localhost:9876

  2. Open your browser to authorize with FatSecret

  3. Complete the OAuth 1.0a 3-legged flow

  4. Display your FATSECRET_ACCESS_TOKEN and FATSECRET_ACCESS_TOKEN_SECRET

Note: The OAuth flow uses authentication.fatsecret.com (not www.fatsecret.com). You must log in with a FatSecret user account (the same one you use in the FatSecret mobile app), not your developer account.

4. Environment Variables

# Required — same value, shown as "Consumer Key" / "Client ID"
export FATSECRET_CLIENT_ID="your_consumer_key"

# OAuth 1.0a Consumer Secret (from "REST API OAuth 1.0 Credentials")
# Used for: diary, weight, saved meals, recently eaten
export FATSECRET_CONSUMER_SECRET="your_consumer_secret"

# OAuth 2.0 Client Secret (from "OAuth 2.0 Credentials")
# Used for: food search, food details
export FATSECRET_OAUTH2_CLIENT_SECRET="your_oauth2_client_secret"

# User tokens from the 3-legged OAuth flow (step 3)
export FATSECRET_ACCESS_TOKEN="your_access_token"
export FATSECRET_ACCESS_TOKEN_SECRET="your_access_token_secret"

Legacy fallback: If you set FATSECRET_CLIENT_SECRET instead of the two separate secrets, it will be used for both OAuth flows. This only works if your Consumer Secret and Client Secret happen to be the same value (they aren't on most accounts).

5. Build & Run

npm install
npm run build
npm start

6. Configure in Claude Desktop

Add to your Claude Desktop MCP config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "fatsecret": {
      "command": "node",
      "args": ["/path/to/fatsecret-mcp-server/dist/index.js"],
      "env": {
        "FATSECRET_CLIENT_ID": "your_consumer_key",
        "FATSECRET_CONSUMER_SECRET": "your_oauth1_consumer_secret",
        "FATSECRET_OAUTH2_CLIENT_SECRET": "your_oauth2_client_secret",
        "FATSECRET_ACCESS_TOKEN": "your_access_token",
        "FATSECRET_ACCESS_TOKEN_SECRET": "your_access_token_secret"
      }
    }
  }
}

Option B: Directly from GitHub (no local clone)

{
  "mcpServers": {
    "fatsecret": {
      "command": "npx",
      "args": ["-y", "github:Yurzs/fatsecret-mcp-server"],
      "env": {
        "FATSECRET_CLIENT_ID": "your_consumer_key",
        "FATSECRET_CONSUMER_SECRET": "your_oauth1_consumer_secret",
        "FATSECRET_OAUTH2_CLIENT_SECRET": "your_oauth2_client_secret",
        "FATSECRET_ACCESS_TOKEN": "your_access_token",
        "FATSECRET_ACCESS_TOKEN_SECRET": "your_access_token_secret"
      }
    }
  }
}

This downloads and runs the server directly from the repo — no git clone, npm install, or npm run build needed. npx caches it locally after the first run.

Note: If you've used this before and need to pull updates, clear the npx cache first:

rm -rf ~/.npm/_npx

Getting user tokens without cloning

You can run the OAuth setup script directly too:

npx -y github:Yurzs/fatsecret-mcp-server/scripts/oauth-setup.js

Or with a one-liner using curl:

curl -sL https://raw.githubusercontent.com/Yurzs/fatsecret-mcp-server/master/scripts/oauth-setup.js | \
  FATSECRET_CLIENT_ID=your_key FATSECRET_CLIENT_SECRET=your_consumer_secret node -

This starts a local server at http://localhost:9876, opens your browser, and walks you through the FatSecret authorization. The tokens are printed to the terminal when complete.

Typical Workflow

  1. Search for a food: fatsecret_search_food("chicken breast")

  2. Get details to find serving_id: fatsecret_get_food(food_id)

  3. Log it: fatsecret_create_food_entry(food_id, "Chicken Breast", serving_id, 2.5, "lunch")

  4. Review day: fatsecret_get_food_entries("2026-05-16")

  5. Track weight: fatsecret_update_weight(77.5, "2026-05-16")

Troubleshooting

"Invalid IP address detected" — Add your public IP to the whitelist at https://platform.fatsecret.com. Propagation can take minutes to hours.

"Invalid signature" on OAuth 1.0a requests — You're likely using the OAuth 2.0 Client Secret instead of the OAuth 1.0a Consumer Secret. These are different values on most accounts. Check the "REST API OAuth 1.0 Credentials" section on your dashboard.

OAuth setup can't log in — The authorization page at authentication.fatsecret.com requires a FatSecret user account (the mobile app account), not your developer account. If you signed up via Apple/Google, do a password reset to set a native password.

API Tier

The free Basic tier (5,000 calls/day) is sufficient for personal use. Apply for Premier Free if you want barcode scanning and autocomplete.

Available Tools

15 tools
fatsecret_add_food_to_saved_mealAdd Food to Saved MealA

Add a food item to an existing saved meal template.

Args:

  • saved_meal_id: ID of the saved meal

  • food_id: FatSecret food ID to add

  • food_entry_name: Display name

  • serving_id: Serving size ID

  • number_of_units: Number of servings

Returns: Confirmation with nutrition details.

Inputs: saved_meal_id (required), food_id (required), food_entry_name (required), serving_id (required), +1 more.

fatsecret_copy_dayCopy Food Entries Between DatesA

Copy all food entries from one date to another. Useful for repeating a day's meals.

Args:

  • from_date: Source date YYYY-MM-DD

  • to_date: Target date YYYY-MM-DD

Returns: Confirmation.

Inputs: from_date (required), to_date (required).

fatsecret_copy_saved_meal_to_diaryCopy Saved Meal to DiaryA

Copy all foods from a saved meal template into the food diary for a specific date and meal.

Args:

  • saved_meal_id: ID of the saved meal to copy

  • meal: Target meal type

  • date: Target date YYYY-MM-DD (default: today)

Returns: Confirmation that entries were created.

Inputs: saved_meal_id (required), meal (required), date.

fatsecret_create_food_entryLog Food to DiaryA

Create a food diary entry for the user. Logs a specific food + serving to a meal on a given date.

You need food_id and serving_id from fatsecret_search_food / fatsecret_get_food.

Args:

  • food_id: FatSecret food ID

  • food_entry_name: Display name (e.g., "Chicken Breast")

  • serving_id: The serving size ID

  • number_of_units: How many of that serving (e.g., 2.5 for "2.5 cups")

  • meal: One of "breakfast", "lunch", "dinner", "other"

  • date: Date as YYYY-MM-DD string (default: today)

Returns: Created food entry with nutrition totals.

Inputs: food_id (required), food_entry_name (required), serving_id (required), number_of_units (required), +2 more.

fatsecret_create_saved_mealCreate Saved Meal TemplateA

Create a reusable meal template (e.g., "Post-Workout Chicken & Rice"). After creating, add foods to it with fatsecret_add_food_to_saved_meal.

Args:

  • saved_meal_name: Name for the template

  • saved_meal_description: Optional description

  • meal_type: Default meal type when copied to diary

Returns: Created saved meal with its ID.

Inputs: saved_meal_name (required), saved_meal_description, meal_type.

fatsecret_delete_food_entryDelete Food Diary EntryA
DestructiveIdempotent

Delete a food diary entry by its ID.

Args:

  • food_entry_id: The entry ID to delete

Returns: Confirmation of deletion.

Inputs: food_entry_id (required).

fatsecret_edit_food_entryEdit Food Diary EntryA
Idempotent

Edit an existing food diary entry. Can change serving size, number of units, or meal type.

Args:

  • food_entry_id: The entry ID to edit (from get_food_entries)

  • food_entry_name: Updated display name (optional)

  • serving_id: New serving ID (optional)

  • number_of_units: New number of servings (optional)

  • meal: New meal type (optional)

Returns: Updated entry with new nutrition values.

Inputs: food_entry_id (required), food_entry_name, serving_id, number_of_units, +1 more.

fatsecret_get_foodGet Food Nutrition DetailsA
Read-onlyIdempotent

Get detailed nutrition information for a specific food by its food_id. Returns all available servings with full macro and micronutrient breakdown.

Use this after fatsecret_search_food to get the serving_id and nutrition data needed for logging.

Args:

  • food_id: The FatSecret food ID (from search results)

Returns: Food name, servings list with serving_id, serving description, calories, protein, carbs, fat, and available micronutrients.

Inputs: food_id (required).

fatsecret_get_food_entriesGet Food Diary EntriesA
Read-onlyIdempotent

Get all food diary entries for a specific date. Shows what was logged for each meal with full nutrition breakdown.

Args:

  • date: Date as YYYY-MM-DD (default: today)

Returns: All food entries grouped by meal with calories, protein, carbs, fat per entry and daily totals.

Inputs: date.

fatsecret_get_food_entries_monthGet Monthly Food Diary SummaryA
Read-onlyIdempotent

Get daily calorie/macro totals for an entire month. Useful for tracking adherence and trends.

Args:

  • month: Month (1-12)

  • year: Year (e.g., 2026)

Returns: Daily totals for each logged day in the month.

Inputs: month (required), year (required).

fatsecret_get_recently_eatenGet Recently Eaten FoodsA
Read-onlyIdempotent

Get the user's recently eaten foods for quick re-logging. Returns food IDs and serving info ready to use with fatsecret_create_food_entry.

Returns: List of recently logged foods with IDs and serving details.

Inputs: no named parameters.

fatsecret_get_saved_mealsList Saved Meal TemplatesA
Read-onlyIdempotent

Get all saved meal templates for the user. Shows meal names, IDs, and food items within each.

Returns: List of saved meals with their IDs, names, and food contents.

Inputs: no named parameters.

fatsecret_get_weights_monthGet Monthly Weight HistoryA
Read-onlyIdempotent

Get weight entries for an entire month. Useful for tracking weight trends during bulk/cut phases.

Args:

  • month: Month (1-12)

  • year: Year (e.g., 2026)

Returns: All weight entries for the month with dates.

Inputs: month (required), year (required).

fatsecret_search_foodSearch FatSecret Food DatabaseA
Read-onlyIdempotent

Search the FatSecret food database by name. Returns food items with basic nutrition info per serving. Use this to find food_id and serving_id needed for logging diary entries.

Args:

  • query: Food name to search (e.g., "chicken breast", "jasmine rice")

  • page: Page number for pagination (default: 0)

  • max_results: Results per page, max 50 (default: 20)

Returns: List of foods with id, name, description (brief nutrition summary).

Inputs: query (required), page, max_results.

fatsecret_update_weightLog WeightA
Idempotent

Log a weight measurement for a specific date.

Args:

  • weight_kg: Weight in kilograms

  • date: Date YYYY-MM-DD (default: today)

  • comment: Optional note

Returns: Confirmation of logged weight.

Inputs: weight_kg (required), date, comment.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 15 tools

    Disambiguation5/5

    Each tool targets a distinct action or resource (food entries, saved meals, weight, search, monthly views). There is no overlap; even the two copy tools copy different things (day vs saved meal to diary). High clarity.

    Naming Consistency5/5

    All tool names follow a consistent 'fatsecret_verb_noun' pattern in snake_case (e.g., fatsecret_create_food_entry, fatsecret_get_weights_month). No deviations or mixed conventions.

    Tool Count5/5

    15 tools cover the domain of nutrition tracking comprehensively without bloat. Each tool serves a clear purpose, and the count is appropriate for the scope (food diary, saved meals, weight, search).

    Completeness4/5

    The tool surface covers core CRUD for food entries and weight, saved meal templates, search, and monthly summaries. Minor gaps exist (e.g., no update/delete for saved meals), but the essential workflows are completable.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers