Skip to main content
Glama

Why this one works when pantry apps don't

Every fridge-tracking app dies the same way: it treats your kitchen as facts you have to keep correct, and keeping them correct is endless work.

HomeStock never asks you to inventory anything. It treats your kitchen as a probable estimate derived from what you actually bought — "you buy milk every 5 days, you bought some 6 days ago, you're probably out" — and shows its reasoning on every line, so you can tell at a glance whether to trust it. When it's wrong, one click fixes it, and the correction outranks the guess.

The insight the whole thing rests on: you never tell anyone how much milk you drink, but how often you rebuy it says exactly that.

Related MCP server: work-assistant

Install

The Mac app

The pantry window

The same view in a browser. The Mac app puts this in a real window with a sidebar, a chat that can read your kitchen, and drag-and-drop for receipts.

Download the latest HomeStock.dmg from the Releases page, open it and drag HomeStock into Applications. It carries its own Python, so there is nothing else to install.

First launch, once. HomeStock is a free indie app and isn't notarised by Apple, so Gatekeeper blocks the first open. Right-click HomeStock → Open → Open again. A plain double-click won't offer the Open button. Still blocked? System Settings → Privacy & Security → Open Anyway. You only do this once.

The MCP server, from source

For agents, or if you'd rather run the engine yourself.

You need: a Mac or Linux machine, Python 3.11 or newer, and a terminal. Windows isn't supported yet (why).

The easy way is with uv, a fast Python installer. If you don't have it:

curl -LsSf https://astral.sh/uv/install.sh | sh

Then:

git clone https://github.com/Thomaspeel6/HomeStock && cd HomeStock
uv run pytest -q          # 81 tests — confirms it works on your machine
uv run homestock-ui       # opens your kitchen at http://127.0.0.1:7777
git clone https://github.com/Thomaspeel6/HomeStock && cd HomeStock
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
homestock-ui             # the pantry window
homestock                # the MCP server (stdio)

Your database is ./homestock.db, or wherever you point $HOMESTOCK_DB. Photographed receipts go in a captures/ folder beside it. Both are yours — copy them to back up, delete them to erase everything.

See it working before you commit to anything

uv run python scripts/demo.py --serve

That invents a household with six months of shopping and opens the window on it, so you can see what a full kitchen looks like. It touches no email, and throws the demo database away afterwards.

Connect it to your AI

HomeStock is also an MCP server, so an AI client can read and write the same file: "what can I make for dinner with what I've got?" "here's a receipt." "we're out of milk." This is where the ceiling is much higher than any UI.

Claude Code — nothing to do. .mcp.json in this repo registers it when you run Claude Code from this directory.

Claude Desktop — add this to claude_desktop_config.json (on macOS: ~/Library/Application Support/Claude/), then restart it:

{
  "mcpServers": {
    "homestock": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/HomeStock", "homestock"]
    }
  }
}

Anything else that speaks MCP — point it at uv run homestock (or just homestock if you installed with pip), talking stdio.

Connect it and the server hands over everything needed to run ingestion: the onboarding and ingestion prompts, and the retailer recipes as resources. No filesystem access required.

First run

Ask your agent to follow the onboarding prompt. It will:

  1. Tell you exactly what it's about to look at, and wait for a clear yes. Declining is fine — the manual paths all still work.

  2. Read up to six months of receipt emails from retailers you approve, read-only.

  3. Show you your kitchen, plus a few true things about your own shopping you probably didn't know.

If you'd rather not connect email at all, skip to Getting things in — photographing receipts and typing work on their own.

Getting things in

Receipt emails only ever see online and delivery orders. Buy milk in a corner shop and a system watching only your inbox will confidently tell you to buy more — so there are four doors, not one:

How

Receipt emails

Read-only, sender-filtered, from shops you approve.

Photograph a paper receipt

Point your phone at it. Covers shopping in an actual shop.

Scan a barcode

Phone camera, or type the number.

Just type it

"2 milk, bread, 6 eggs" — always available, works offline.

Everything lands in an inbox rather than going straight into your kitchen. Capturing has to work instantly, one-handed, in a shop; reading needs a model. Keeping them apart is what lets a phone contribute to a database it can't reason about — and means an unreadable photo gets honestly skipped instead of guessed at.

Capturing from your phone

uv run homestock-ui --lan

Your laptop prints a six-digit code and an address. On your phone, on the same wifi, open the address and enter the code. Photos go straight to your laptop and never touch the internet.

LAN mode is off by default and stays off unless you ask for it — binding to the network on a café wifi would hand a stranger your shopping history. While it's on, nothing is readable until a device has paired, codes expire after ten minutes, and five wrong guesses burn the code. It is plain HTTP, so don't use it on shared or workplace networks; see SECURITY.md for the full threat model, stated plainly.

Cooking

