kitchen-inventory-mcp
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.
kitchen-inventory-mcp
An MCP server that gives Claude a memory of what's in the pantry, fridge and freezer. Add stock by pasting a grocery order or sending a photo, ask what's for dinner, and the server works out which recipes the kitchen can actually make. Log the meal and the ingredients come out of inventory. I built it because asking an assistant "what can I cook tonight?" is only useful if it knows what's really on hand, and keeping that list current by hand never lasts. Two adults use it at once from their own Claude clients (desktop and phone), and household preferences such as a child's dislikes feed into planning.
The design rule: the server keeps the books and the model does the thinking. The server never calls an LLM. Claude reads photos, invents recipes and reasons about substitutions. The server stores state and does the deterministic parts: fuzzy matching to canonical items, duplicate detection, recipe coverage scoring, and first-expiring-first-out depletion.
Architecture
flowchart LR
C1["Claude<br/>(member 1)"] -->|"MCP over HTTPS<br/>OAuth / bearer token"| T["Cloudflare Tunnel"]
C2["Claude<br/>(member 2)"] --> T
T --> S["kitchen-inventory-mcp<br/>FastMCP on a Raspberry Pi"]
S --> M["Matching<br/>rapidfuzz + aliases"]
S --> DB[("SQLite (WAL)<br/>SQLAlchemy + Alembic")]Related MCP server: Chef's Brain
Tools
Area | Tools |
Inventory |
|
Duplicates |
|
Planning |
|
Recipes and meals |
|
Preferences |
|
Example
Me: (pastes a grocery delivery confirmation) Add this order.
Claude (calls
add_inventory_itemswith anorder_dedup_keytaken from the order number): Added 14 items. "Roma tomatoes" matched your existing tomato item. "Everything bagel seasoning" is new, so I created it as a staple. Nothing was flagged as a duplicate.Me: What can we make tonight that uses the spinach before it goes off?
Claude (calls
get_planning_context, thenscore_recipe_coverageon two ideas): The spinach expires Thursday. A spinach and chickpea curry scores 100%: you have everything. A frittata only scores partial on eggs, because you don't have enough.Me: Curry it is. We made 4 servings.
Claude (calls
save_recipe, thenlog_meal): Logged. The spinach and one can of chickpeas came out of inventory, and the coconut milk is now marked open.
Requirements
Python 3.11+
sqlite3CLI (for backups)
Local setup
uv syncCopy the env template and fill in a real token:
cp .env.example .env
# generate a token:
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
# put it in .env as KITCHEN_MCP_TOKEN=...Apply migrations and seed the starter canonical-item list (~100 common items and aliases):
export KITCHEN_MCP_DB_PATH=~/kitchen-inventory-data/kitchen.db
uv run alembic upgrade head
uv run python scripts/seed_canonical_items.pyRun the server:
export KITCHEN_MCP_TOKEN=<your token>
uv run python -m kitchen_inventory_mcpIt listens on 127.0.0.1:8811 by default (KITCHEN_MCP_HOST /
KITCHEN_MCP_PORT to change), serving MCP over streamable HTTP at /mcp
and an unauthenticated GET /health (status + version only, no inventory
data -- used for Cloudflare Tunnel health checks).
Environment variables
Variable | Required | Default | Purpose |
| yes | none | Shared bearer token. Server refuses to start without it. Never commit this. |
| no |
| SQLite file path. |
| no |
| Auth-failure log (timestamp + source IP only, never the token). |
| no |
| Bind host (keep it local behind a tunnel). |
| no |
| Bind port. |
| no |
| Default cap on |
| no |
| Where |
| only for OAuth | none | The server's public HTTPS URL (e.g. |
.env.example documents these with empty values. .gitignore excludes
.env. Tokens are compared with hmac.compare_digest, never ==.
Connecting Claude
There are two ways to authenticate, depending on which Claude app you're using:
Local config with a custom header (Claude Desktop's mcpServers config,
or any MCP client that supports custom headers) -- works on any device that can run
a local process, since a small bridge (e.g. the mcp-remote npm package)
attaches the bearer token to the request itself:
{
"mcpServers": {
"kitchen-inventory": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://your-subdomain/mcp",
"--header", "Authorization:Bearer ${KITCHEN_MCP_TOKEN}"
],
"env": { "KITCHEN_MCP_TOKEN": "<your token>" }
}
}
}claude.ai's account-level custom connector (web, mobile, and Desktop's
GUI connector dialog) -- this flow is tied to your account rather than a
device, so it's the only way to reach the server from a phone. It's built
around OAuth, not a raw header field, which is what /oauth/* and
/.well-known/* exist for (see oauth.py's module docstring): a minimal
OAuth 2.1 + PKCE wrapper with no separate user/password system underneath
-- /oauth/authorize just checks the same KITCHEN_MCP_TOKEN and, on a
match, issues an access token to whichever client dynamically registered.
Deliberately out of scope: refresh tokens (access tokens expire after 30
days and the client just re-runs the authorize flow) and a full
consent/anti-phishing screen.
To use it: add a custom connector pointed at https://your-subdomain/mcp,
leave OAuth Client ID/Secret blank (dynamic registration handles this), and
when prompted, enter the same shared KITCHEN_MCP_TOKEN. Do this once per
device/account -- each household member's phone goes through the flow
independently, entering the same shared token. Requires
KITCHEN_MCP_PUBLIC_URL to be set on the server.
Raspberry Pi deployment
Copy the repo to the Pi (or
git clone),uv syncthere.Put the SQLite file on a USB SSD, not the SD card -- SD cards fail under sustained write load. Point
KITCHEN_MCP_DB_PATHat the mounted drive.Run the server under a process supervisor (systemd unit or similar) so it restarts on boot/crash.
python -m kitchen_inventory_mcpreads all config from the environment, so the unit file just needs the env vars above set.Cloudflare Tunnel: point a subdomain at
http://localhost:8811, with the tunnel's health check hitting/health(unauthenticated by design).Backup cron (nightly at 3:10am), using WAL-safe
sqlite3 .backup, keeping the last 14:10 3 * * * KITCHEN_MCP_DB_PATH=/path/to/kitchen.db /path/to/kitchen-inventory-mcp/scripts/backup.sh >> /path/to/kitchen-inventory-data/backup.log 2>&1Point a Claude client at the tunnel's MCP URL (
https://your-subdomain/mcp) with the bearer token configured as the connector's auth header.
Migrations
Alembic is set up from day one; the schema will change.
uv run alembic revision --autogenerate -m "description"
uv run alembic upgrade headtests/test_migrations.py runs a real alembic upgrade head against a
throwaway DB and diffs the result against the SQLAlchemy models, so
migrations can't silently drift from models.py the way they could if
tests only ever used Base.metadata.create_all.
Tests
uv run pytestCoverage focuses on the places bugs would be genuinely costly: depletion
math (FEFO across multiple pantry rows for the same canonical item,
fractional-scale rounding, staple transitions, the negative-quantity guard,
force=true clamping, undo_meal_log), matching bands (exact alias,
auto-alias >=90, ambiguous 75-89, no false-merge on genuinely different
items), duplicate resolution (soft-delete only -- item_history never
orphans -- plus whole-batch order-replay resolution), the migration/model
drift check, the /health auth bypass, the planning-context recipe cap,
and the full OAuth handshake (registration, wrong-token rejection, PKCE
verification, single-use codes, the issued access token working against
/mcp).
The item model
Two classes, set once on the canonical item (not per pantry row):
Countables (cans, jars, eggs, chicken breasts): integer count.
log_mealdecrements by whole container units, FEFO -- earliestexpiration_datefirst, nulls last, ties broken byadded_at. A single ingredient's decrement can span multiple pantry rows if the same canonical item is split across several purchases/expiration dates; each affected row gets its ownitem_historyentry.Staples (rice, flour, oil, salt, spices, milk, sugar): tracked by state (
full -> open -> low -> out), not count.log_mealonly ever movesfull -> open; only a human moves it further viaupdate_inventory_item. A staple atopenorlownever blocks a recipe from being suggested.
Duplicate detection (three independent mechanisms)
Within-batch collisions (two lines for the same purchase in one photo/paste): the calling client is expected to collapse these itself before calling
add_inventory_items-- see that tool's description. As a deterministic backstop, byte-identical lines (same name, quantity/ state, unit, container_size, location, expiration_date) that still slip through get silently summed into one row. Any difference in even one of those fields is treated as genuinely separate stock, no flag.Cross-call order replay (the same order pasted twice, possibly hours apart): pass a client-computed
order_dedup_key(prefer the order/confirmation number if visible, else a normalized-text hash) toadd_inventory_items. A repeat within 30 days flags the whole batchpossible_duplicate/order_replay. Resolve the entire batch in one call withresolve_order_batch(order_batch_id, action)--discardorkeep_separate-- instead of oneresolve_duplicatecall per row.Fuzzy name ambiguity (75-89
rapidfuzztoken-set score against existing aliases/canonical names) and physical-stock proximity (same canonical item, same location, same expiration/container metadata, added within 15 minutes) each independently flagpossible_duplicatewith areview_reasonofalias_confidenceorpossible_stock_duplicate. Resolve per-row withresolve_duplicate(pantry_item_id, action, target_item_id?)--merge/keep_separate/discard.
resolve_duplicate and resolve_order_batch never hard-delete: the
losing row is soft-deleted (removed_at set, quantity zeroed / state set
to out, superseded_by pointing at the row it merged into when
applicable) and a compensating item_history row is written, so
item_history.pantry_item_id never orphans.
Worked example, tool by tool: paste an order, cook, see inventory drop
Paste a grocery order. Claude reads the confirmation email/text you paste, extracts structured items, and calls
add_inventory_items(items=[...], actor="sam", source="order_import", confidence=1.0, order_dedup_key="<order id or a hash of the text>"). Items resolve against the seeded canonical items; anything ambiguous comes back flagged for review.Ask what's for dinner. Claude calls
get_planning_context()to see current inventory, what's expiring soon, household preferences, and recently-cooked meals, then invents a recipe idea and grades it withscore_recipe_coverage(ingredients=[...]).Tweak it, then
save_recipe(recipe={...}, ingredients=[...], actor="sam"). If you change your mind later,update_recipeedits it in place (renaming is just setting thenamefield);delete_recipearchives it without breaking pastmeal_loghistory.Rate it after eating:
rate_recipe(recipe_id, rater="alex", rating=5)and separatelyrate_recipe(recipe_id, rater="sam", rating=3)-- disagreement between the two of you is signal worth keeping.Log the meal:
log_meal(recipe_id, servings_made=6, cooked_by="sam"). If depletion would take anything negative, the whole call aborts with ashortfallslist and inventory is untouched; re-run withforce=trueto proceed anyway (clamped items are reported).Check inventory:
get_inventory()shows the countables decremented (oldest-expiring stock first) and any staple that was still sealed now atopen. Fat-fingeredservings_made?undo_meal_log(meal_log_id)reverses it exactly.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Household-aware cooking brain: pantry, meal suggestions, dietary safety, recipes, shopping lists.
Scraps Kitchen gives any AI agent a persistent, household-aware kitchen memory. Unlike generic chatbot recall, Scraps maintains structured cooking data: what's in your fridge (with freshness tracking), who you cook for (with allergens, dietary restrictions, and preferences), your recipe collection (with cook notes and per-diner ratings), your shopping list, and your kitchen equipment. 27 tools across 6 domains let agents read kitchen context, suggest meals that respect dietary safety, update the pantry after cooking, and build a history of what works for your household. Every interaction makes the data richer. Cooking history, preference signals, kitchen awareness = better suggestions next time. All tools work via oAuth and a free scraps.kitchen account.
AI-powered kitchen management — pantry, recipes, meal plans, shopping lists
Search structured recipes, scale servings, match pantry ingredients, and build shopping lists.
Related MCP Servers
AlicenseAqualityBmaintenanceManage your Pantrist pantry, shopping list, recipes, and weekly meal plan from Claude. The server wraps the same public REST API that powers the iOS, Android, and web apps, so your changes show up in real time on every device. * "What's on my shopping list?" * "Add milk, eggs, and that brand of olive oil I had last week" * "What's expiring in the next three days?"142MIT- FlicenseNot gradedqualityDmaintenanceA smart pantry MCP server that gives Claude live access to your pantry ingredients, enabling ingredient tracking, recipe suggestions, and expiry management through natural language.-
- FlicenseNot gradedqualityBmaintenanceEnables MCP-compatible clients like ChatGPT and Claude to manage a household's shared food inventory, meal plans, recipes, and preferences through natural language, with atomic updates and audit logging.-
- AlicenseNot gradedqualityBmaintenanceEnables agents to manage household pantry inventory, dietary preferences, meal planning, product search, and shopping cart workflows over Streamable HTTP, with optional Bedrock-backed meal generation.MIT