Skip to content

neurotictoaster/recipe-to-paprika

Repository files navigation

Recipe to Paprika Converter

A comprehensive system for converting AI-generated recipes to Paprika format, with seamless Claude Desktop integration.

🍳 What This Does

Transform your recipe workflow from this:

  1. Ask Claude to create a recipe
  2. Copy the recipe text
  3. Manually format and paste into Paprika

To this:

  1. Ask Claude Desktop: "Create a Thai curry recipe and convert it to Paprika format"
  2. Done! Recipe is automatically saved as a .paprikarecipes file ready for import

⭐ Key Features

  • πŸ€– Claude Desktop Integration - Convert recipes without leaving Claude
  • πŸ“± Command-Line Tool - Standalone converter for JSON files
  • πŸ”„ Smart Format Handling - Automatically fixes array/string mismatches
  • πŸ“ Batch Processing - Convert multiple recipes at once
  • πŸ›‘οΈ Robust Validation - Handles missing fields and data type issues
  • πŸ“± Cross-Platform - Works on macOS, Windows, and Linux

πŸš€ Quick Start

Option 1: Claude Desktop Integration (Recommended)

  1. Install Python 3.10+ and dependencies:

    pip install "mcp>=1.2.0"
  2. Run the setup script:

    python setup_mcp.py
  3. Restart Claude Desktop and start converting recipes!

Option 2: Command Line Only

  1. Convert a single recipe:

    python json_to_paprika.py path/to/recipe.json
  2. Convert all recipes in a directory:

    python json_to_paprika.py recipes/
  3. Interactive mode:

    python json_to_paprika.py

πŸ“ What's Included

Core Tools

  • recipe_mcp_server.py - MCP server for Claude Desktop integration
  • json_to_paprika.py - Command-line converter
  • setup_mcp.py - Automated setup for Claude Desktop

Documentation

  • README_MCP.md - Detailed MCP setup and troubleshooting
  • Sample recipes - Example JSON and converted .paprikarecipe files

Testing

  • test_mcp.py - MCP server functionality tests
  • test_array_conversion.py - Format validation tests

πŸ’‘ Usage Examples

Claude Desktop Integration

You: "Create a simple pasta recipe with what I have: tomatoes, garlic, olive oil, and basil"

Claude: [Creates detailed recipe]

You: "Convert this to Paprika format"

Claude: βœ… Recipe successfully converted to Paprika format!
πŸ“ Output file: Simple_Pasta_with_Tomatoes.paprikarecipes
πŸ“ Location: /Users/you/Documents/PaprikaRecipes/Simple_Pasta_with_Tomatoes.paprikarecipes

Command Line

# Single file conversion
$ python json_to_paprika.py "Thai Green Curry.json"
Processing: Thai Green Curry.json
βœ… Final recipe bundle created: output/Thai_Green_Curry_with_Chicken.paprikarecipes

# Batch conversion
$ python json_to_paprika.py recipes/
Processing: recipes/
Found: recipes/curry.json
Found: recipes/pasta.json
Found: recipes/cookies.json
βœ… Final recipe bundle created: output/20240125_1430.paprikarecipes

πŸ› οΈ Requirements

  • Python 3.10+ (use pyenv for version management)
  • MCP 1.2.0+ (for Claude Desktop integration)
  • Claude Desktop (for MCP features)
  • Paprika Recipe Manager (for importing converted recipes)

πŸ“‹ Recipe Format

The system accepts JSON recipes in this format:

{
  "name": "Recipe Name",
  "description": "Brief description",
  "ingredients": ["1 cup flour", "2 eggs", "1 tsp salt"],
  "directions": ["Mix ingredients", "Bake at 350Β°F", "Serve hot"],
  "prep_time": "15 minutes",
  "cook_time": "30 minutes",
  "servings": "4",
  "categories": ["Dinner", "Quick"]
}

Note: The system automatically handles:

  • Array-to-string conversion for ingredients/directions
  • Missing fields (filled with sensible defaults)
  • Mixed data types and formatting inconsistencies

πŸ”§ Advanced Usage

Python API

from recipe_mcp_server import ensure_recipe_fields, gzip_files_inline, zip_files_inline

# Validate and convert recipe data
recipe = ensure_recipe_fields(your_recipe_dict)

# Create Paprika file
gzipped_files = gzip_files_inline("/path/to/temp/dir")
paprika_file = zip_files_inline(gzipped_files)

Custom Output Location

Files are automatically saved to ~/Documents/PaprikaRecipes/ for easy access. Single recipes use the recipe name as filename, while batch conversions use timestamps.

πŸ› Troubleshooting

Common Issues

MCP server not loading in Claude Desktop:

  • Check Python version (3.10+ required)
  • Verify pip install "mcp>=1.2.0" succeeded
  • Restart Claude Desktop after running setup

Permission errors:

  • Ensure ~/Documents is writable
  • Try running with different user permissions

Array format issues:

  • The system automatically converts arrays to strings
  • No manual formatting needed

For detailed troubleshooting, see README_MCP.md.

πŸ“š Documentation

  • README_MCP.md - Complete MCP server setup guide
  • Sample files - Example recipes in sample_files/
  • Code comments - Inline documentation in all Python files

🀝 Contributing

This project demonstrates integrating AI recipe generation with recipe management apps. Feel free to:

  • Report issues or suggest improvements
  • Add support for other recipe management formats
  • Extend the MCP server with additional tools
  • Improve the command-line interface

πŸ“„ License

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

What this means:

  • βœ… Use for any purpose (personal, commercial, etc.)
  • βœ… Modify and distribute freely
  • βœ… No warranty or liability on my part
  • ⚠️ Must include the original license and copyright notice

Transform your AI-generated recipes into perfectly formatted Paprika imports with zero manual work. 🍳✨

About

All my work for the recipe backup/converter and database

Topics

Resources

License

Stars

Watchers

Forks

Languages