"can I make carbonara?"     -> check_recipe([...])   what you have, what's missing
"made it, used the butter"  -> consume_items([...])  deducts, and puts butter on the list

Cooking is the biggest real depletion event in a kitchen, and until now nothing modelled it — stock only ever drained by inference. Your agent turns a recipe (pasted, a link, a photo of a cookbook page) into an ingredient list; HomeStock does the set maths against what you actually have, because that's the part that has to be exactly right.

Privacy

  • What HomeStock can see: receipt emails from shops you approve — read-only, sender-filtered. Nothing else, ever.

  • Where your data lives: homestock.db and captures/ on your computer.

  • What leaves your machine: nothing. No telemetry, no accounts, no cloud, no webfonts, no CDN assets. The server and the window make no outbound requests at all.

  • When something's wrong: get_health() reports counts and dates only — never item names, never email content — so it's safe to paste into an issue.

This isn't a policy promise. There is no server to send anything to. The one place your data does travel is your AI client: when an agent reads your stock to answer a question, that conversation goes wherever that client sends it, under its own privacy policy. HomeStock can't change that and doesn't pretend to.

What's not built yet

Being straight with you, because the gap between the idea and the code is where open-source projects usually mislead people:

  • No double-click app. A macOS .app is specified in PRD-HomeStock-v3.md but not built. Today this needs a terminal.

  • Email ingestion is agent-driven, not built-in. There's no OAuth flow yet; an agent reads your mail by following the ingestion prompt. Built-in fetching is the next big piece.

  • Not on PyPI yet, so installation means cloning.

  • The Amazon recipe is unverified. Amazon appears to have stripped itemised details from most confirmation emails around 2023. If that holds, Amazon coverage is close to zero and this is a Tesco-only tool for now. If you have Amazon GB receipts, telling us what's in them is genuinely the most useful thing you could do.

  • Windows, multi-home sync, and a recipe suggester are all deliberately out of scope for now. See TODOS.md for what's deferred and why.

Status: alpha, macOS-first, built for the author's own household first. If it isn't useful to one person for a month, nothing else matters.

Tools, prompts and resources

For agents, and for anyone reading the code. Nineteen tools over an append-only event log — every estimate is recomputable from get_events().

Four input paths mean four names for the same milk: a barcode says Tesco British Semi Skimmed Milk 2.27L, a receipt line says TESCO SEMI SKMD MILK, you say milk. Aliases are where the model's answer to that gets remembered, so the same string never has to be resolved twice — and so those don't become three items with three wrong repurchase cycles.

Tool

Purpose

add_items(items[], source, source_ref, purchased_at?, location?)

Record a purchase from any door: email, photo, barcode, loyalty, manual. Idempotent per (source_ref, line_no).

get_stock(item?)

No arg: known items. With arg: estimate, confidence, and raw provenance.

what_should_i_order()

The shopping list: items past their usual cycle, plus anything you said you were out of.

get_expiring_soon(within_days)

Perishables at or near their use-by.

correct_stock(item, quantity, unit?)

Ground truth. 0 means "we're out". Outranks the estimate and resets its clock.

discard_item(item, quantity?, unit?)

Record waste — and the signal that a shelf-life estimate was too generous.

set_shelf_life(item, days, storage?)

How long something keeps, so it can be flagged before it rots.

check_recipe(ingredients[])

Can I cook this? Sorts ingredients into have / low / missing.

consume_items(items[])

Record cooking. finished: true for anything you used the last of.

add_capture(kind, text?, path?, device?)

Put a photo, barcode or note in the inbox to be read later.

list_captures(status?) / resolve_capture(id, status?, note?)

Work the inbox. Never guess at a blurry receipt — skip it with a reason.

add_alias(alias, item) / list_aliases(item?)

Teach it that "TESCO SEMI SKMD MILK" is the milk it already knows.

merge_items(from_item, into_item)

Fix name drift without losing history — and learns the alias, so it can't recur.

void_event(source_ref, line_no?)

Fix a receipt: void, then re-insert the corrected line.

get_events(item?, since?, limit?, offset?)

Raw event log, paged — every estimate is explainable.

record_ingest_run(...)

Ingestion heartbeat + backfill cursor.

get_health()

Diagnostics. Is ingestion actually running?

Prompts: onboarding (consent, backfill, the reveal) and ingestion (the scheduled procedure, and the rules that stop it guessing).

Resources: homestock://recipes lists the retailers it can read; homestock://recipes/{retailer} returns one.

Contributing

The most useful contribution is a retailer recipe — coverage for a shop we can't read yet. A recipe is a small YAML file describing which email carries the real line items. Data, never code. No parsers.

Start at CONTRIBUTING.md, or just open an issue with a redacted sample and someone else can write the recipe.

