Skip to main content
Glama
craftpip

Kitchen MCP

by craftpip
README.md
# 🍳 Kitchen MCP

Your digital kitchen, powered by AI. Track what you have, discover what you can cook, and get guided through every recipe β€” step by step, timer by timer.

Whether you're a home cook managing a busy kitchen or a developer building AI-powered cooking assistants, Kitchen MCP gives you the structured foundation to make it real.

---

## πŸ” What is this?

Kitchen MCP is a **local-first Model Context Protocol server** that connects an AI assistant to your kitchen. It knows your inventory, your recipes, your equipment, your restrictions, and your preferences β€” and it helps you cook better with all of it.

The AI never guesses. The server is always the source of truth.

---

## ✨ Features

| Feature | Status | Description |
|---------|--------|-------------|
| πŸ“¦ Inventory Management | βœ… | Track food by lot, location, expiry, and state (sealed, opened, cooked, frozen) |
| πŸ“– Recipe Engine | βœ… | Create, version, scale, and validate recipes with ingredients, steps, and equipment |
| 🎯 Smart Matching | βœ… | Find the best recipes based on what you have, your restrictions, and your taste |
| πŸ‘¨β€πŸ³ Cooking Sessions | βœ… | Start a session, follow guided steps, track ingredient usage, get help when things go wrong |
| ⏱️ Kitchen Timers | βœ… | Create, pause, resume, and extend timers tied to cooking steps |
| 🚫 Dietary Restrictions | βœ… | Set allergies, intolerances, religious and ethical restrictions; server blocks unsafe recipes |
| 🌢️ Taste Preferences | βœ… | Set spice heat, saltiness, sweetness on a 0-10 scale; recipes scored to match |
| 🍞 Equipment Catalog | βœ… | Register stoves, pressure cookers, mixers, refrigerators; server checks compatibility |
| βš–οΈ Unit Conversion | βœ… | Convert between grams, kilograms, milliliters, teaspoons, tablespoons, cups, and more |
| πŸ›’ Shopping Lists | πŸ”œ | Generate shopping needs from recipes and current inventory |
| πŸ“… Meal Planning | πŸ”œ | Plan meals for the week based on preferences, expiry, and inventory |
| ⏰ Expiry Tracking | πŸ”œ | Get notified before food goes bad, use expiring items first |

---

## πŸš€ Quick Start

### πŸ“‹ Prerequisites

- Node.js >= 20
- npm

### ⬇️ Install

```bash
git clone https://github.com/craftpip/kitchen-mcp.git
cd kitchen-mcp
npm install
```

### ▢️ Run (stdio)

```bash
npm start
```

### 🌐 Run (HTTP)

```bash
npm run dev -- --http
```

Server listens on `http://0.0.0.0:3100/mcp`.

### 🐳 Docker

```bash
docker compose build && docker compose up -d
```

Data persists in the `kitchen-mcp_kitchen-data` volume.

---

## πŸ€– Usage with AI Assistants

Add to your MCP client (like OpenCode, Claude Desktop, etc.):

```json
{
  "mcp": {
    "kitchen": {
      "type": "remote",
      "url": "http://localhost:3100/mcp"
    }
  }
}
```

Once connected, the AI can:

| | Ask | What happens |
|---|-----|--------------|
| πŸ—„οΈ | "What do I have?" | Checks inventory, shows what's in stock |
| 🍽️ | "What can I cook for lunch?" | Matches recipes to your inventory and preferences |
| πŸ‘¨β€πŸ³ | "Start cooking the egg curry" | Creates session, guides through each step |
| ⏱️ | "Set a 10-minute timer" | Creates kitchen timer, tracks it |
| πŸ“¦ | "Add 1kg of rice to the pantry" | Adds inventory lot with full tracking |
| 🚫 | "I'm allergic to peanuts" | Blocks all peanut-containing recipes |

---

## πŸ› οΈ 66 Tools

| Category | πŸ”§ | What it does |
|----------|-----|--------------|
| πŸ’š System | 2 | Health check, capabilities |
| πŸ—ΊοΈ Locations | 3 | Rooms, shelves, cabinets, drawers |
| πŸ₯• Ingredients | 4 | Catalog, aliases, search |
| πŸ“¦ Inventory | 7 | Lots, transactions, expiry tracking |
| 🍞 Equipment | 6 | Appliances, calibration, availability |
| βš–οΈ Measurements | 3 | Unit conversion, household containers |
| πŸ“– Recipes | 9 | CRUD, versioning, scaling, availability |
| 🚫 Restrictions | 3 | Allergies, intolerances, dietary rules |
| 🌢️ Preferences | 3 | Spice heat, saltiness, sweetness |
| 🎯 Matching | 1 | Recipe scoring engine |
| πŸ‘¨β€πŸ³ Sessions | 16 | Cooking lifecycle, step tracking |
| ⏱️ Timers | 9 | Kitchen timers with full control |

---

## πŸ—οΈ Architecture

Kitchen MCP follows a strict principle: **the server is the authority**.

- πŸ—„οΈ SQLite with WAL mode for reliability
- πŸ”’ All state changes go through structured tools
- πŸ“– Recipe versions are immutable once used in sessions
- πŸ“¦ Inventory deductions happen via transactions, never direct overwrites
- πŸ“ Every action is audit-logged

The AI interprets natural language, picks the right tools, and explains results. The server stores facts, validates requests, and enforces rules. Neither side does the other's job.

---

## πŸ§‘β€πŸ’» Development

```bash
# Typecheck
npx tsc --noEmit

# Build
npm run build

# Test
npm test

# Dev (HTTP mode)
npm run dev -- --http
```

---

## πŸ“ Project Structure

```
src/
β”œβ”€β”€ πŸ› οΈ server/tools/      # 13 tool files, 66 tools
β”œβ”€β”€ πŸ—οΈ domain/            # Services and types per domain
β”œβ”€β”€ βš™οΈ infrastructure/    # Database, audit, idempotency, logging
└── πŸ“¦ shared/            # Response envelope, errors, IDs, time
```

---

## πŸ“„ License

MIT