Agent Documentation

Ration API and MCP Discovery

Ration exposes kitchen data to agents through a scoped REST API and a dedicated MCP server for conversational kitchen operations.

REST API

Send an organization-scoped API key with X-Api-Key or Authorization: Bearer <key>. Create keys in Hub → Settings → Developer → API Keys.

Base URL

/api/v1 on your Ration app origin (e.g. https://ration.mayutic.com/api/v1).

Rate limits

Exports: 30 requests/minute. Imports: 20 requests/minute.

Endpoints

EndpointMethodScopeFormat
/api/v1/inventory/exportGETinventoryCSV
/api/v1/inventory/importPOSTinventoryCSV
/api/v1/galley/exportGETgalleyJSON
/api/v1/galley/importPOSTgalleyJSON
/api/v1/supply/exportGETsupplyCSV

Example: Export inventory

curl -H "X-Api-Key: YOUR_KEY" https://ration.mayutic.com/api/v1/inventory/export

MCP Server

Connect an MCP-compatible AI client to https://mcp.ration.mayutic.com/mcp. Ration is AI-agent-ready: paste the URL, complete browser sign-in, select your household, and approve granular permissions — no manual API key for standard clients.

Recommended: OAuth 2.1

  1. In your MCP client, add server URL `https://mcp.ration.mayutic.com/mcp`
  2. Complete browser sign-in, select your household, and approve permissions (in that order)
  3. Manage or revoke access anytime in Hub → Settings → Developer → MCP

Supported clients

Cursor, Claude Desktop, ChatGPT desktop, Goose, Zed, Warp, Any MCP client with OAuth 2.1 discovery.

Manage grants in Hub → Settings → Developer → MCP. Discovery: MCP protected resource metadata, OAuth authorization server, MCP server card.

MCP OAuth troubleshooting

  • Browser shows "No authorization code received"

    Your MCP client reached its OAuth callback without a code — usually Deny was clicked, the flow expired (~10 minutes), or an old browser tab was reused. Remove the MCP server in Cursor, re-add the URL, and complete sign-in → household → Authorize in one fresh tab. Prefer native URL config over mcp-remote when Cursor supports it.

  • Browser opens repeatedly or authorization fails

    Revoke the grant below, remove the MCP server in your client, re-add the URL, and finish sign-in → household → authorize in one tab within a few minutes.

  • Agent listed here but tools fail

    Revoke and reconnect — the grant may be incomplete (shows "Not linked"). Household selection is required for every new connection.

  • Mid-session Unauthorized / tools suddenly fail

    Access tokens last 1 hour; MCP clients must refresh using offline_access. If the client does not refresh, reconnect. Revoking the grant or leaving the household also causes immediate 401s.

  • Wrong pantry data

    Revoke and reconnect, choosing the correct household at the selection step.

  • Consent screen says "Unverified app"

    Expected for AI clients that register themselves (Cursor, Claude Desktop, Gemini CLI, Warp, CLIs). Approve only if you started the connection from that client and the "sent to" host matches it. Clients that publish a client metadata document (for example VS Code and Claude Code) show "Published by <host>" instead.

  • Consent screen says "Published by <host>"

    The client identified itself with a metadata document on that website, for example vscode.dev or claude.ai. Approve only if the host is the real website of the app you are connecting. If the screen also warns that the app sends you to a different website, approve only if you trust that site.

  • Browser shows "Connection stopped"

    The client asked to return to an address it never registered. Remove the MCP server in the client and add the URL again. If it keeps happening, email support@mayutic.com with the host shown.

  • Client registration fails with invalid_redirect_uri

    The error_description says which rule failed. New registrations refuse javascript:, data:, file: and other script or browser-internal schemes, plain http outside localhost/127.0.0.1/[::1], and fragments. Any app scheme (cursor:, warp:, goose: ...) is accepted when it has a path, for example goose://oauth/callback. Existing connections are not affected.

  • Sign-in fails with invalid_client and a client metadata document message

    The client identifies itself with an https URL (a client metadata document) that Ration could not fetch or accept. The error_description says why: no response within 3 seconds, not served as application/json, larger than 5 KB, a redirect, a client_id that does not match its URL, or a redirect URI that is not allowed. Failures are remembered for 60 seconds, so wait a minute and try again; if it persists, update the client or contact its publisher.

  • Sign-in fails with temporarily_unavailable (too many client metadata lookups)

    Too many metadata document lookups for one website or from one network in a minute. Wait a minute and connect again.

Flows are short-lived (~10 minutes). Restart from your AI client if authorization expired — do not reuse an old browser tab.

Advanced: manual MCP auth

Organization API keys with mcp:* scopes remain supported for CI, custom headers, and legacy clients. Create keys in Hub → Settings → Developer → API Keys, then pass the key as a Bearer token via mcp-remote.

{
  "mcpServers": {
    "ration": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.ration.mayutic.com/mcp",
        "--header",
        "Authorization:${RATION_AUTH_HEADER}"
      ],
      "env": {
        "RATION_AUTH_HEADER": "Bearer <your-mcp-scoped-key>"
      }
    }
  }
}

Replace <your-mcp-scoped-key> with your key. RATION_AUTH_HEADER must include the Bearer prefix.

MCP tools

Tools are grouped by domain. Scope requirements and parameters are defined in the MCP server card. MCP calls do not consume AI credits; rate limits apply instead.

Inventory

search_ingredients, list_inventory, get_cargo_item, add_cargo_item, update_cargo_item, search_foods, set_nutrition_match, list_nutrition_matches, clear_nutrition_match, adjust_cargo_item, remove_cargo_item, get_expiring_items, get_expired_items, get_kitchen_summary, get_kitchen_events, get_kitchen_stats, preview_inventory_import, apply_inventory_import, preview_inventory_remove, apply_inventory_remove, import_inventory_csv

Meals

list_meals, get_meal, match_meals, create_meal, update_meal, delete_meal, set_active_meals, clear_active_meals, consume_meal

Planning

get_meal_plan, propose_manifest_plan, commit_manifest_plan, add_meal_plan_entry, update_meal_plan_entry, cook_manifest_entries, consume_manifest_entries, remove_meal_plan_entry

Supply

get_supply_list, list_supply_lists, create_supply_list, duplicate_supply_list, archive_supply_list, transfer_supply_items, manage_supply_staples, save_receipt_as_supply_list, add_supply_item, update_supply_item, remove_supply_item, mark_supply_purchased_bulk, sync_supply_from_selected_meals, complete_supply_list

Account

get_context, get_billing_summary, get_user_preferences, update_user_preferences

Nutrition

get_nutrition_summary, list_nutrition_intakes, set_nutrition_goal, clear_nutrition_goal, log_manifest_intake, clear_manifest_intake, quick_eat_cargo

Daily Fuel

log_diary_food, update_diary_food, void_diary_food, set_diary_layout, save_diary_food_to_kitchen, quote_food_log, propose_food_log, lookup_food_barcode, list_saved_foods, save_food, delete_saved_food

Apple Health

get_health_export_status, set_health_export, get_health_export_preview, clear_health_export

Rate limits: read tools mcp_list (30/min), search mcp_search (20/min), write mcp_write (15/min), supply sync mcp_supply_sync (8/min).

Discovery