dietspremium-mcp

v0.0.21
dietspremium-mcp Checked 2 days ago Published 21 days ago

Official Model Context Protocol (MCP) Client Bridge for DietsPremium AI Nutrition & Fitness Platform (/_mcp/search/* & /_mcp/management/* with API Key, OAuth…

Official Model Context Protocol (MCP) bridge for the DietsPremium AI Platform (Nutrition OS). Acts as a local stdio bridge connecting MCP-compliant AI hosts (Claude Desktop, Claude.ai, Cursor IDE, LM Studio, ChatGPT / OpenAI, Gemini, Google Antigravity, Continue.dev, Ollama) directly to DietsPremium's remote hybrid vector search (/_mcp/search/) and authenticated account, patient, diet, training, recipe, food, exercise, allergen, medication, supplement, calendar, company, article, and ebook management engine (/_mcp/management/) via secure JSON-RPC 2.0.

Summary extracted from the README.

🥗 DietsPremium MCP Server (dietspremium-mcp v0.0.20)

Official Model Context Protocol (MCP) bridge for the DietsPremium AI Platform (Nutrition OS).

Acts as a local stdio bridge connecting MCP-compliant AI hosts (Claude Desktop, Claude.ai, Cursor IDE, LM Studio, ChatGPT / OpenAI, Gemini, Google Antigravity, Continue.dev, Ollama) directly to DietsPremium's remote hybrid vector search (/_mcp/search/<entity>) and authenticated account, patient, diet, training, recipe, food, exercise, allergen, medication, supplement, calendar, company, article, and ebook management engine (/_mcp/management/<entity>) via secure JSON-RPC 2.0.

🔐 Authentication & Quota Architecture (v0.0.20)

DietsPremium MCP supports a 4-level priority authentication cascade:

  1. SAML 2.0 Enterprise SSO (@dietspremium.com): Automatic zero-config provisioning and Unlimited (∞) daily MCP quota for internal staff.
  2. OAuth 2.1 + PKCE (dp_oat_...): Native 1-click browser sign-in (/.well-known/oauth-authorization-server, /oauth/v2/authorize, /oauth/v2/token, /oauth/v2/register) for web/desktop AI connectors (Claude.ai, ChatGPT, Gemini, Cursor, VS Code).
  3. Personal MCP API Key (CLIENT_ID:CLIENT_SECRET): Passed via DIETSPREMIUM_MCP_KEY (or --key) for CLI/desktop bridges.
  4. Daily Quotas + Non-Expiring Overhead Token Pool (User.mcpOverheadTokens):
    • Anonymous: 15 requests/day (public search only)
    • Free Account: 50 requests/day (search + personal account/patient read)
    • B2C PRO: 500 requests/day (~15,000/month — full management + Fridge AI)
    • Trainer / Specialist: 2,500 requests/day (~75,000/month — full CRM + Diet/Training generators)
    • Studio B2B: 10,000 requests/day (~300,000/month — multi-trainer clinic)
    • Pay-As-You-Go Overhead Token Packs (€1 = 100k, €2 = 250k, €3 = 450k, €5 = 1M, €10 = 2.5M tokens): Never expire, automatically kick in when the daily limit is reached, and unlock full MCP access even without a monthly subscription (available for both logged-in users and guests in /koszyk).

⚡ Key Capabilities

  • 🔍 Dedicated Search Entrypoints (/_mcp/search/<entity>): Hybrid AI vector k-NN (ai: true) and strict Boolean filter search (ai: false) across foods (search_food), global EAN barcodes (search_food_world), recipes (search_recipe), 158 diet types (search_diet), exercises (search_exercise), allergens (search_allergen), medications (search_medication), supplements (search_supplement), clinical articles (search_article), knowledge base (search_knowledge), companies (search_company), and specialists (search_user).
  • 🛠️ Authenticated Management Entrypoints (/_mcp/management/<entity>): Full CRUD and account management powered by your personal MCP Token (unlimited daily management request contingent with real-time token tracking):
    • Personal Account & Work Addresses (management_account): First/last name, salutation, bio (about_me), S3 avatar & background cover photo (GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA), verified GeoName residential address (SEARCH_COUNTRY -> SEARCH_CITY -> SEARCH_ZIP -> UPDATE_ADDRESS), work/invoicing addresses (LIST_WORK_ADDRESSES, ADD_WORK_ADDRESS, UPDATE_WORK_ADDRESS, DELETE_WORK_ADDRESS), professions/jobs, education/academic title, and personal tags. (Email and phone changes are strictly blocked via MCP for 2FA security).
    • Personal & Company 2-Way Calendar (management_calendar): List, add, update, and delete personal or company events with automatic 2-way synchronization between CompanyCalendar (company_key) and the assigned trainer's personal Calendar (trainer_key), plus S3 image/video attachments.
    • Company, Studio & Clinic Management (management_company): Create or manage owned companies or clinics assigned via CompanyTrainerAssign (allow_edit = 1): GeoName address, Mon-Sun opening hours (day_1..day_7, day_holiday), website, features, trainer roster (LIST_TRAINERS, ASSIGN_TRAINER with show_on_frontend & allow_edit, UNASSIGN_TRAINER), and S3 gallery media.
    • Patient CRM (management_patient): List patients (10 per page), onboard new patients, edit clinical notes/tags, or soft-deactivate cooperation (active = 0).
    • Dual-Mode Diet Engine & Fridge AI (management_diet):
      • Trainer Mode (granted_to = NULL): Create and edit diet templates, days, meal schemas, recipes, foods, supplements, exercises, S3 media, and assign diet plans to patients (ASSIGN_TO_PATIENT). Trainers are strictly blocked from editing private patient tracking logs.
      • Recipient/Patient Mode (granted_to = user): Read assigned diet, log daily water (LOG_WATER), mood/wellbeing (LOG_FEEL), personal notes (LOG_NOTICE), smoking/biohacking (LOG_SMOKE / LOG_BIOHACKING), inspect logs (GET_TRACKING_LOGS), run AI Fridge Meal Replacement (EVALUATE_FRIDGE_REPLACEMENT) comparing scheduled meal macros against fridge ingredients, and physically replace meals (REPLACE_MEAL) when allowEditMeals = 1.
    • Dual-Mode Training Plan Builder (management_training): Create and edit training templates, workout days, schemas, sets, reps, rest, and tempo in Trainer Mode or inspect assigned plans in Recipient Mode.
    • Culinary Recipe Builder (management_recipe): Fetch AI creation guide (GET_CREATION_GUIDE), list/inspect recipes, create complete culinary recipes with ingredients (RecipeFood), step-by-step instructions (RecipeStep), macros, and S3 media (media_recipe).
    • Editorial Article & Ebook Publishing (management_article, management_ebook): Fetch AI creation guide (GET_CREATION_GUIDE), create/update articles (ArticleChapter) and ebooks (EbookChapter), and manage S3 media.
  • 🔐 Zero Raw ID Exposure (key Contract): Every entity across /_mcp/search/* and /_mcp/management/* is identified exclusively by a Base64-encoded "key" (and "uid" where applicable) — never raw database IDs.
  • 📄 Deterministic Pagination: All list and search operations return up to 10 items per page (page: 1, 2, ..., max_results: 10).

📋 Prerequisites

  • Node.js: v18.0.0 or higher
  • DietsPremium MCP Credentials: An active CLIENT_ID:CLIENT_SECRET pair (required for /_mcp/management/* and higher search rate limits).

🚀 Quick Start & Integration

Security Note: Passing credentials via the env object is the recommended best practice across all MCP desktop clients to avoid exposing secrets in system process listings (ps aux).

1. Full MCP Server (Search + Management)

{
  "mcpServers": {
    "dietspremium": {
      "command": "npx",
      "args": [
        "-y",
        "dietspremium-mcp",
        "https://dietspremium.com/_mcp"
      ],
      "env": {
        "DIETSPREMIUM_MCP_KEY": "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET"
      }
    }
  }
}

2. Scoped / Dedicated Search or Management Endpoint

You can also scope the bridge to only Search tools (/_mcp/search or /_mcp/search/food) or only Management tools (/_mcp/management or /_mcp/management/diet):

{
  "mcpServers": {
    "dietspremium-search": {
      "command": "npx",
      "args": [
        "-y",
        "dietspremium-mcp",
        "https://dietspremium.com/_mcp/search"
      ],
      "env": {
        "DIETSPREMIUM_MCP_KEY": "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET"
      }
    },
    "dietspremium-management": {
      "command": "npx",
      "args": [
        "-y",
        "dietspremium-mcp",
        "https://dietspremium.com/_mcp/management"
      ],
      "env": {
        "DIETSPREMIUM_MCP_KEY": "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET"
      }
    }
  }
}

🛠️ Available MCP Tools

1. Public & Search Tools (/_mcp/search/<entity>)

Tool Name HTTP Endpoint Description Key Arguments
search_food / food /_mcp/search/food Search foods with macronutrient constraints & multi-currency prices query, kcal_min/max, proteins_min/max, allergen_exclude, currency, page, locale, ai
search_food_world / food-world /_mcp/search/food-world Global 3.5M+ products & EAN barcodes (Open Food Facts + USDA) barcode, query, country, currency, store, nutriscore, page, locale
search_diet / diet /_mcp/search/diet 158 clinical & lifestyle diet templates with full cost breakdown query, diet_template_type, days, avoid_allergens, currency, page, locale
search_recipe / recipe /_mcp/search/recipe Curated culinary recipes with portion macros & cost query, currency, page, max_results, locale, ai
search_exercise / exercise /_mcp/search/exercise 2,000+ workouts, biomechanics & anatomical muscle groups query, page, max_results, locale, ai
search_allergen / allergen /_mcp/search/allergen EU 1169/2011 dietary allergens & cross-reactivity query, page, max_results, locale, ai
search_knowledge / knowledge /_mcp/search/knowledge Clinical nutrition science & RAG grounding query, type, page, max_results, locale, ai
search_article / article /_mcp/search/article 6,000+ published health & nutrition articles query, page, max_results, locale, ai
search_medication / medication /_mcp/search/medication 53,000+ drugs & food-medication interactions query, page, max_results, locale, ai
search_supplement / supplement /_mcp/search/supplement Dietary supplements, vitamins & adaptogens query, tag, page, max_results, locale, ai
search_company / company /_mcp/search/company 173,000+ clinics, pharmacies, gyms, stores & catering query, city, page, max_results, locale, ai
search_user / user /_mcp/search/user Verified clinical dietitians & personal trainers query, page, max_results, locale, ai

2. Authenticated Management Tools (/_mcp/management/<entity>)

Tool Name HTTP Endpoint Account Scope Key Actions
management_account /_mcp/management/account Any Authenticated User GET_PROFILE, UPDATE_PERSONAL_DATA, UPDATE_PROFILE, GET_ADDRESS, SEARCH_COUNTRY, SEARCH_CITY, SEARCH_ZIP, UPDATE_ADDRESS, LIST_WORK_ADDRESSES, ADD_WORK_ADDRESS, UPDATE_WORK_ADDRESS, DELETE_WORK_ADDRESS, LIST_JOBS, SEARCH_AVAILABLE_JOBS, UPDATE_PROFESSIONS, LIST_EDUCATIONS, UPDATE_EDUCATION, LIST_TAGS, SEARCH_AVAILABLE_TAGS, UPDATE_TAGS, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_calendar /_mcp/management/calendar Any Authenticated User LIST_EVENTS, GET_EVENT, ADD_EVENT, CREATE_EVENT, UPDATE_EVENT, DELETE_EVENT, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_company /_mcp/management/company Trainer / Company (created_by or CompanyTrainerAssign.allow_edit=1) LIST_COMPANIES, GET_COMPANY, CREATE_COMPANY, UPDATE_COMPANY, UPDATE_ADDRESS, UPDATE_OPEN_HOURS, LIST_TRAINERS, ASSIGN_TRAINER, UPDATE_TRAINER_ASSIGNMENT, UNASSIGN_TRAINER, LIST_AVAILABLE_FEATURES, SEARCH_COUNTRY, SEARCH_CITY, SEARCH_ZIP, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_patient /_mcp/management/patient Trainer / Specialist LIST_PATIENTS, GET_PATIENT, ADD_PATIENT, CREATE_PATIENT, UPDATE_PATIENT, DELETE_PATIENT, DEACTIVATE_PATIENT (active = 0)
management_diet /_mcp/management/diet Trainer (granted_to=NULL) & Patient (granted_to=user) Trainer: LIST_DIETS, GET_DIET, GET_DAY, CREATE_DIET, UPDATE_DIET, ADD_DAY, REMOVE_DAY, ADD_SCHEMA, UPDATE_SCHEMA, REMOVE_SCHEMA, ADD_ITEM, REMOVE_ITEM, ASSIGN_TO_PATIENT. Patient: EVALUATE_FRIDGE_REPLACEMENT, REPLACE_MEAL, LOG_WATER, LOG_FEEL, LOG_NOTICE, LOG_SMOKE, LOG_BIOHACKING, GET_TRACKING_LOGS
management_training /_mcp/management/training Trainer (granted_to=NULL) & Patient (granted_to=user) LIST_TRAININGS, GET_TRAINING, GET_DAY, CREATE_TRAINING, UPDATE_TRAINING, ADD_DAY, REMOVE_DAY, ADD_SCHEMA, UPDATE_SCHEMA, REMOVE_SCHEMA, ADD_EXERCISE, REMOVE_EXERCISE, ASSIGN_TO_PATIENT, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_recipe /_mcp/management/recipe PRO / Trainer / Editorial GET_CREATION_GUIDE, LIST_RECIPES, GET_RECIPE, CREATE_RECIPE, UPDATE_RECIPE, DELETE_RECIPE, ADD_INGREDIENT, REMOVE_INGREDIENT, ADD_STEP, UPDATE_STEP, DELETE_STEP, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_article /_mcp/management/article PRO / Trainer / Editorial GET_CREATION_GUIDE, LIST_ARTICLES, GET_ARTICLE, CREATE_ARTICLE, UPDATE_ARTICLE, DELETE_ARTICLE, ADD_CHAPTER, UPDATE_CHAPTER, DELETE_CHAPTER, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_ebook /_mcp/management/ebook PRO / Trainer / Editorial GET_CREATION_GUIDE, LIST_EBOOKS, GET_EBOOK, CREATE_EBOOK, UPDATE_EBOOK, DELETE_EBOOK, ADD_CHAPTER, UPDATE_CHAPTER, DELETE_CHAPTER, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_food /_mcp/management/food PRO / Trainer / Editorial LIST_FOODS, GET_FOOD, CREATE_FOOD, UPDATE_FOOD, DELETE_FOOD, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_exercise /_mcp/management/exercise PRO / Trainer / Editorial LIST_EXERCISES, GET_EXERCISE, CREATE_EXERCISE, UPDATE_EXERCISE, DELETE_EXERCISE, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_exercise_bundle /_mcp/management/exercise-bundle PRO / Trainer / Editorial LIST_BUNDLES, GET_BUNDLE, CREATE_BUNDLE, UPDATE_BUNDLE, DELETE_BUNDLE, ADD_EXERCISE_TO_BUNDLE, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_allergen /_mcp/management/allergen PRO / Trainer / Editorial LIST_ALLERGENS, GET_ALLERGEN, CREATE_ALLERGEN, UPDATE_ALLERGEN, DELETE_ALLERGEN, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_medication /_mcp/management/medication PRO / Trainer / Editorial LIST_MEDICATIONS, GET_MEDICATION, CREATE_MEDICATION, UPDATE_MEDICATION, DELETE_MEDICATION, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA
management_supplement /_mcp/management/supplement PRO / Trainer / Editorial LIST_SUPPLEMENTS, GET_SUPPLEMENT, CREATE_SUPPLEMENT, UPDATE_SUPPLEMENT, DELETE_SUPPLEMENT, GET_MEDIA, ADD_MEDIA, REPLACE_MEDIA, DELETE_MEDIA

📄 License

MIT © DietsPremium