This corpus — a map of which email from which retailer tells the truth — is the part that compounds, and no one else is building it.

Project docs

PRD-HomeStock-v3.md

What it is and where it's going

PRD-HomeStock-v2.md

The engine's design rationale

TODOS.md

Deferred work, with the reasoning

CHANGELOG.md

What changed, and when

SECURITY.md

Threat model and how to report a problem

CONTRIBUTING.md

Dev setup and house rules

Source-available under the Functional Source License (FSL-1.1-MIT).

Read it, run it, change it, self-host it, contribute to it — all fine. The one thing you may not do is ship a commercial product that competes with it. Two years after each release, that release becomes plain MIT automatically, so nothing here is locked away forever.

Available Tools

19 tools
add_aliasB

Teach HomeStock that a raw string means an item it already knows.

Four input paths produce four vocabularies for one thing: a barcode gives "tesco british semi skimmed milk 2.27l", a receipt line gives "tesco semi skmd milk", a person types "milk". Without this they become three items with three wrong repurchase cycles. Resolve a name once and record it here rather than resolving it on every ingest.

Inputs: item (required), alias (required).

add_captureA

Put something in the inbox to be read later: a photographed paper receipt, a scanned barcode, or a typed note ("2 milk, bread, 6 eggs").

Capture and reading are deliberately separate. Capturing must work instantly, offline, one-handed, in a shop — reading needs a model. This is how a phone can contribute to a database it cannot reason about.

Photos are stored as files (see path); the row records where. Nothing here is stock yet: an agent calls list_captures(), reads it, calls add_items(), then resolve_capture().

Inputs: kind (required), mime, path, text, +1 more.

add_itemsA

Record a purchase (one receipt). Idempotent per (source_ref, line_no).

Each item: {name, quantity, unit, price?, category?, line_no}.

source, and whether purchased_at is required: 'email' a receipt email — REQUIRED, the receipt carries a date 'photo' a photographed receipt — REQUIRED, the paper carries a date 'loyalty' a Clubcard/Nectar export — REQUIRED, the export carries a date 'barcode' scanned in the shop — optional, defaults to today 'manual' typed by the user — optional, defaults to today Only the two "happening right now" doors may default. Dating an old paper receipt or a three-year loyalty export as today would silently corrupt the repurchase intervals that every estimate is derived from.

source_ref: retailer ORDER ID where extractable, else email Message-ID; manual fallback 'manual:::' (+':2' suffix on collision — a nonzero 'ignored' count on a fresh receipt signals one). Call get_stock() first and reuse existing item names exactly. Returns {inserted, ignored, rejected: [{line_no, reason}]}.

Inputs: items (required), source (required), source_ref (required), location, +1 more.

check_recipeA

Can I cook this? Sorts a recipe's ingredients into what you have, what is running low, and what you would need to buy.

The model turns a recipe — pasted text, a URL, a photo of a cookbook — into this list of ingredient names. The server only does the set maths against stock, because that is the part that must be exactly right.

Inputs: ingredients (required).

consume_itemsA

Record cooking. Each item: {name, quantity?, unit?, finished?}.

Cooking is the largest real depletion event in a kitchen and nothing else models it — without this, stock only ever drains by inference. Set finished: true for anything you used the last of; that also records a correction to zero, which is what actually moves it onto the shopping list. Unknown items are reported, not invented.

Inputs: items (required).

correct_stockA

Ground truth from the user: what they can actually see. quantity=0 means "we're out". A correction outranks the interval model and resets the estimate's clock, so this is the one call that makes an estimate right rather than merely plausible.

Use it whenever the user volunteers stock in conversation ("we're out of milk", "still got two bags of rice"). The item must already be known — stock is inferred from purchases, so record the receipt first.

Inputs: item (required), quantity (required), unit.

discard_itemA

Record waste — food thrown away. Two uses: it removes the item from stock, and it is the only signal that a shelf-life estimate was too generous. Distinct from correct_stock, which says what is left.

Inputs: item (required), unit, quantity.

get_eventsA

Read-only raw event access (explainability: every estimate is recomputable from these rows). Includes voided rows, flagged.

Oldest first. Scope with item and since (ISO-8601 UTC, YYYY-MM-DD) rather than paging the whole log: a few years of receipts is well over a hundred thousand rows, which no context window will hold.

limit: 1..1000, default 200. offset: page forward from there. Returns {events: [...], returned, offset, total, has_more}.

Inputs: item, limit, since, offset.

get_expiring_soonB

Perishables at or past their estimated use-by, soonest first. Only items with a shelf life set and at least one purchase.

Two exclusions keep this list honest rather than merely long: items the user has confirmed are gone (they cannot spoil), and items expired for longer than their own shelf life again — a chicken ten days past a three-day use-by was eaten or binned a week ago, and nagging about it is how a list stops being read.

