FatSecret MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
FatSecret MCP Server (Go)
This isnot 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.
56 tools, config in ~/.fatsecret-mcp/config.json.
Built on the official modelcontextprotocol/go-sdk.
โจ Features
๐ Authentication โ Interactive credential setup and OAuth authorization
๐จโ๐ฉโ๐ง Multi-user โ
X-MCP-Userheader over HTTP selects the household member; each authorizes separately, tokens stored per user in the config fileโ Draft โ confirm โ Stage any write with
prepare_call(validated + human-readable preview), execute withconfirm_draft. SetFATSECRET_REQUIRE_CONFIRM=1to block direct writes entirely๐ 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
Related MCP server: fatsecret-coach
๐ Why this server
Comparison as of November 2026. The official server is described in FatSecret's own docs.
This server | Official | Typical community servers | |
Tools | 56 | 4 | ~5โ15 |
Diary / weight / exercise writes | โ full | โ read-only | โ ๏ธ partial |
Recipes, NLP, image recognition | โ | โ | โ ๏ธ rarely |
Works on a free API key | โ (v6 โ v1 fallback) | โ Premier only | depends |
Self-hosted (binary / Docker) | โ | โ hosted seats | โ |
stdio + Streamable HTTP | โ | remote only | usually stdio only |
Draft โ confirm for writes | โ
(+ strict | โ | rarely |
Self-contained binary | โ ~14 MB, ~10 MB RAM, no runtime | โ hosted seats | โ ๏ธ usually needs a runtime |
Endpoints covered here that neither the official server nor โ to our
knowledge โ any community server exposes: create_food_feedback,
get_food_classification_levels, commit_exercise_day,
create_profile / get_profile_auth.
๐ Quick Start
Build the binary (Go 1.27+):
go build -o fatsecret-mcp ./cmd/fatsecret-mcpOr grab a ready binary / Docker image from Releases:
docker run -i --rm \
-e FATSECRET_CLIENT_ID=... \
-e FATSECRET_CLIENT_SECRET=... \
ghcr.io/kondratjev/fatsecret-mcp-go:latestAdd to your MCP client configuration:
{
"mcpServers": {
"fatsecret": {
"command": "/absolute/path/to/fatsecret-mcp"
}
}
}That's it! On first use, the AI will guide you through setup:
check_auth_statusโ detects missing credentials and tells you what to dosetup_credentialsโ you provide your API keys (saved to~/.fatsecret-mcp/config.json)start_authโcomplete_authโ authorize your FatSecret account for diary/weight tools
Alternatively, you can pass credentials as environment variables:
{
"mcpServers": {
"fatsecret": {
"command": "/absolute/path/to/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
Create a free account at platform.fatsecret.com
Navigate to My Account โ API Keys
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
๐ Premier Keys
Premier keys work out of the box. FatSecret grants OAuth 2.0 scopes per key, so the server asks for basic premier barcode nlp image-recognition localization feedback and, if FatSecret refuses any of them, keeps just the ones your key is entitled to (free keys end up with basic). Premier keys get Premier-only data such as branded foods and search_foods v6; free keys get search_foods v1. Barcode lookup needs the barcode scope; parse_food_text and recognize_food_image need the paid NLP and image recognition add-ons.
Claude Desktop (Manual)
~/Library/Application Support/Claude/claude_desktop_config.json โ same JSON as above.
Claude Code (CLI)
claude mcp add fatsecret -- /absolute/path/to/fatsecret-mcpOr 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 \
-- /absolute/path/to/fatsecret-mcpVerify with claude mcp list.
Cursor
Settings UI โ
Settings โ MCP โ + Add new MCP server, then fill in the command and envProject config โ add JSON to
.cursor/mcp.jsonin your project rootGlobal config โ add JSON to
~/.cursor/mcp.json
ChatGPT
Remote only โ paste your self-hosted URL (Settings โ Connectors โ Add):
https://<DOMAIN>/<MCP_SECRET>/mcpOpenCode
~/.config/opencode/opencode.json โ note the key is mcp, env is environment:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"fatsecret": {
"type": "local",
"command": ["/absolute/path/to/fatsecret-mcp"],
"environment": {
"FATSECRET_CLIENT_ID": "your_client_id",
"FATSECRET_CLIENT_SECRET": "your_client_secret",
"FATSECRET_CONSUMER_SECRET": "your_consumer_secret"
},
"enabled": true
}
}
}Or point at your self-hosted server instead of a local binary:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"fatsecret": {
"type": "remote",
"url": "https://<DOMAIN>/<MCP_SECRET>/mcp",
"enabled": true
}
}
}๐ ๏ธ Available Tools
Tool | Description |
๐ Setup & Auth | |
| Check if credentials and profile auth are configured. Call this first. |
| Save FatSecret API credentials to persistent config |
| Start OAuth 1.0 authorization โ returns URL for user to visit |
| Complete OAuth with verifier PIN from authorization page |
| Stage a write as a single-use draft (validated + preview, nothing written) |
| Execute a draft staged by |
๐ Food Search (public) | |
| Search the food database |
| Get detailed nutrition info for a food |
| Find food by GTIN-13 barcode |
| Get search autocomplete suggestions |
๐ค Recognition (paid add-ons) | |
| Match a free-text meal description to foods and servings (NLP) |
| Recognize foods in a meal photo (image recognition) |
| Report food/barcode data issues, get upload URLs (paid feedback add-on) |
๐ณ Recipes (public) | |
| Search recipes with filters |
| Get recipe details with ingredients and directions |
๐ Reference (public) | |
| Get food categories |
| Get food sub categories |
| Get food classification hierarchy (Premier) |
| Get food brands |
| Get recipe types |
๐ Food Diary (profile auth) | |
| Log a whole meal in one call (grams or servings) and get day totals |
| Get food diary entries for a date |
| Get monthly nutrition summary (calories & macros per day) |
| Add a food diary entry |
| Edit a food diary entry |
| Delete a food diary entry |
| Copy entries from one date to another |
| Copy a saved meal to a date |
โญ Favorites (profile auth) | |
| Get favorite foods |
| Add food to favorites |
| Remove food from favorites |
| Get most eaten foods |
| Get recently eaten foods |
| Get favorite recipes |
| Add recipe to favorites |
| Remove recipe from favorites |
๐ฝ๏ธ Saved Meals (profile auth) | |
| Get saved meals |
| Create a saved meal |
| Edit a saved meal |
| Delete a saved meal |
| Get items in a saved meal |
| Add food to a saved meal |
| Edit saved meal item |
| Remove item from saved meal |
โ๏ธ Weight (profile auth) | |
| Record weight for a date |
| Get weight history for a month |
๐โโ๏ธ Exercise (profile auth) | |
| Get exercise types |
| Get exercise entries for a date |
| Shift exercise time between activities |
| Get exercise data for a month |
| Save exercise template for weekdays |
| Commit template entries for a date |
๐ค Profile (profile auth) | |
| Get user profile info |
| Create a custom food (Premier) |
| Create a detached profile (returns tokens, no switch) |
| Get auth tokens for a detached profile |
API reference: FatSecret Postman Collection
๐งช Test Connection
List tools over stdio (keep stdin open โ the server exits on EOF):
{ printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'; sleep 4; } | ./fatsecret-mcpOr serve HTTP and probe it:
PORT=8000 ./fatsecret-mcp &
curl localhost:8000/healthz # โ okWith credentials:
FATSECRET_CLIENT_ID='...' FATSECRET_CLIENT_SECRET='...' FATSECRET_CONSUMER_SECRET='...' ./fatsecret-mcp๐ Requirements
Go 1.27+ to build (or just the binary โ no runtime needed)
FatSecret Platform API account (platform.fatsecret.com)
MCP-compatible client (Claude Desktop, Cursor, etc.)
๐ Self-Hosted Server (Docker)
Run the server on your own machine or VPS and connect remote clients (Claude.ai, ChatGPT connectors) over HTTPS.
Copy
.env.exampleto.envand fill it in:FATSECRET_CLIENT_ID,FATSECRET_CLIENT_SECRET,FATSECRET_CONSUMER_SECRETTZโ time zone for the default diary "today" (e.g.Europe/Moscow)DOMAINโ public host name (an IP works too, e.g.203-0-113-5.sslip.io)MCP_SECRETโ long random string:openssl rand -hex 24
docker compose up -d --build
Caddy issues HTTPS automatically and proxies only https://<DOMAIN>/<MCP_SECRET>/mcp to the server โ everything else gets 404. The secret path is the access control, since remote MCP connectors can't send auth headers. Guard the URL like a password. The image is a static Go binary serving stateless Streamable HTTP natively (no gateway, no per-session processes), so memory stays flat no matter how many prompts hit it.
Profile tokens persist in ./data, so setup_credentials and favorites survive restarts and rebuilds.
๐ Deploy to VPS
Single source of truth is this repo โ never edit code on the server. The server copy is a clean mirror (git reset --hard; .env and ./data are git-ignored and survive).
VPS_SSH=user@host VPS_DIR=/opt/fatsecret-mcp-go ./scripts/deploy.shThis pushes the current branch, then on the server pulls it, rebuilds and restarts (docker compose, or legacy docker-compose if v2 is missing). Export VPS_SSH/VPS_DIR in your shell rc to run bare ./scripts/deploy.sh. On a tiny VPS: docker builder prune -af if a build runs out of disk, add swap if the build OOMs.
๐ง Development
.
โโโ cmd/fatsecret-mcp/ # entrypoint: stdio vs stateless HTTP, tool registration
โโโ internal/
โ โโโ api/ # Server state, OAuth2 token cache, public/profile requests
โ โโโ auth/ # OAuth 2.0 (scopes, detection) + OAuth 1.0 (HMAC-SHA1)
โ โโโ config/ # ~/.fatsecret-mcp/config.json + env overrides
โ โโโ httpx/ # resilientFetch: timeouts + GET-only retries
โ โโโ platform/ # dates, servings, scope-14 detection, search trimming
โ โโโ tools/ # 56 tool definitions + handlers
โโโ Dockerfile
โโโ docker-compose.yml # mcp + Caddy (HTTPS, secret path)go build ./... # build
go vet ./... # lint
go test ./... # tests (OAuth1 RFC 5849 vector, dates, servings)Debugging with MCP Inspector:
FATSECRET_CLIENT_ID=X FATSECRET_CLIENT_SECRET=X FATSECRET_CONSUMER_SECRET=X npx -y @modelcontextprotocol/inspector /absolute/path/to/fatsecret-mcp๐ License
MIT License - see LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Log meals and read calories and macros from any AI assistant. Pairs with the whatevr iPhone app.
Log meals and read your nutrition diary from Claude or ChatGPT.
Your Calori account in any AI assistant: nutrition targets, food logging, meal orders and deliveries
Calorie, workout and body-weight log inside ChatGPT and Claude. Log meals by text, photo or voice.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI assistants to search foods and recipes, track diet, manage weight, and log exercise using the FatSecret Platform API.44113 npm12MIT
- AlicenseNot gradedqualityCmaintenanceEnables logging meals, tracking calories and macros, reviewing daily and range summaries, setting weight goals, searching foods and recipes, and getting meal suggestions from any Claude client, with optional multi-user household support. Includes a local food database for items missing from FatSecret and OAuth-based authentication to FatSecret profiles.MIT
- AlicenseAqualityBmaintenanceUnofficial, self-hosted MCP server that connects Claude or ChatGPT to your own FatSecret food diary. It drafts entries from a description, a plate photo or a nutrition label, saves them only after you confirm, and changes or removes entries the same way. It also reads a day or several weeks against your calorie and macro targets.256MIT
- FlicenseNot gradedqualityBmaintenanceEnables clients to read diary entries, nutrients, water, exercise, measurements, goals, recipes, and saved meals; search foods and serving sizes; estimate nutrition and edible weight from images; and make explicitly requested diary/account updates with idempotency and read-back safeguards. Supports local stdio connections and an OAuth-secured HTTPS gateway with separate read/write grants and local approval for sensitive operations.-