Connecting to MCP

Recommended: OAuth 2.1 (standard clients)

Ration is AI-agent-ready out of the box. No API key required for Cursor, Claude Desktop, ChatGPT desktop, or other clients that support OAuth discovery.

Steps

  1. In your MCP client, add server URL https://mcp.ration.mayutic.com/mcp.
  2. When prompted, sign in to Ration in your browser.
  3. Select the household (organization) this agent may access.
  4. Review and approve permissions: read is pre-selected; optionally enable write scopes (mcp:inventory:write, mcp:galley:write, etc.).
  5. Manage or revoke the grant anytime in Hub → Settings → Developer → MCP.

Cursor

Open MCP settings → add a remote server → paste https://mcp.ration.mayutic.com/mcp. Your browser opens for OAuth automatically. After authorization, Ration tools (e.g. list_inventory, match_meals) appear in the agent tool list.

Claude Desktop / Claude Code

Add the same MCP URL in your Claude MCP configuration. On first connect, complete browser sign-in and consent. To verify, ask: "List my Ration pantry."

Client ID Metadata Documents (VS Code, Claude Code)

Since v1.13.4 Ration also accepts clients that identify themselves with an https URL instead of registering (OAuth Client ID Metadata Documents). Ration fetches that small JSON document, checks it and shows Published by <host> on the consent screen, for example vscode.dev. Nothing changes for you: add the same MCP URL. Clients that register themselves (Cursor, Gemini CLI, Warp) keep working exactly as before, and existing connections never need a new sign-in.

Common OAuth failures

SymptomCheck
Browser shows "No authorization code received"MCP client callback opened without ?code= — usually Deny clicked (since v1.13.5 Deny returns to the client with error=access_denied, as OAuth requires), expired flow (~10 min), or stale browser tab. Remove MCP server in Cursor, re-add URL, complete sign-in → household → Authorize in one fresh tab. Prefer native URL config (url only) over mcp-remote in Cursor.
Authorize does nothing; console form-action 'self' on /oauth/consentCSP blocks redirect to http://localhost:PORT/callback (mcp-remote). Deploy >= v1.5.14 (routes via /oauth/return). Since v1.13.4 the consent page sends Authorize/Deny with JavaScript, so https callbacks (Claude, ChatGPT) work too. Do not change CSP manually.
Consent page shows "Your browser blocked this request"Since v1.13.4 Authorize/Deny are sent with JavaScript, and Ration refuses an approval that does not come from its own page. A privacy extension or proxy that removes the browser's Origin header, or an approval opened in a different tab or window, causes this. Click Authorize again in the same tab; if it repeats, disable privacy extensions for the Ration consent page. If it keeps happening, email support@mayutic.com.
Consent page shows "Couldn't reach Ration"The approval never reached Ration (offline, VPN or DNS trouble, or an extension cancelled the request). Check your connection and click Authorize again, or email support@mayutic.com.
Consent page shows "Something went wrong approving this connection"The approval was refused or expired (about 10 minutes). Click Authorize again; if it repeats, restart the connection from your AI client, or email support@mayutic.com.
Consent page says "Approving a connection needs JavaScript"JavaScript is off for the page, so the buttons cannot send the approval. Turn on JavaScript for ration.mayutic.com and reload, or email support@mayutic.com.
Browser opens but consent failsAuthorization window ~10 minutes — revoke grant, remove MCP server in client, re-add URL, complete sign-in → household → authorize in one tab
Agent listed in Settings but tools failIncomplete grant (household not linked) — revoke and reconnect; you must pass Select household before consent
Wrong pantry dataRevoke and reconnect; pick the correct household at selection
Client reconnect loopClient must support OAuth 2.1 / protected-resource discovery; restart connection from client (not an old browser tab)
Unable to complete authorization after household pickUsually a stale OAuth tab or pre-1.6.10 consent loop — revoke grant, remove MCP server, reconnect in one fresh tab
Consent screen says Unverified appExpected 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>Since v1.13.4 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 stoppedThe 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_uriThe error_description says which rule failed. Since v1.13.3, 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. New Cursor and Warp registrations, refused since about 18 Oct 2026, work again from v1.13.3.
Sign-in fails with invalid_client and a client metadata document messageSince v1.13.4 a client may identify itself with an https URL (a client metadata document). The error_description says what failed: the document did not respond within 3 seconds, was not served as application/json, was larger than 5 KB, redirected, had a client_id that does not match its URL, or listed a redirect URI that is not allowed. Ration never follows redirects or fetches from IP addresses, local names or its own domains. A failure is remembered for 60 seconds, so wait a minute and try again; if it persists, update the client or contact its publisher. Clients that use dynamic registration (Cursor, Gemini CLI) are not affected.
Sign-in fails with temporarily_unavailable mentioning client metadata lookupsToo many metadata document lookups for one website or from one network in a minute. Wait a minute and connect again.
Client requests an unknown mcp:* scopeRemove and re-add the MCP server after deploy; public discovery advertises only currently supported scopes.

First-party Copilot

Ask Ration is first-party and does not use delegated MCP actor tokens. Native app and web copilot traffic authenticates as the signed-in user, then uses the same organization-scoped server logic as MCP tools.

Support can correlate OAuth failures via Worker logs: event=oauth_flow, fields step, outcome, error_code (no tokens or signed query payloads). Refused registrations log event=oauth_register_redirect_rejected with rule and redirectHost only. Client metadata document lookups log event=oauth_cimd_lookup with cache (hit, miss, stale, negative, refused), reason, httpStatus, durationMs and metadataHost, never the document. Every authorize request logs event=oauth_authorize_client with client_id_type (cimd or dcr).


Advanced: API key auth (manual setup)

Use organization API keys when OAuth is unavailable (CI pipelines, custom headers, legacy bridges).

API key format

Keys look like: rtn_live_ followed by 32 hexadecimal characters. Example shape: rtn_live_ + a1b2c3d4… (do not share real keys).

Create keys in Hub → Settings → API Keys with one or more mcp:* scopes (or legacy mcp).

Authorization header

Authorization: Bearer rtn_live_<your-full-key>

Include the word Bearer and a space before the key.

Cursor (API key)

{
  "mcpServers": {
    "ration": {
      "url": "https://mcp.ration.mayutic.com/mcp",
      "headers": {
        "Authorization": "Bearer rtn_live_<your-key>"
      }
    }
  }
}

mcp-remote bridge

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

Common API key failures

SymptomCheck
Connection closed / ServerErrorAuthorization is exactly Bearer + full key
401 / forbiddenKey has mcp or mcp:* scope; key not revoked
Wrong pantryKey is tied to a different organization than you expect

Discovery: what the agent sees

Successful MCP responses include an RFC 8288 Link header with relations including:

  • api-catalog → /.well-known/api-catalog
  • service-doc → /docs/api
  • mcp-server-card → /.well-known/mcp/server-card.json (transport auth: oauth2)
  • agent-skills → /.well-known/agent-skills/index.json
  • agent-auth → /auth.md (markdown agent registration discovery)

OAuth metadata:

  • /.well-known/oauth-authorization-server — authorization server (app domain); includes merged agent_auth block (skill, register_uri, claim_uri, identity_types_supported, anonymous.credential_types_supported)
  • /.well-known/oauth-protected-resource — MCP resource metadata (MCP host); app-domain PRM links agent_auth → /auth.md

Agent self-registration (no human signup):

  • POST /api/agent/auth — { "type": "anonymous" } → pre-claim API key (full MCP write scopes) + claim URL
  • POST /api/agent/auth/claim + /claim/complete — OTP email claim (Tier 1)
  • Full flow documented at /auth.md

DNS-AID (optional bootstrap): _mcp._agents.ration.mayutic.com HTTPS record points to mcp.ration.mayutic.com (DNSSEC-signed mayutic.com zone). HTTP Link headers remain the primary discovery path.

MCP resources:

  • ration://units, ration://domains, ration://schemas/inventory-import, ration://capabilities
  • ration://guides/connect — connection guide (OAuth-first)

MCP prompts: parse_receipt, plan_week

Rotation

OAuth: Revoke the grant in Hub → Settings → Developer → MCP and reconnect.

API keys: Create a new key, update the client, delete the old key in Settings.