hisgarden/mcp-server-meal-prep
If you are the rightful owner of mcp-server-meal-prep 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.
MCP Server - Meal Prep is a high-performance server built in Rust, designed for meal preparation with intelligent meal planning and a diverse recipe database.
MCP Server - Meal Prep (Rust)
| |
A high-performance MCP (Model Context Protocol) server built in Rust for meal preparation, featuring cuisine-based recipes and intelligent meal planning capabilities.
π Features
- Multi-Cuisine Recipe Database: Traditional recipes from French, Thai, Italian, Mexican, Chinese, Vietnamese, and Japanese cuisines
- Intelligent Meal Planning: Generate weekly meal plans with optimized shopping lists
- Ingredient Overlap Analysis: Minimize food waste by identifying common ingredients
- Resource Templates: Dynamic recipe access via
file://recipes/{cuisine}
URIs - High Performance: Built with Rust for excellent performance and memory safety
- Type Safety: Compile-time guarantees with zero-cost abstractions
- Comprehensive Security: Pre-commit hooks, vulnerability scanning, SBOM generation
- Cross-Platform: Portable binary that runs anywhere without dependencies
ποΈ Architecture
Rust Implementation Benefits
- Memory Safety: No null pointer exceptions or memory leaks
- Performance: Near C-level performance with excellent concurrency
- Type System: Powerful compile-time type checking
- Macro System: Code generation for MCP protocol compliance
- Async Runtime: Tokio-based async/await for high throughput
Project Structure
src/
βββ main.rs # MCP server implementation with tools and prompts
βββ recipes.rs # Recipe data structures and database
βββ meal_planner.rs # Meal planning logic and optimization
βββ lib.rs # Library entry point
tests/
βββ integration_tests.rs # Comprehensive test suite
scripts/
βββ security-check.sh # Security validation script
βββ generate-sbom.sh # SBOM generation script
benches/
βββ benchmark.rs # Performance benchmarking
Cargo.toml # Dependencies and project configuration
deny.toml # License and security policy
Makefile # Development commands
π οΈ Setup
Prerequisites
- Rust 1.70+ (install via rustup.rs)
- Cargo (comes with Rust)
- Git (for version control)
Installation
# Clone or navigate to the project directory
cd mcp-server-meal-prep
# Build the project
cargo build --release
# Run the server
cargo run --release
ChatGPT Desktop Integration
For ChatGPT Desktop on macOS, see the comprehensive setup guide:
- - Complete setup instructions
- - One-click setup script
Quick setup:
# Run the automated setup script
./setup-chatgpt-mcp.sh
Development
# Run in development mode
cargo run
# Run tests
cargo test
# Check code formatting
cargo fmt
# Lint the code
cargo clippy
# Run security checks
make security-check
# Generate SBOM
make sbom
# Run benchmarks
cargo bench
π― Available Features
Tools
get_cuisines
: List all available cuisinesget_recipes
: Get recipes for a specific cuisinegenerate_meal_plan
: Create a meal plan with shopping listanalyze_ingredient_overlap
: Find common ingredients across recipesweekly_meal_planner
: Comprehensive weekly meal planning with cuisine selection
Prompts
weekly_meal_planner
: Comprehensive weekly meal planning with cuisine selection
Resources
file://recipes/{cuisine}
: Access recipes by cuisine (French, Thai, Italian, Mexican, Chinese, Vietnamese)
π Usage Examples
MCP Client Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"meal-prep": {
"command": "/path/to/mcp-server-meal-prep/target/release/mcp-server-meal-prep",
"args": [],
"env": {}
}
}
}
Example Tool Calls
// Get available cuisines
{
"method": "tools/call",
"params": {
"name": "get_cuisines",
"arguments": {}
}
}
// Get French recipes
{
"method": "tools/call",
"params": {
"name": "get_recipes",
"arguments": {
"cuisine": "French"
}
}
}
// Generate 7-day meal plan for Italian cuisine
{
"method": "tools/call",
"params": {
"name": "generate_meal_plan",
"arguments": {
"cuisine": "Italian",
"days": 7,
"servings": 4
}
}
}
// Analyze ingredient overlap for Mexican cuisine
{
"method": "tools/call",
"params": {
"name": "analyze_ingredient_overlap",
"arguments": {
"cuisine": "Mexican"
}
}
}
Example Prompt Usage
// Weekly meal planner for Vietnamese cuisine
{
"method": "prompts/get",
"params": {
"name": "weekly_meal_planner",
"arguments": {
"cuisine": "Vietnamese"
}
}
}
π³ Supported Cuisines
French Cuisine
- Coq au Vin: Classic French chicken in wine
- French Onion Soup: Traditional onion soup with gruyère
- Crème Brûlée: Vanilla custard with caramelized sugar
Thai Cuisine
- Pad Thai: Stir-fried rice noodles with shrimp and vegetables
- Tom Yum Goong: Spicy and sour shrimp soup
- Mango Sticky Rice: Sweet dessert with coconut milk
Italian Cuisine
- Spaghetti Carbonara: Pasta with eggs, cheese, and pancetta
- Margherita Pizza: Classic tomato, mozzarella, and basil pizza
- Tiramisu: Coffee-flavored dessert with mascarpone
Mexican Cuisine
- Tacos al Pastor: Spiced pork tacos with pineapple
- Guacamole: Avocado dip with lime and cilantro
- Churros: Fried dough pastries with cinnamon sugar
Chinese Cuisine
- Kung Pao Chicken: Spicy stir-fried chicken with peanuts and vegetables
- Char Siu (Chinese BBQ Pork): Sweet and savory roasted pork
- Egg Tarts (Dan Tat): Creamy custard tarts with flaky pastry
Vietnamese Cuisine
- Pho Bo (Beef Noodle Soup): Traditional Vietnamese noodle soup
- Banh Mi: Vietnamese sandwich with pickled vegetables
- Che Ba Mau (Three Color Dessert): Layered dessert with beans and coconut
Japanese Cuisine
- Unagi Donburi (Eel over Rice): Grilled eel with sweet sauce over rice
- Miso Soup: Traditional Japanese soup with fermented soybean paste
- Matcha Ice Cream: Green tea flavored ice cream dessert
π§ͺ Testing
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_meal_plan_generation
π Performance Characteristics
- Startup Time: 0.020s (5.5x faster than TypeScript)
- Memory Usage: ~10-20MB (native binary efficiency)
- Binary Size: 1.6M (self-contained executable)
- Build Time: 1.97s (release build)
- Throughput: Excellent for CPU-intensive meal planning
- Latency: Minimal overhead for recipe access
π§ Development
Adding New Cuisines
- Edit
src/recipes.rs
- Add new recipes to the
get_recipe_database()
function - Rebuild:
cargo build --release
- Restart MCP client
Adding New Tools
- Add tool function to
MealPrepServer
implementation - Use
#[tool(description = "...")]
attribute - Implement error handling with
McpError
- Add tests for the new functionality
Adding New Prompts
- Add prompt function to
MealPrepServer
implementation - Use
#[prompt(name = "...")]
attribute - Return
GetPromptResult
with messages - Add argument validation
π Deployment
Building for Production
# Build optimized release binary
cargo build --release
# The binary will be at:
# target/release/mcp-server-meal-prep
Cross-Platform Compilation
# Install cross-compilation target
rustup target add x86_64-unknown-linux-gnu
# Build for Linux from macOS
cargo build --release --target x86_64-unknown-linux-gnu
π Troubleshooting
Common Issues
- Build Errors: Ensure Rust 1.70+ is installed
- Runtime Errors: Check that all dependencies are available
- MCP Connection: Verify the binary path in client configuration
- Permission Issues: Ensure the binary is executable
Debug Mode
# Run with debug logging
RUST_LOG=debug cargo run
π Performance vs TypeScript
Metric | Rust | TypeScript | Winner |
---|---|---|---|
Startup Time | 0.020s | 0.110s | π Rust |
Memory Usage | ~10-20MB | ~50-100MB | π Rust |
Binary Size | 1.6M | 4.0K | π TypeScript |
Build Time | 1.97s | 1.15s | π TypeScript |
Dependencies | 3.9G (target) | 78M (node_modules) | π TypeScript |
Type Safety | Compile + Runtime | Compile-time | π Rust |
Concurrency | Excellent (Tokio) | Good (Node.js) | π Rust |
Portability | Universal binary | Node.js required | π Rust |
π Security Features
This MCP server implements comprehensive security best practices:
Security Tools
- cargo audit: Vulnerability scanning for dependencies
- cargo deny: License compliance and advisory checking
- Pre-commit hooks: Automated security validation
- SBOM generation: Software Bill of Materials for supply chain security
Security Hardening
- Memory safety: Zero unsafe code blocks
- Stripped binaries: Debug symbols removed from release builds
- Security profiles: Hardened build configurations
- Dependency auditing: Automated vulnerability scanning
Security Documentation
- SECURITY.md: Vulnerability reporting process
- RUST_DEVELOPMENT_GUIDE.md: Security-aware development practices
- SETUP_TROUBLESHOOTING.md: Security troubleshooting guide
π€ Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-cuisine
- Add your changes with tests
- Run
cargo test
andcargo clippy
- Run security checks:
make security-check
- Submit a pull request
π License
MIT License - see file for details.
π Acknowledgments
- Built with the RMCP Rust SDK
- Inspired by the TypeScript MCP server example
- Recipe data compiled from traditional cooking sources
- Security practices based on OWASP guidelines
- Author: Jin Wen jin.wen@hisgarden.org
Ready to cook with Rust! π¦π³ Your high-performance MCP server is ready for meal planning and recipe access.