Inputs: within_days. Returns: result

get_healthA

Diagnostics: is HomeStock actually working? Counts and timestamps only — never item names, never email content — so the output is safe to paste into a bug report.

stale is the one that matters. Ingestion failing silently (expired mail auth, a retailer changing template) looks exactly like a quiet week, and the product's whole claim is that its answers can be trusted.

Inputs: no named parameters.

get_stockA

Current stock estimate. No argument: list all known items as {name, category} — call this before add_items to reuse exact names. With an item name: naive-baseline estimate with raw provenance (estimated_state is 'unknown' below 2 distinct purchase dates).

Inputs: item. Returns: result

list_aliasesA

Every learned name mapping, or just one item's. Useful for spotting canonicalisation going wrong before it poisons the estimates.

Inputs: item. Returns: result

list_capturesA

The inbox: things captured from any device and not yet turned into items. Read each one, call add_items() with what it contains, then resolve_capture(). Pass status='done' or 'skipped' to review history.

Inputs: status. Returns: result

merge_itemsA

Fix name drift: fold every event on from_item into into_item and delete the duplicate. Canonicalisation is the agent's job, so duplicates ("milk" vs "semi-skimmed milk") are a matter of when, not if — without this the only remedy is hand-editing SQLite.

Merging is irreversible in one step but loses nothing: the events survive under the surviving name, and get_events() still shows them.

Inputs: from_item (required), into_item (required).

record_ingest_runA

Ingestion agent plumbing: record a run (heartbeat + audit) after every ingestion pass, even one that wrote nothing. skipped: [{source_ref, reason}] for receipts/lines the agent could not parse (never guess — skip and log). Returns the backfill cursor: earliest_window_start already covered.

Inputs: window_end (required), emails_seen (required), window_start (required), events_written (required), +1 more.

resolve_captureA

Close a capture once its contents are recorded — or mark it 'skipped' with a note when it cannot be read. Never guess at a blurry receipt; an unreadable capture that is honestly skipped is recoverable, a fabricated one is not.

Inputs: capture_id (required), note, status.

set_shelf_lifeA

Teach HomeStock how long an item keeps, so it can be flagged before it rots. The agent supplies a sensible default on first purchase (fresh chicken ~3 days, milk ~7); the user overrides it. storage is one of pantry/fridge/freezer and is advisory — it explains the number.

Inputs: days (required), item (required), storage.

void_eventA

Correction path: void matching event lines (all lines of the receipt if line_no omitted). Voided rows are excluded from every estimate; re-inserting a corrected line for the same (source_ref, line_no) then works. Returns {voided: n}; zero matches is a no-op, not an error.

Inputs: source_ref (required), line_no.

what_should_i_orderA

The shopping list. Two ways onto it:

  • The user said they were out (correct_stock(item, 0)) — ranked first, because an observation beats an estimate.

  • Inference: >= 3 distinct purchase dates, past the median repurchase interval, excluding items past 3x median (presumed discontinued).

Sorted by overshoot ratio, highest first.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 19 tools

    Disambiguation4/5

    Most tools target clearly distinct resources and actions (purchase, cook, waste, manual correction are four separate inventory movements, each described against the others). The closest pairs are correct_stock vs consume_items(finished:true) and merge_items vs add_alias, but the descriptions explicitly delineate those boundaries, leaving little genuine misselection risk.

    Naming Consistency4/5

    Nearly all tools follow a verb_noun pattern (add_items, get_stock, correct_stock, discard_item, resolve_capture, check_recipe). The lone outlier is the question-form what_should_i_order, and noun number is mixed (add_items vs discard_item), but the convention is overwhelmingly readable and predictable.

    Tool Count4/5

    At 19 tools this sits at the heavy end, but the domain genuinely spans purchases, stock, expiry, captures, aliases, recipes, diagnostics, and ingestion plumbing, so nearly every tool covers a distinct lifecycle stage. A few could arguably be folded (list_aliases, get_health) but none feel redundant filler.

    Completeness4/5

    Coverage is broad: ingest, correct, void, merge, consume, discard, alias, capture, expiry, recipe, and diagnostics form a near-complete lifecycle with explicit correction paths. The main gap is no way to delete/forget an item entirely from the catalog (merge only folds duplicates), and no direct edit of past purchase lines beyond void+re-add.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to search and read a local, provider-independent email archive, reconstruct contacts and interactions, and prepare draft responses without sending anything.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables users to turn grocery receipt photos or spoken updates into an up-to-date home pantry, tracking purchases, current stock, and consumption through natural language.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to manage inventory conversationally: list and look up products, check current stock levels, record inbound and outbound movements idempotently, review movement history, and surface items below their minimum threshold. Every figure is grounded in tool calls rather than model estimation, and invalid operations return explicit error codes the agent can reason about.
      5
      MIT