Inspiration

Every week I would open my fridge, find spinach or yogurt that expired two days ago, and throw it out — then ask a voice assistant what to make for dinner and get a generic recipe that ignored everything I actually owned. The assistant wasn't dumb; it was blind. It had no way to know my kitchen. When Amazon opened Alexa+ to MCP servers, that blindness became fixable: I could give Alexa+ real tools over my own data. PantryPilot is that fix — an assistant that doesn't just answer, it knows what's in your fridge.

What it does

PantryPilot is a self-hosted MCP server (spec 2025-11-25, Streamable HTTP) exposing nine kitchen tools to Alexa+: get_inventory, check_expiry, suggest_recipe, add_to_grocery_list, get_grocery_list, add_inventory_item, get_waste_report, get_meal_plan, and get_nutrition_summary. Ask "what's expiring soon?" and Alexa+ calls check_expiry on live household data. Ask "what should I cook tonight?" and it chains check_expiry → suggest_recipe, which ranks recipes by ingredient coverage plus a rescue score that grows as food nears expiry — so tonight's dinner is the one that saves the spinach, yogurt and chicken from the bin. Missing an ingredient? It lands on the grocery list with one more tool call. Ask for a plan and get_meal_plan sequences five dinners so the most urgent rescues happen first. Ask about money and get_waste_report prices the food at risk, scores your waste out of 100, and tracks the meals and dollars already rescued this month. Ask about health and get_nutrition_summary breaks down protein options and category balance. The simulator is a white-and-blue live dashboard — items tracked, at-risk value, waste score, monthly savings — all fed by the same MCP calls.

The included web app is a simulated Alexa+ experience: it performs a real MCP initialize handshake on load, and every answer is composed from actual JSON-RPC tool calls, with the MCP traffic shown in-chat. Nothing in the demo is hard-coded.

How I built it

  • A zero-required-dependency Node.js server implementing MCP over Streamable HTTP: initialize negotiation, ping, tools/list, tools/call, notifications, and spec-correct 405 handling for GET on a stateless server.
  • Server instructions in the initialize result steer the agent to check expiry before suggesting recipes — behaviour shaped at the protocol level, not the prompt level.
  • A rescue-ranking engine (lib/store.mjs) over a JSON household store, and a recipe library where each recipe declares which at-risk ingredients it rescues.
  • An optional Amazon Bedrock adapter (lib/bedrock.mjs): with BEDROCK_MODEL_ID + AWS credentials set, Amazon Bedrock (Converse API, official AWS SDK) pitches the top recipe pick; without them, the local engine answers alone, so the demo runs anywhere.
  • The simulator frontend is a genuine MCP client (fetch + JSON-RPC), which doubles as living documentation of the protocol.

Challenges I faced

  • Implementing Streamable HTTP correctly without an SDK crutch: session headers, notification handling (202, no body), and error codes all had to match the 2025-11-25 spec by hand.
  • Making recipe ranking feel smart rather than random: the breakthrough was scoring rescues by days-left, so urgency — not just ingredient overlap — drives the recommendation.
  • Keeping the demo honest: it was tempting to fake the chat answers. Instead the UI calls the real tools, which made the demo slower to build but actually proves the Alexa+ integration works.
  • Time: this was designed, built, tested and documented inside a single day.

What I learned

How MCP really works under the hood (not just through an SDK), how much agent behaviour you can shape with server instructions and tool descriptions alone, and a design principle I'll reuse everywhere: give the model tools over real data, and a narrow, well-described tool beats a clever prompt every time.

What's next

Barcode/receipt scanning to auto-log groceries, multi-household sharing, price-aware grocery lists, and deploying the server behind AgentCore Runtime for a production Alexa+ integration.

Built With

Share this project:

Updates

Submission history