DEVELOPER & INTEGRATIONS GUIDE
NutroIQ Official AI Connectors Guide
Complete technical specification for the NutroIQ Model Context Protocol (MCP) server (v2.4/v2.5), OAuth 2.1 authorization, 23 Remote MCP Tools, 8 Interactive MCP App UI Cards, 4 Resources, and 6 Prompt Templates.
Last Updated: November 2026
Endpoint:
https://api.nutroiq.com/mcpTransport: Streamable HTTP POST (JSON-RPC 2.0, non-POST methods rejected with 405 Method Not Allowed and
Allow: POST)Payload Limit: Strict 64 KiB wire payload bound with automatic range bucket coarsening (
day → week → month)Authorization: OAuth 2.1 with mandatory RFC 7636 PKCE (S256 code challenge) and RFC 8707 Resource Indicators
1. Architecture & Protocol Standards
The NutroIQ AI Connector allows frontier AI assistants (Anthropic Claude, OpenAI ChatGPT, Google Gemini) to securely query and update nutritional diaries directly inside conversational workflows. The architecture adheres to:
-
Streamable HTTP MCP Transport: NutroIQ exposes a streamable HTTP POST endpoint at
https://api.nutroiq.com/mcpconforming to the Model Context Protocol (JSON-RPC 2.0). Wire payloads are bounded by a strict 64 KiB limit. When multi-day range queries (such asget_range_summary) risk exceeding this ceiling, the server automatically coarsens time buckets fromdaytoweekormonth, returning a helpful hint in the response. - OAuth 2.1 & PKCE (RFC 7636): Authorization Code grant with mandatory S256 PKCE verification. Implicit grant is disabled. Code challenges and refresh tokens are cryptographically hashed using SHA-256 before storage in Cloud Firestore.
-
RFC 8707 Resource Indicators: Authorization requests and tokens are cryptographically bound to the protected resource identifier
https://api.nutroiq.com/mcp. -
RFC 8414 & RFC 9728 Discovery Metadata: Complete automated discovery metadata is published at:
- Authorization Server Metadata:
https://api.nutroiq.com/.well-known/oauth-authorization-server - Protected Resource Metadata:
https://api.nutroiq.com/.well-known/oauth-protected-resource - MCP-Scoped Protected Resource Metadata:
https://api.nutroiq.com/.well-known/oauth-protected-resource/mcp
- Authorization Server Metadata:
-
RFC 7591 Dynamic Client Registration (DCR): Available at
https://api.nutroiq.com/oauth/registerwith Client Identity Metadata Document (CIMD) support for automated platform onboarding. -
RFC 7009 Token Revocation: Immediate token revocation via
POST https://api.nutroiq.com/oauth/revoke. Revoking an access token invalidates only that specific token; revoking a refresh token terminates the authorization grant and all associated access and refresh tokens. - Apple Health Privacy & AI Withholding: With your permission, Apple Health-derived activity data syncs to your private NutroIQ account. Apple Health-derived activity data is never shared with connected third-party AI assistants and is always excluded from Remote MCP tools, resources, and summaries. Apple Health data is never used for advertising or data mining.
2. OAuth 2.1 Scopes Specification
Client applications must request granular scopes matching their intended operations. NutroIQ provides 9 scopes, including 2 sensitive scopes that require affirmative user opt-in during authorization:
| Scope | Type | Associated MCP Tools | Description & Access Level |
|---|---|---|---|
| read:profile | Standard | get_context, get_day_summary, get_checkin, get_insights, get_weekly_review, fetch, update_settings |
Read user profile settings, daily calorie target, macronutrient distribution goals, energy unit, and configured timezone. (Also required alongside write:profile for update_settings.) |
| read:meals | Standard | get_day_summary, get_checkin, get_range_summary, get_insights, get_weekly_review, lookup_food, find_meals, list_meals, get_meal, search, fetch, relog_meal |
Inspect logged meals, item names, portion sizes, calories, macronutrients, and ingredient breakdowns. Raw camera roll images are excluded. |
| read:exercises | Standard | list_exercises, get_day_summary, get_range_summary*, get_insights*, get_weekly_review*, get_checkin*, fetch* |
Read recorded exercise sessions, activity names, logged timestamps, and active calories burned. (*Degrades gracefully if omitted; required for day:* in fetch.) |
| read:water | Standard | get_day_summary, get_checkin*, get_range_summary*, get_insights*, get_weekly_review*, fetch* |
Read fluid intake logs and hydration progress toward daily fluid target. (*Degrades gracefully if omitted; required for day:* in fetch.) |
| write:meals | Standard | log_meal, relog_meal |
Log new meals and snacks, or re-log past meals with portion scaling. (Creation only; cannot modify, delete, or restore existing meals.) |
| write:water | Standard | log_water |
Add fluid intake records or adjust daily hydration ledger totals. |
| write:exercises | Standard | log_exercise, update_exercise, delete_exercise |
Record new physical activities, adjust workout entries, or remove exercise records. |
| edit:meals | Sensitive Opt-In | update_meal, delete_meal, restore_meal |
Modify nutritional values, portions, or timestamps of existing logged meals, soft-delete meal records, or restore soft-deleted meals via undoToken within 24 hours. Requires affirmative opt-in. |
| write:profile | Sensitive Opt-In | update_settings |
Update daily calorie targets, macronutrient split goals, hydration targets, or user timezone. Requires affirmative opt-in. (Note: update_settings also requires read:profile.) |
get_checkin, get_range_summary, get_insights, and get_weekly_review) require read:meals and read:profile. If the user has not granted optional scopes such as read:water or read:exercises, these tools do not fail. Instead, they gracefully omit hydration and exercise figures (or report them as zero) while successfully delivering all meal and nutrition data. By contrast, get_day_summary requires all four read scopes (read:profile, read:meals, read:exercises, read:water) to compile a complete daily snapshot.
3. The 23 Remote MCP Tools
NutroIQ exposes 23 specialized tools via tools/list and tools/call. All tools declare explicit annotations (readOnlyHint, destructiveHint, and openWorldHint: false) and attach interactive UI cards where applicable:
3.1 Read-Only Tools (13 Tools)
| Tool Name | Required Scopes | Key Input Parameters | Annotations & UI | Description & Behavior |
|---|---|---|---|---|
get_context |
read:profile | timezone |
Read-Only | Returns current user target calories, today's aggregated intake, remaining calorie budget, and user timezone. |
get_day_summary |
read:profile read:meals read:exercises read:water | date (or dayKey), includeMeals, timezone |
Read-Only ui://nutroiq/day-card |
Comprehensive breakdown of calories, protein, carbs, fat, water, and exercise for a specific day. Requires all four read scopes. |
get_checkin |
read:profile read:meals | date (YYYY-MM-DD, today, yesterday), time, timezone |
Read-Only | Daily progress check-in returning pace, target comparison, next meal slot, and guidance. (Optional read:water and read:exercises include hydration and exercise.) |
get_range_summary |
read:profile read:meals | from, to, days (1–3650), since (start), bucket (auto, day, week, month), calorieTolerance, includeToday, includeEmpty, timezone |
Read-Only | Aggregates macro trends and daily caloric averages across a multi-day span with automatic bucket coarsening to fit under 64 KiB. (Optional read:exercises and read:water include activity and hydration.) |
get_insights |
read:profile read:meals | days (1–3650, default 14), since (start), includeToday, calorieTolerance (fraction of budget, e.g. 0.10 for 10%), from, to, timezone |
Read-Only | Analyzes top food contributors, meal slot gaps, calorie adherence, and logging completeness with canonical sourceIds. (Optional read:exercises and read:water include activity and hydration.) |
get_weekly_review |
read:profile read:meals | week (date in week, or current, previous), timezone |
Read-Only ui://nutroiq/weekly-review |
Generates a Monday–Sunday weekly nutrition review with daily averages, macro distribution, and top logged foods. (Optional read:exercises and read:water include activity and hydration.) |
lookup_food |
read:meals | query (food name, keyword, or AFCD foodId), gtin (barcode), portion (grams, default 100g or serving), limit (default 5) |
Read-Only ui://nutroiq/food-lookup |
Searches Personal Food Library first, then FSANZ Australian Food Composition Database – Release 3 (AFCD). Returns per-100g nutrients and portion references. |
find_meals |
read:meals | query, category, lookbackDays (default 30, max 90), limit, timezone |
Read-Only ui://nutroiq/meal-picker |
Performs fast search across logged meal names, ingredients, and categories over the lookback window. |
list_meals |
read:meals | date (or dayKey, from/to), category, detail (compact, full), fields, limit, cursor, timezone |
Read-Only | Returns an array of meals logged on a given calendar day or date range with pagination support. |
get_meal |
read:meals | mealId, date (or dayKey) |
Read-Only | Fetches the full nutritional breakdown and ingredient details for a specific logged meal record by ID. |
list_exercises |
read:exercises | date (or dayKey), or from/to (max 14 days), timezone |
Read-Only | Returns all recorded exercise sessions in the requested single day or date range (max 14 days) without pagination, including activity names, logged timestamps, optimistic concurrency versions, and active calories burned. |
search |
read:meals | query |
Read-Only | High-speed unified search across user diary history and standard nutritional items returning canonical URIs. |
fetch |
read:meals (meal records & recent meals) read:profile (profile targets) read:profile read:meals read:exercises read:water (daily summaries) |
id (canonical URI or identifier, e.g. meal:{dayKey}:{mealId}, day:{dayKey}, nutroiq://profile, nutroiq://meals/recent, nutroiq://guide/logging, or UI card URI) |
Read-Only | Fetches a canonical document or resource by ID/URI. Required scopes depend on identifier type: read:meals for meal identifiers (meal:YYYY-MM-DD:id) and recent meals; read:profile for profile targets (nutroiq://profile); all four read scopes (read:profile, read:meals, read:exercises, read:water) for daily summaries (day:YYYY-MM-DD); and no additional scope for public logging guides or UI cards. |
3.2 Non-Destructive Write Tools (4 Tools)
| Tool Name | Required Scopes | Key Input Parameters | Annotations & UI | Description & Behavior |
|---|---|---|---|---|
log_meal |
write:meals | name, calories, protein, carbs, fat, category, date, time, grams, ingredients, breakdown, confidence, referenceFoodId, saveToLibrary, note, hasImage, requestId |
Non-Destructive Write ui://nutroiq/meal-receipt |
Records a new meal into the user's food journal with smart date/time resolution, ingredient breakdown, and UUID deduplication. |
relog_meal |
read:meals write:meals | sourceId (in meal:YYYY-MM-DD:mealId format), servings (portion multiplier, default 1.0, range 0.05–20), date, time, category, strict, requestId, timezone |
Non-Destructive Write ui://nutroiq/meal-receipt |
Re-logs a past meal using its canonical sourceId (from find_meals or search), scaling calories and nutrients by servings. Requires both read:meals (to read the source meal) and write:meals (to create the new entry). |
log_exercise |
write:exercises | name, caloriesBurned (optional alias: calories), date, time, timezone, requestId |
Non-Destructive Write ui://nutroiq/exercise-receipt |
Records workout activity and estimated active caloric expenditure. |
restore_meal |
edit:meals Sensitive | undoToken |
Non-Destructive Write ui://nutroiq/meal-receipt |
Reverses a delete_meal operation within 24 hours using the temporary undoToken, restoring the meal and day totals. Requires the sensitive edit:meals scope. |
3.3 Destructive / Mutating Write Tools (6 Tools)
| Tool Name | Required Scopes | Key Input Parameters | Annotations & UI | Description & Behavior |
|---|---|---|---|---|
log_water |
write:water | add (delta in units) or setTotal (absolute count), unit (glass, ml, l, oz), date, timezone |
Destructive Hint ui://nutroiq/water-receipt |
Records fluid intake. Mutates the day's water ledger by adding or setting total hydration. |
update_meal |
edit:meals Sensitive | mealId, version, date, changes (object: name, category, calories, protein, carbs, fat, grams, ingredients, breakdown, note, localTime) |
Destructive Hint ui://nutroiq/meal-receipt |
Modifies fields of an existing logged meal using optimistic concurrency version checking. |
delete_meal |
edit:meals Sensitive | mealId, version, date |
Destructive Hint ui://nutroiq/meal-receipt |
Moves a logged meal to soft-deleted state, returning a 24-hour undoToken for accidental deletion recovery. |
update_exercise |
write:exercises | exerciseId, date, version, caloriesBurned (optional alias: calories) |
Destructive Hint ui://nutroiq/exercise-receipt |
Edits active calories burned on an existing exercise record with optimistic concurrency version validation (calories-only update). |
delete_exercise |
write:exercises | exerciseId, date, version |
Destructive Hint ui://nutroiq/exercise-receipt |
Permanently removes a recorded exercise entry with optimistic version verification. |
update_settings |
read:profile write:profile Sensitive | calories, protein, carbs, fat, waterTarget, energyUnit, timezone, preferences, autoBalance, expectedVersion, dryRun |
Destructive Hint ui://nutroiq/settings-diff |
Updates daily nutritional targets, hydration goal, and timezone. Supports dryRun: true previews and enforces a 1,200 kcal/day minimum safety floor. Requires both read:profile and write:profile scopes. |
4. Remote MCP Resources & Interactive MCP Apps
4.1 Data & Guide Resources
Clients supporting MCP Resources can inspect or subscribe to 4 live context snapshots:
nutroiq://profile— Current user nutrition profile, baseline targets, timezone, and dietary preferences (JSON).nutroiq://day/{date}/summary— Canonical daily ledger summarizing calories, macros, hydration, and exercise for calendar date{date}(JSON).nutroiq://meals/recent— Chronological list of the user's frequently logged and recent meal groups from the past 7 days, up to 20 meal groups (JSON).nutroiq://guide/logging— Structured Markdown guide detailing portion estimation, ingredient breakdown rules, and nutrition tracking best practices (Markdown).
4.2 Interactive MCP App UI Cards
NutroIQ implements the io.modelcontextprotocol/ui extension (MIME type text/html;profile=mcp-app). These interactive UI cards render directly inside supported host applications (such as Claude artifacts and cards) without external framing:
ui://nutroiq/day-card— Visual daily progress card with calorie budget rings, macro bars, and meal timeline (attached toget_day_summary).ui://nutroiq/meal-receipt— Interactive visual receipt showing per-ingredient macro breakdown, portion size, and action confirmation (attached tolog_meal,relog_meal,update_meal,delete_meal, andrestore_meal).ui://nutroiq/water-receipt— Visual hydration meter and quick-increment ledger (attached tolog_water).ui://nutroiq/weekly-review— Comprehensive 7-day adherence card with daily breakdown bars and top food contributors (attached toget_weekly_review).ui://nutroiq/meal-picker— Interactive candidate list allowing users to browse and select past favorites (attached tofind_meals).ui://nutroiq/food-lookup— Reference food card displaying per-100g nutritional breakdown, FSANZ AFCD attribution, and notices link (attached tolookup_food).ui://nutroiq/settings-diff— Visual before/after diff comparing existing targets against proposed values duringupdate_settingsdry runs.ui://nutroiq/exercise-receipt— Workout summary card displaying activity name, active calories burned, updated daily calorie budget, and inline controls to edit calories or delete the entry (attached tolog_exercise,update_exercise, anddelete_exercise).
5. MCP Prompt Templates
NutroIQ registers 6 conversational prompt templates accessible via prompts/list and prompts/get:
weekly_review(Argument:week) — Generates a structured Monday–Sunday weekly nutrition debrief summarizing achievements, nutritional balance, and practical suggestions for next week.daily_debrief(Argument:date) — Evaluates daily calories, hydration, and macronutrients against goals and offers 2–3 actionable insights.meal_suggestion_within_budget(Argument:category) — Checks remaining calories and macros for today and proposes 3 meals that fit within the remaining budget.log_meal_from_description(Argument:description) — Extracts ingredients and portion estimates from a natural language meal description and invokeslog_meal.log_from_photo— Instructs the AI assistant to checkfind_mealsandlookup_foodfirst, estimate photographed portions, and log the meal with full breakdown, confidence rating, andhasImage: true.plan_rest_of_day— Callsget_day_summaryandfind_mealsto suggest familiar meals matching the user's remaining calories and macros.
6. FSANZ AFCD Attribution & Reference Food Grounding
Accurate nutrition tracking requires reliable reference data. NutroIQ uses a tiered lookup strategy in lookup_food:
- Personal Food Library: First searches custom food items and recipes previously logged by the user (IDs prefixed with
cf_*or matched via barcodegtin). - FSANZ AFCD Release 3: If no personal match is found, queries the FSANZ Australian Food Composition Database – Release 3 (identified with reference IDs like
AFCD-F005519).
Whenever food data is backed by FSANZ AFCD, the API response and UI card include full attribution metadata:
{
"source": "afcd",
"attribution": {
"source": "FSANZ Australian Food Composition Database – Release 3",
"copyright": "© Food Standards Australia New Zealand",
"licenceUrl": "https://www.foodstandards.gov.au/science-data/monitoringnutrients/afcd/datauserlicenceagreement",
"changes": "Per-portion values and kcal are calculated by NutroIQ from FSANZ per-100 g data.",
"noticesUrl": "https://api.nutroiq.com/docs/afcd-notices"
}
}
Food Standards Australia New Zealand (FSANZ) does not endorse NutroIQ or its calculations. Per-portion nutritional values and calorie (kcal) counts are calculated independently by NutroIQ from FSANZ per-100 g data. For full legal notices and data limitations, visit /docs/afcd-notices.
7. Client Setup, Error Handling & Reviewer Credentials
7.1 Connecting Frontier AI Platforms
-
Anthropic Claude: Add NutroIQ to
claude_desktop_config.json:
Or select NutroIQ in the Claude Connected Apps directory on web or mobile.{ "mcpServers": { "nutroiq": { "url": "https://api.nutroiq.com/mcp" } } } -
OpenAI ChatGPT: Configure the Remote MCP Connector in ChatGPT Settings > Connected Apps (or Settings > Connectors) using endpoint
https://api.nutroiq.com/mcpwith OAuth 2.1 authorization URLhttps://api.nutroiq.com/oauth/authorizeand token URLhttps://api.nutroiq.com/oauth/token. Note that the/mcpendpoint serves streamable MCP JSON-RPC 2.0 for native MCP Connectors and cannot be imported directly as a REST OpenAPI Custom GPT Action. -
Google Gemini: Install the extension via Gemini CLI (
gemini extensions install nutroiq) or addhttps://api.nutroiq.com/mcpas a Custom MCP Provider.
7.2 Structured Error Handling & Self-Correction
When an error occurs, NutroIQ returns a structured ToolErrorEnvelope designed for LLM self-correction:
{
"code": "validation_error",
"message": "input validation failed",
"hint": "Check input field formats and values against constraints.",
"fields": [
{
"field": "category",
"reason": "category must be one of Breakfast, Lunch, Dinner, Snacks",
"allowed": ["Breakfast", "Lunch", "Dinner", "Snacks"]
}
],
"retryable": true
}
If a required scope is missing, the response includes an insufficient_scope error code along with _meta["mcp/www_authenticate"] referencing the protected resource metadata URL so clients can prompt the user to re-authorize with the required permission.
7.3 Reviewer Credentials & Domain Verification
App directory reviewers from Apple, Anthropic, OpenAI, or Google can authenticate on the OAuth consent screen using Sign in with Apple, Sign in with Google, or the collapsible Reviewer Email & Password form on /oauth/authorize. Domain verification for OpenAI is published at /.well-known/openai-apps-challenge. For directory review questions or dedicated test credentials, contact support@nutroiq.com.