Chef's Brain

Chef's Brain

A smart pantry MCP server that gives Claude live access to your pantry ingredients, enabling ingredient tracking, recipe suggestions, and expiry management through natural language.

Category
访问服务器

README

🧑‍🍳 Chef's Brain

A smart pantry MCP server that turns Claude into your personal sous chef — knowing exactly what's in your kitchen and suggesting what to cook right now.


What Is This?

Chef's Brain is a Model Context Protocol (MCP) server that gives Claude live, structured access to your pantry. Instead of describing your ingredients in every chat message, Claude can query your pantry directly, track what you use, and reason over real ingredient data to suggest recipes you can actually make.

Built as a CS class project exploring MCP server design, with a personal twist: the author is a foodie and baker, so the tools are designed around real kitchen workflows.


Features

Tool Description
get_pantry View all pantry items grouped by category
add_ingredient Add or update an ingredient with amount, unit, category, and optional expiry
remove_ingredient Remove an ingredient (used up or don't have it)
use_ingredient Decrease an ingredient's quantity after cooking
suggest_recipes Get recipe ideas based on what you have + your current craving/mood
check_recipe_feasibility Check if you have everything needed for a specific recipe
expiring_soon See what's expiring soon and get "use it up" recipe ideas

Design Choices

Smart Onboarding with a Default Pantry

Problem: Starting a pantry tracker from scratch is tedious. Nobody wants to type in 30 staples before they can do anything useful.

Solution: On first run, the server pre-loads a curated default pantry of ~30 common staples (eggs, flour, butter, olive oil, etc.) and instructs Claude to present them all at once and ask "Which of these do you NOT have?" Claude then calls remove_ingredient for each missing item. This gets you to an accurate pantry in one conversational exchange.

This was a key UX decision: the server doesn't try to build a wizard UI — it just sets the right context in the tool response and lets Claude handle the conversation naturally.

Structured Quantities

Each ingredient stores amount (number) and unit (string) as separate fields rather than a combined string like "2 cups". This makes the check_recipe_feasibility and use_ingredient tools more precise and opens the door for unit conversion in a future version.

{
  "flour": {
    "amount": 5,
    "unit": "lbs",
    "category": "dry goods",
    "expiry_date": null
  }
}

Optional Expiry Dates

Expiry tracking is opt-in per item. Pantry staples like salt or olive oil don't need expiry dates — requiring them for everything would create friction. Perishables like milk or meat can have a date set. The expiring_soon tool filters to only items with a date set.

Claude's Culinary Knowledge Over an External API

suggest_recipes does not call Spoonacular, Edamam, or any recipe API. Instead, it formats your pantry as a structured ingredient list and returns it with an instruction prompt that tells Claude to reason over it using its own knowledge. This has three advantages:

  1. No API key required — works immediately, no setup
  2. More flexible — Claude can handle vague cravings ("something cozy") that a search API can't
  3. Better explanations — Claude can adapt recipes to your exact quantities and suggest substitutions

The tradeoff is that suggestions aren't tied to real recipes with exact measurements. For a pantry-awareness tool rather than a recipe database, this is the right call.

Fuzzy Ingredient Matching

check_recipe_feasibility uses substring matching to handle common name mismatches (e.g., a recipe calling for "all purpose flour" matches the pantry key "all-purpose flour"). It's not perfect — a production version would use embeddings — but it handles the most common cases cleanly.

Local JSON Storage

The pantry is stored in pantry.json in the project directory. No database, no cloud, no accounts. This keeps setup to a single pip install and makes the data easy to inspect and back up. The file path is configurable via the PANTRY_FILE environment variable.


Installation

Requirements: Python 3.11+, Claude Code (or any MCP-compatible client)

# 1. Clone the repo
git clone https://github.com/yourusername/chefs-brain
cd chefs-brain

# 2. Install dependencies
pip install mcp

# 3. Test the server runs
python server.py

Connecting to Claude Code

Add the server to your Claude Code MCP config. The config file lives at:

  • macOS: ~/.claude/claude_desktop_config.json (Claude desktop) or configure via claude mcp add in Claude Code

Using claude mcp add (recommended for Claude Code)

claude mcp add chefs-brain python /absolute/path/to/chefs-brain/server.py

Manual config (Claude desktop app)

Edit ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "chefs-brain": {
      "command": "python",
      "args": ["/absolute/path/to/chefs-brain/server.py"],
      "env": {
        "PANTRY_FILE": "/absolute/path/to/chefs-brain/pantry.json"
      }
    }
  }
}

Restart Claude after editing the config.


Example Interactions

First-time setup

You: "What's in my pantry?"
Claude: [calls get_pantry, sees first_run flag]
Claude: "Welcome to Chef's Brain! I've pre-loaded your pantry with common staples:

  Dairy: eggs (12), milk (1 gallon), butter (1 cup)...
  Dry Goods: flour (5 lbs), sugar (4 lbs)...
  ...

Which of these items do you NOT currently have? I'll remove them for you."

You: "I don't have heavy cream or parmesan."
Claude: [calls remove_ingredient("heavy cream"), remove_ingredient("parmesan")]
Claude: "Got it! I've removed those. Your pantry is ready."

Recipe suggestions

You: "I want something chocolatey but I only have 30 minutes."
Claude: [calls suggest_recipes(craving="chocolatey", max_time_mins=30)]
Claude: "With what you have, here are 3 options:
  1. Chocolate Mug Cake (10 min, easy) — uses eggs, cocoa powder, butter, sugar, flour
  2. Chocolate Oat No-Bake Cookies (20 min, easy) — uses oats, cocoa, butter, honey
  3. Pan Brownies (30 min, medium) — uses flour, cocoa, eggs, butter, sugar, vanilla"

Checking a specific recipe

You: "Can I make tiramisu?"
Claude: [calls check_recipe_feasibility("tiramisu", [...])]
Claude: "You're missing 2 ingredients: mascarpone cheese and espresso/coffee.
  You have everything else: eggs, sugar, vanilla extract."

Expiry check

You: "Anything about to go bad?"
Claude: [calls expiring_soon(days=7)]
Claude: "Your eggs expire in 3 days! You could make a frittata or French toast to use them up."

Project Structure

chefs-brain/
├── server.py        # MCP server — all tools live here
├── pantry.json      # Auto-created on first run (gitignored)
├── pyproject.toml   # Package metadata
└── README.md        # This file

Potential Extensions

  • Unit conversion — normalize amounts across units (e.g. "do I have enough butter: I have 1 cup, recipe needs 200g?")
  • Shopping list generation — collect all missing items across multiple recipes into one list
  • Multiple clients — connect to both Claude Code and a web front-end simultaneously via the same MCP server
  • Meal planning — plan a week of meals optimized around what you have + what's expiring
  • Nutritional awareness — tag ingredients with macros and suggest recipes that hit a target

Why MCP?

MCP lets Claude access live, structured, personal data without needing that data baked into a prompt. The pantry state is always current, tools are composable (Claude can call expiring_soon and then suggest_recipes in sequence), and the server is client-agnostic — the same server.py could power Claude Code, Claude desktop, or any other MCP-compatible client.

For a pantry tracker specifically, this is much better than a standalone app: you get Claude's full culinary reasoning applied directly to your actual kitchen data.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选