FatSecret MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FatSecret MCP Server Search grilled salmon and show me its calories and protein"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π₯ FatSecret MCP Server
A Model Context Protocol (MCP) server for the FatSecret Platform API. Connect any MCP-compatible LLM (Claude, GPT-4, Cursor, Continue, etc.) directly to FatSecret's nutrition database and food-logging features.
Features
Tool | Description | Auth |
| Search the FatSecret food database by name | OAuth 2.0 |
| Get full nutrition info for a specific food (all servings + micros) | OAuth 2.0 |
| Search recipes with calorie/macro filters | OAuth 2.0 |
| Read diary entries for any date | OAuth 1.0 |
| Log a food to the diary | OAuth 1.0 |
| Daily macro/calorie totals aggregated from diary | OAuth 1.0 |
| Per-day nutrition stats for an entire month | OAuth 1.0 |
Note: Tools marked OAuth 1.0 require additional user-level tokens (see Obtaining User Tokens). The three OAuth 2.0 tools work with just your app credentials.
Related MCP server: fatsecret-mcp-server
Quick Start
1. Get API Credentials
Sign up at platform.fatsecret.com
Create an application to receive your Client ID and Client Secret
2. Install & Build
# Clone the repo
git clone https://github.com/YOUR_USERNAME/fatsecret-mcp.git
cd fatsecret-mcp
# Install dependencies
npm install
# Build TypeScript
npm run build3. Configure Credentials
cp .env.example .env
# Edit .env and fill in your credentials4. Test It
# Quick sanity check β search for "apple"
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_foods","arguments":{"query":"apple"}}}' \
| FATSECRET_CLIENT_ID=xxx FATSECRET_CLIENT_SECRET=yyy node dist/index.jsClaude Desktop Configuration
Add this to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"fatsecret": {
"command": "node",
"args": ["/absolute/path/to/fatsecret-mcp/dist/index.js"],
"env": {
"FATSECRET_CLIENT_ID": "your_client_id",
"FATSECRET_CLIENT_SECRET": "your_client_secret",
"FATSECRET_ACCESS_TOKEN": "your_access_token",
"FATSECRET_ACCESS_TOKEN_SECRET": "your_access_token_secret"
}
}
}
}Or, if you prefer using a .env file and npx:
{
"mcpServers": {
"fatsecret": {
"command": "npx",
"args": ["fatsecret-mcp"],
"env": {
"FATSECRET_CLIENT_ID": "your_client_id",
"FATSECRET_CLIENT_SECRET": "your_client_secret"
}
}
}
}After editing the config, restart Claude Desktop. You should see FatSecret tools available in Claude's tool panel.
Tool Reference
search_foods
Search the FatSecret food database.
Parameters:
Parameter | Type | Required | Default | Description |
| string | β | β | Search term (e.g. |
| number |
| Results per page (1β50) | |
| number |
| Zero-based page index | |
|
|
| Filter by food type | |
| string | β | ISO 3166-1 alpha-2 code (e.g. |
Example prompt: "Search for grilled salmon and show me the calories"
get_food
Get complete nutrition data for a food item.
Parameters:
Parameter | Type | Required | Description |
| string | β | FatSecret food ID (from |
| boolean | Highlight default serving (default |
Example prompt: "Get full nutrition info for food ID 35718"
search_recipes
Search FatSecret's recipe collection.
Parameters:
Parameter | Type | Required | Description |
| string | Search term (e.g. | |
| number | Results per page (1β50, default | |
| number | Zero-based page index | |
| number | Minimum calories per serving | |
| number | Maximum calories per serving | |
| string |
| |
| boolean | Only return recipes with images |
Example prompt: "Find high-protein recipes under 400 calories"
get_food_entries
Read food diary entries. Requires OAuth 1.0 tokens.
Parameters:
Parameter | Type | Required | Description |
| string |
| |
| string | Retrieve a specific entry |
Example prompt: "What did I eat for lunch today?"
add_food_entry
Log a food to the diary. Requires OAuth 1.0 tokens.
Parameters:
Parameter | Type | Required | Description |
| string | β | FatSecret food ID |
| string | β | Serving size ID (from |
| number | β | Number of servings consumed |
|
| β | Meal slot |
| string |
| |
| string | Custom display name |
Example prompt: "Log 1.5 servings of chicken breast (food_id 4888, serving_id 15183) as dinner today"
get_daily_nutrition
Aggregate calorie and macro totals for a day. Requires OAuth 1.0 tokens.
Parameters:
Parameter | Type | Required | Description |
| string |
|
Example prompt: "How many calories and grams of protein did I eat yesterday?"
get_month_of_statistics
Per-day nutrition data for an entire month. Requires OAuth 1.0 tokens.
Parameters:
Parameter | Type | Required | Description |
| string | Any date in the target month (defaults to current month) |
Example prompt: "Show me my nutrition stats for March 2026"
Obtaining User Tokens (Diary Features)
Diary tools require a three-legged OAuth 1.0 flow to obtain a user-specific access token and secret. Here's the full process:
Step 1 β Get a Request Token
# Replace with your actual credentials
curl -X POST "https://www.fatsecret.com/oauth/request_token" \
-H "Authorization: OAuth oauth_callback=\"oob\", \
oauth_consumer_key=\"YOUR_CLIENT_ID\", \
oauth_nonce=\"$(openssl rand -hex 16)\", \
oauth_signature_method=\"HMAC-SHA1\", \
oauth_timestamp=\"$(date +%s)\", \
oauth_version=\"1.0\", \
oauth_signature=\"<computed_signature>\""Tip: Use a library like oauth-1.0a or the FatSecret API Demo to handle signature generation.
Step 2 β Authorize in Browser
Direct the user to:
https://www.fatsecret.com/oauth/authorize?oauth_token=<request_token>The user logs in and approves. FatSecret shows a PIN/verifier code.
Step 3 β Exchange for Access Token
curl -X POST "https://www.fatsecret.com/oauth/access_token" \
-H "Authorization: OAuth oauth_consumer_key=\"YOUR_CLIENT_ID\", \
oauth_token=\"<request_token>\", \
oauth_verifier=\"<pin_code>\", \
..."The response contains oauth_token (access token) and oauth_token_secret. Store these as FATSECRET_ACCESS_TOKEN and FATSECRET_ACCESS_TOKEN_SECRET.
For a one-person setup (logging your own meals), you can use the FatSecret API Demo tool to complete the OAuth 1.0 flow and copy the resulting tokens directly.
Example Conversation
Once configured in Claude Desktop, you can have natural conversations like:
You: "I just had a bowl of oatmeal with milk for breakfast. Can you log it?"
Claude: (calls
search_foodsβget_foodβadd_food_entryautomatically) "Done! I logged 1 cup of cooked oatmeal (147 kcal) and 1 cup of whole milk (149 kcal) as breakfast. That's 296 kcal total with 13g protein."
You: "How are my macros looking today?"
Claude: (calls
get_daily_nutrition) "You've had 1,240 kcal so far: 87g protein (28%), 142g carbs (46%), 38g fat (27%)."
Development
# Run in development mode (no build step)
npm run dev
# Type-check only
npm run typecheck
# Build for production
npm run buildProject Structure
src/
βββ index.ts # MCP server entry point, tool dispatch
βββ fatsecret.ts # API client (OAuth 2.0 + OAuth 1.0 HMAC-SHA1)
βββ tools/
βββ food.ts # search_foods, get_food, search_recipes
βββ diary.ts # get_food_entries, add_food_entry
βββ nutrition.ts # get_daily_nutrition, get_month_of_statisticsAPI Limitations & Known Constraints
Limitation | Detail |
Diary requires OAuth 1.0 | Diary and monthly stats endpoints do not support OAuth 2.0. You must complete the 3-legged OAuth 1.0 flow and store personal tokens. |
No rate limit docs | FatSecret does not publish rate limits publicly. The free tier is generally limited to ~2 req/sec. Premier accounts have higher limits. |
JSON inconsistency | Single-result responses return an object; multi-result responses return an array. The client handles this automatically via |
Premier features | Barcode scanning, image recognition (Snap It), and NLP food logging require a Premier API subscription. |
Region availability | Some foods/brands are region-specific. Use the |
Date integers | FatSecret dates are stored as "days since 1970-01-01". The client converts to/from |
License
MIT β see LICENSE for details.
Contributing
Issues and pull requests are welcome! Please open an issue first for major changes.
Available Tools
12 toolsadd_food_entryA
Add a food entry to the user's food diary. Use search_foods to find food_id and get_food to find the correct serving_id. Requires OAuth 1.0 user credentials AND Diary Read/Write API access (contact FatSecret support to enable).
Inputs: meal (required), food_id (required), serving_id (required), number_of_units (required), +2 more.
delete_food_entryA
Delete a food diary entry by its ID. Use get_food_entries to find the food_entry_id first. Requires Diary Read/Write API access.
Inputs: food_entry_id (required).
delete_weight_entryA
Delete a body weight entry for a specific date. Requires Diary Read/Write API access.
Inputs: date.
edit_food_entryA
Edit an existing food diary entry (change serving size, meal, or number of units). Use get_food_entries to find the food_entry_id. Requires Diary Read/Write API access.
Inputs: serving_id (required), food_entry_id (required), number_of_units (required), meal, +1 more.
get_daily_nutritionA
Get a summary of total daily nutrition (calories, protein, carbohydrates, fat, and more) for a specific date by aggregating all diary entries. Requires OAuth 1.0 user credentials.
Inputs: date.
get_foodA
Get detailed nutrition information for a specific food by its FatSecret food ID. Returns all serving sizes and complete macronutrient + micronutrient data (calories, protein, carbs, fat, fiber, sodium, vitamins, etc.).
Inputs: food_id (required), flag_default_serving.
get_food_entriesA
Get food diary entries for a specific date (or today by default). Returns all logged meals with nutrition totals. Requires OAuth 1.0 user credentials (FATSECRET_ACCESS_TOKEN + FATSECRET_ACCESS_TOKEN_SECRET).
Inputs: date, food_entry_id.
get_month_of_statisticsA
Get daily nutrition totals (calories, protein, carbs, fat) for every day in a given month that has diary entries. Useful for tracking trends and weekly/monthly analysis. Requires OAuth 1.0 user credentials.
Inputs: date.
get_weight_entriesA
Get body weight entries for a specific date. Returns weight in kg and BMI if available. Requires OAuth 1.0 user credentials.
Inputs: date.
search_foodsA
Search the FatSecret food database by name or keyword. Returns a paginated list of foods with basic nutrition info (calories, protein, carbs, fat) per serving. Use this to find food IDs for use with get_food.
Inputs: query (required), region, food_type, max_results, +1 more.
search_recipesA
Search FatSecret's recipe database. Returns recipes with nutrition info, ingredients, and images. Supports filtering by calorie range, prep time, and sorting options.
Inputs: query, sort_by, max_results, page_number, +3 more.
update_weight_entryB
Log or update a body weight entry for a specific date. Requires Diary Read/Write API access.
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
Scored across 12 tools
Tools are mostly clearly distinct by resource and action: food search vs. food detail, recipe search, diary entry CRUD, weight entry CRUD, and nutrition summaries. There is minor potential overlap between get_food_entries (which returns nutrition totals) and get_daily_nutrition, as well as between daily and monthly nutrition views, but descriptions clarify the intended use.
Tool names consistently follow a snake_case verb_noun pattern such as search_foods, get_food, add_food_entry, update_weight_entry, and get_daily_nutrition. The few plural/singular variations correspond naturally to the underlying resource names.
The 12 tools are well-scoped for a FatSecret integration covering food lookup, recipe search, diary management, weight tracking, and nutrition summaries. Each tool has a clear role without excessive surface area.
The server provides strong lifecycle coverage for diary entries (get/add/edit/delete) and weight entries (get/update/delete), plus food search/detail, recipe search, and nutrition reporting. A dedicated get_recipe tool or richer recipe-detail operation is missing, but the core workflows are well covered.
Maintenance
Related MCP Connectors
Log meals and read calories and macros from any AI assistant. Pairs with the whatevr iPhone app.
Food nutrition lookup via natural language, barcode, and image. Database of 1,000,000+ foods.
Recipe search, ingredient matching, nutrition filters and a private cookbook for any AI agent.
Unofficial Edamam MCP β wraps three Edamam APIs in one pack: - Nutrition Analysis APIβ¦
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for managing food diary, nutrition tracking, meal planning, and weight logging via the FatSecret Platform API.15MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching and retrieving nutrition data, recipes, and managing food diary entries through the FatSecret API.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for FatSecret that enables searching foods/recipes and managing personal food diary, weight, and exercise logs via natural language.MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to search foods and recipes, track diet, manage weight, and log exercise using the FatSecret Platform API.44113 npm12MIT