notion-pantry-mcp-server

Kyle-Ski/notion-pantry-mcp-server

3.2

If you are the rightful owner of notion-pantry-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server that connects large language models (LLMs) to your Notion pantry database, allowing for intelligent pantry management, recipe suggestions, and shopping list assistance.

Tools
  1. getPantryInfo

    View comprehensive information about your pantry inventory.

  2. getPantryAndRecipes

    Get pantry inventory and recipes for meal planning.

  3. updatePantryItems

    Update quantities of multiple pantry items at once.

  4. updatePantryAfterCooking

    Update pantry after preparing a meal.

  5. addPantryItem

    Add or update pantry items.

Pantry MCP Server

A Model Context Protocol (MCP) server that connects large language models (LLMs) to your Notion pantry database, allowing for intelligent pantry management, recipe suggestions, and shopping list assistance.

Overview

This project creates a bridge between LLMs and your Notion databases to:

  • Track and manage pantry inventory
  • Generate meal suggestions based on available ingredients
  • Maintain shopping lists and track purchases
  • Automate pantry updates after cooking meals

Built on Cloudflare Workers with the Model Context Protocol (MCP), this server enables natural language interactions with your food management system, making it easy to query your pantry data, receive recipe suggestions, and manage your shopping needs through conversation.

Features

  • Pantry Management: View, add, update, and organize pantry items
  • Recipe Suggestions: Get meal recommendations based on your available ingredients
  • Shopping List Management: Maintain a dynamic shopping list with automatic additions
  • Intelligent Updates: After cooking a meal, automatically update pantry quantities and add depleted items to shopping list
  • Direct Notion Integration: All changes sync directly with your Notion databases with links back to the source pages

Requirements

  • Node.js 18 or higher
  • Cloudflare account
  • Notion account with API access
  • Basic familiarity with Notion databases

Setup

Notion Integration Setup

  1. Create a Notion integration:

    • Go to https://www.notion.so/my-integrations
    • Click "New integration"
    • Give it a name like "Pantry Manager"
    • Select the capabilities: "Read content", "Update content", "Insert content"
    • Save and copy your integration token
  2. Create Notion Databases:

    • You'll need three databases:
      • Pantry: Stores pantry items and quantities
      • Recipes: Contains your recipe collection
      • Shopping List: Manages items to purchase
      • I have some scripts to help create the Pantry and Shopping List Database
  3. Share your databases with your integration:

    • Open each database in Notion
    • Click "Share" in the top right
    • Enter your integration name and click "Invite"
  4. Set up database structure: This project includes helper scripts to set up your databases with the correct schema:

    # First, create a .env file with:
    NOTION_TOKEN=your_integration_token_here
    NOTION_PANTRY_DB=your_pantry_page_id
    NOTION_SHOPPING_LIST_DB=your_shopping_list_page_id
    NOTION_RECIPES_DB=your_existing_recipe_db_id
    # Then run:
    node scripts/setupNewDatabases.js
    

This will create the necessary database structure on your existing pages.

Project Setup

  1. Clone the repository:
git clone https://github.com/Kyle-Ski/notion-pantry-mcp-server
cd notion-pantry-mcp-server
  1. Install dependencies:
npm install
  1. Configure your environment:

