restrackit-pantry-mcp
OfficialIntegrates with Keycloak for OAuth authentication and RFC 8693 token exchange, validating tenant tokens and exchanging them for scoped restrackit-backend tokens per request.
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.
restrackit-pantry-mcp
A remote MCP server that turns a snapshot of a grocery receipt into an up-to-date household pantry. Talk to Claude, snap a photo of your receipt or just say what you bought or used, and it tracks quantities on your behalf — no barcode scanning, no manual data entry, no rigid expiry-date bookkeeping.
Built on top of restrackit-core, restrackit's own inventory-traceability backend, reused here purely through its public REST API — this project ships no changes to that codebase.
How it works
Claude is multimodal, so it reads the receipt photo itself: no OCR pipeline
to build or maintain. For every line item it estimates a plausible expiry
date and storage location — dispensa (pantry), frigo (fridge), or
congelatore (freezer); other values are accepted but get a generic
fallback shelf life instead of a tuned one — from general knowledge, then
calls this server to persist it.
restrackit-pantry-mcp is a thin, fully stateless translation layer — it
holds no database of its own and defers every fact about inventory to
restrackit-core.
Claude (Desktop/mobile)
│ reads the receipt photo / listens to a spoken update
│ estimates category + plausible expiry date per item
▼
restrackit-pantry-mcp (AWS Lambda + API Gateway, MCP Streamable HTTP)
│ translates tool calls into authenticated REST requests
▼
restrackit-core REST APIRelated MCP server: Shelf Life MCP
Tools exposed
Tool | Purpose |
| Record a purchase — creates the product/category/storage method if missing, one batch per unit |
| Return how much of each product is currently on hand |
| Close out units of a product you've used up (oldest first) |
There's no dedicated "shopping list" tool — ask Claude what you're low on
and it reasons over get_pantry_status in the conversation.
Multi-tenancy
A single deployment of this server can serve any number of independent restrackit-core stores, each isolated from the others: one Lambda, one API Gateway endpoint, no per-store infrastructure to provision, and no tenant registry of any kind. Each tenant authenticates with their own Keycloak account (created by restrackit-core's onboarding flow) via the OAuth login flow described below — pantry-mcp holds no shared credential that can address every store, so a routing bug here can misdirect a request to the wrong store, but it can never authenticate as a different tenant's account.
Isolation is enforced per request, from the user's own access token:
pantry-mcp validates the token Claude sends (issued by Keycloak to
pantry-mcp-connectorfor that specific user) and reads thestore_idclaim from it (pantry_mcp/jwks.py,_extract_store_idinpantry_mcp/server.py);it then exchanges that token server-side, via RFC 8693 Standard Token Exchange, for one scoped to
restrackit-backend(pantry_mcp/auth.py,TokenExchanger) and forwards it withX-Target-Store: <store_id>on every restrackit-core call.
There is no DynamoDB table, no per-tenant Secrets Manager credential, and no
add_tenant.py-style provisioning script — the only shared secret is the
token-exchange client's own credential (see "Deployment" below).
One-time setup (per tenant)
Tenants onboard via OAuth token exchange: a tenant logs in for the first time through the "Sign in now" button in the custom connector registered in Claude (Desktop/mobile). No manual provisioning steps required.
Ensure restrackit-core has a store created for this tenant (requires an
ADMIN_ALLaccount). Once the store exists, the tenant is ready to authenticate via the connector.Tenant registers the custom connector in Claude:
Copy the
ApiUrlfrom the CDK deployment output (its/mcppath is the MCP endpoint).In Claude (Desktop/mobile), add the connector as a Custom Connector, pointing at
<ApiUrl>/mcp.On first use, click "Sign in now". Claude discovers Keycloak automatically via
GET /.well-known/oauth-protected-resource, so no redirect URI entry is needed on the tenant's side. In the connector's Advanced settings, set OAuth Client ID topantry-mcp-connector(no client secret) — without it Claude falls back to Dynamic Client Registration, which either fails or creates a client missing thestore_id/audience mappers this flow requires.The token is exchanged server-side; no manual token provisioning is required.
Deployment
Infrastructure is defined as AWS CDK (Python) under infra/:
cd infra
uv venv .venv && source .venv/bin/activate
uv pip install --python .venv -r requirements.txt
cdk deploy \
--parameters KeycloakUrl=... \
--parameters KeycloakRealm=... \
--parameters KeycloakConnectorClientId=... \
--parameters KeycloakExchangeClientId=... \
--parameters RestrackitBackendClientId=... \
--parameters RestrackitBaseUrl=... \
--parameters McpPublicBaseUrl=... # the ApiUrl output, no trailing slashTake the ApiUrl output for tenants' connector URLs, and pass it back in as
McpPublicBaseUrl (it is only known after the first deploy — redeploy once
with it set).
Before the first deploy, create the token-exchange client secret manually, once:
aws secretsmanager create-secret \
--name pantry-mcp/token-exchange-client \
--secret-string '<the secret configured on Keycloak's pantry-mcp-token-exchange client>'This value must be identical to the secret configured for the
pantry-mcp-token-exchange client on the Keycloak side (provisioned from
restrackit-core's scripts/provision_keycloak_realm.sh). Nothing keeps the
two in sync automatically — rotating one without the other breaks every
token exchange with invalid_client.
Development
uv sync --extra dev
uv run pytestThis server cannot be deployed
Maintenance
Related MCP Connectors
Your kitchen in chat: pantry stock, shopping lists, recipes and scanned grocery receipts.
AI-powered kitchen management — pantry, recipes, meal plans, shopping lists
Household-aware cooking brain: pantry, meal suggestions, dietary safety, recipes, shopping lists.
AI meal plans that fill your Kroger/Instacart cart - pantry-aware lists, all from chat.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered household management including inventory tracking, restock predictions, meal planning from available ingredients, and baby supply monitoring through natural language commands.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables tracking household food inventory and expiration dates, listing items by status, consuming items, and getting recipe suggestions to use up soon-to-expire ingredients.MIT

Pantry Buddy MCPofficial
FlicenseNot gradedqualityCmaintenanceEnables managing a personal pantry, shopping lists, cookbook recipes, and saved receipts remotely through MCP tools using natural language or API calls.-- FlicenseNot gradedqualityBmaintenanceEnables autonomous tracking of household food consumption and expiration, applying dietary filters such as organic, gluten-free, and low-sugar to generate optimized grocery replenishment baskets within a specified budget.7-