Update `.dev.vars with your Notion credentials:

  "NOTION_TOKEN": "your_integration_token_here",
  "NOTION_PANTRY_DB": "your_pantry_db_id",
  "NOTION_RECIPES_DB": "your_recipes_db_id",
  "NOTION_SHOPPING_LIST_DB": "your_shopping_list_db_id"
  1. Deploy to Cloudflare Workers:
npm run deploy

MCP Tools

The server provides the following tools for LLMs to interact with your pantry system:

ToolDescriptionKey Features
getPantryInfoView comprehensive information about your pantry inventory• Complete item listing with quantities
• Expiring items within the next week
• Staples running low
• Category distribution
• Notion page links
getPantryAndRecipesGet pantry inventory and recipes for meal planning• Current pantry inventory
• Recipe details with ingredients
• Recipe tags and tried status
• Recipe source links
updatePantryItemsUpdate quantities of multiple pantry items at once• Batch update/add multiple items
• Support for both adding and removing quantities
• Automatically adds new items if needed
• Detailed before/after report
updatePantryAfterCookingUpdate pantry after preparing a meal• Update via recipe ID or ingredient list
• Auto-decrease used ingredients
• Add depleted staples to shopping list
• Mark recipes as tried
• Detailed change report
updatePantryWithUsedItemsUpdate pantry by removing ingredients you've used• Direct quantity reduction for ad-hoc cooking
• Tracks items not found in pantry
• Adds staples to shopping list when low
• Provides before/after comparison
addPantryItemAdd or update pantry items• Quantity, unit, category tracking
• Expiry date management
• Staple item flagging with auto-calculated minimums
• Smart duplicate handling
getShoppingListView current shopping list• Items organized by category
• Purchase status tracking
• Priority levels
• Auto-added vs manual items
addToShoppingListAdd items to shopping list• Quantity, unit, category tracking
• Priority assignment
• Smart duplicate handling
markItemAsPurchasedMark shopping list items as purchased• Update purchase status
• Prepare for pantry transfer
addPurchasedItemsToPantryTransfer purchased items to pantry• Bulk transfer of purchased items
• Update existing pantry quantities
• Remove from shopping list
• Optional detailed summary
removeExpiredItemsRemove expired items from pantry• Optional custom expiry date check
• Add staples to shopping list
"Dry run" mode for checking without removing
• Detailed expiry report
convertCookingUnitsConvert between different cooking units• Support for volume and weight conversions
• Ingredient-specific conversions
• Handles unit aliases
• Multi-step conversions
getCookingEquivalentsGet common cooking equivalents• Volume conversion tables
• Weight conversion tables
• Ingredient-specific equivalents

Example Usage

Here are some examples of how to interact with the MCP server:

Adding Items to Pantry

"I'd like to add 2 pounds of ground beef, 1 gallon of milk, and a dozen eggs to my pantry."

The LLM will use the addPantryItem tool to add each item to your Notion database.

Meal Planning

"What types of lunches can I make with the items I have in my pantry?"

The LLM will use getPantryAndRecipes to analyze your pantry contents and suggest suitable lunch recipes.

Shopping for a Recipe

"I'd like to make Chicken Parmesan. What ingredients do I need to add to my shopping list?"

The LLM will check your pantry inventory, identify missing ingredients, and add them to your shopping list.

Adding Purchases Items to Pantry

I just finished shopping, can you add all of the purchased items to my pantry?

The LLM will look at your shopping list for purchased items, and add all of them to your pantry.

Database Structure

Pantry Database

PropertyTypeDescription
NameTitleItem name
QuantityNumberAmount available
UnitSelectMeasurement unit (count, oz, pounds, etc.)
CategorySelectFood category (Produce, Dairy, etc.)
LocationSelectStorage location (Fridge, Pantry, etc.)
ExpiryDateExpiration date
StapleCheckboxWhether it's a staple item
MinQuantityNumberMinimum quantity to maintain for staples
NotesRich TextAdditional information about the item
TagsMulti-selectAdditional categorization

Shopping List Database

PropertyTypeDescription
NameTitleItem name
QuantityNumberAmount to purchase
UnitSelectMeasurement unit
CategorySelectFood category
PrioritySelectShopping priority (Low, Medium, High)
PurchasedCheckboxWhether it's been purchased
AutoAddedCheckboxWhether it was automatically added
NotesRich TextAdditional notes about purchase

Recipe Database

This project adapts to your existing recipe database structure, typically using:

PropertyTypeDescription
NameTitleRecipe name
TagsMulti-selectCategories like "Breakfast", "Dinner", etc.
Tried?CheckboxWhether you've made it before
LinkURLURL to recipe source
Kitchen ToolsRelationOptional relation to kitchen tools
Created OnCreated timeWhen the recipe was added

Known Limitations

  • Expiration dates, notes, and tags aren't fully utilized in all operations
  • New categories might be created that don't match existing database categories

Future Enhancements

  • Add server prompts to improve LLM interactions with tools and resources
  • Implement authentication for multi-user support
  • Create a dedicated ingredients database linked to recipes
  • Enable smarter category management based on existing categories
  • Support for more detailed recipe information

Troubleshooting

If you encounter any issues:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements