An educational MCP (Model Context Protocol) server demonstrating AI-powered pizza ordering with Domino's API integration.
β οΈ Important: This project is for educational purposes only. While it integrates with Domino's real API, actual order placement is blocked by CAPTCHA requirements. See Limitations for details.
This project is based on GrahamMcBain/mcpizza, with significant enhancements:
- Author: Graham McBain
- Purpose: Educational MCP protocol demonstration
- Design: Safe-mode ordering without real placement
- β Real API Integration - Actually calls Domino's pricing and validation APIs
- β
Pizza Customization -
add_pizza_with_toppingstool for proper coupon + topping configuration - β Interaction Logging - Complete 2-way logging system for all MCP interactions
- β
Coupon Discovery -
get_couponsandget_ordering_guidancetools - β Enhanced Error Handling - Detailed error reporting and validation
- β Comprehensive Documentation - WORKFLOW.md with step-by-step instructions
- MCP Protocol Integration - Full implementation of Model Context Protocol
- Real-world API Interaction - Integration with Domino's unofficial API
- Complex Tool Orchestration - 12 tools working together for multi-step workflows
- State Management - Order state management across tool calls
- Error Handling - Graceful handling of API validation and errors
- π
find_stores- Find nearby Domino's by address or zip - πͺ
get_store_info- Detailed store information and hours - π
get_menu- Complete menu with categories - π
search_menu- Search for specific items - π
get_coupons- Discover available deals and coupons
- π
create_order- Initialize a new order - π
add_pizza_with_toppings- Add customized pizzas with toppings (NEW!) - β
add_item_to_order- Add any menu item - ποΈ
view_order- Preview order details and pricing - ποΈ
clear_order- Clear current order - π³
place_order- Attempt to place order (blocked by CAPTCHA)
- π―
get_ordering_guidance- AI-powered deal recommendations (NEW!)
- Python 3.10+
- uv package manager
# Clone the repository
git clone https://github.com/dshanklin-bv/mcp-pizza.git
cd mcp-pizza
# Install dependencies
uv pip install -e .Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"pizza": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-pizza",
"run",
"mcpizza"
]
}
}
}See WORKFLOW.md for complete ordering workflow documentation.
1. Find stores: "find pizza stores near 76104"
2. Get coupons: "what deals are available at store 8022?"
3. Get guidance: "I want a deep dish sausage and pepperoni pizza"
4. Create order: Create order with your details
5. Add pizza: Use add_pizza_with_toppings with coupon code
6. View order: Review pricing and details
7. (Optional) Place order: Will be blocked by CAPTCHA
The codebase follows a clean, modular architecture with separation of concerns:
mcp-pizza/
βββ mcpizza/
β βββ server.py # Main MCP server (303 lines, down from 1308!)
β βββ logger.py # Interaction logging system
β βββ __main__.py # Entry point
β β
β βββ models/ # Pydantic parameter models
β β βββ params.py # Tool parameter definitions
β β
β βββ services/ # Business logic layer
β β βββ store_service.py # Store lookup & menu browsing
β β βββ order_service.py # Order creation & management
β β βββ payment_service.py # Payment processing
β β βββ guidance_service.py # AI ordering guidance
β β
β βββ tools/ # MCP tool handlers
β β βββ store_tools.py # Store-related tools
β β βββ menu_tools.py # Menu-related tools
β β βββ order_tools.py # Order-related tools
β β βββ guidance_tools.py # Guidance tools
β β
β βββ api/ # Domino's API client
β β βββ endpoints.py # API endpoint constants
β β βββ client.py # HTTP client wrapper
β β
β βββ utils/ # Utilities
β βββ mock_order.py # Mock order object creation
β
βββ tests/ # Comprehensive test suite (18 tests)
β βββ test_models.py # Model validation tests
β βββ test_utils.py # Utility function tests
β βββ test_api_client.py # API client tests
β βββ test_services.py # Service layer tests
β
βββ examples/ # Example scripts
β βββ test_mcp_with_ollama.py # Autonomous testing
β
βββ logs/ # Interaction logs (gitignored)
βββ WORKFLOW.md # Complete workflow documentation
βββ README.md # This file
- Maintainability: Each module has a single responsibility
- Testability: Services and utilities are easily unit tested
- Readability: Clear separation between MCP layer, business logic, and API calls
- Scalability: Easy to add new tools or services
- Reusability: Services can be reused outside of MCP context
All MCP interactions are automatically logged to logs/interactions_YYYYMMDD.log:
- Tool calls with full arguments
- Tool responses with previews
- State changes (order creation, items added)
- Errors with context
Log format is JSON for easy parsing and analysis.
Domino's API requires CAPTCHA verification for order placement. Our system successfully:
- β Validates pizza configurations
- β Prices orders correctly (e.g., $11.90 for medium 2-topping)
- β Accepts payment structure
- β Cannot submit final order (blocked by
recaptchaVerificationRequired)
This is an intentional fraud prevention measure by Domino's and cannot be bypassed without violating their terms of service.
- Store lookup and menu browsing
- Coupon discovery and deal analysis
- Order validation and pricing
- Complete order preparation
- All MCP protocol features
- Final order submission (CAPTCHA required)
- Real payment processing
# Run autonomous test suite (tests all tools except order placement)
python test_mcp_with_ollama.pyThis is an educational project demonstrating MCP protocol integration. Contributions that enhance the educational value are welcome!
- MCP SDK: Official Model Context Protocol SDK
- API Library: pizzapi (unofficial Domino's API wrapper)
- Order Structure: Mock order object with real API calls
- Validation: Multi-step validation (structure β pricing β placement)
This project is for learning about:
- Model Context Protocol implementation
- Real-world API integration
- Multi-tool orchestration
- State management in AI assistants
Do not use for actual pizza ordering. Use Domino's official website or mobile app instead.
MIT License
Based on GrahamMcBain/mcpizza (MIT License)
- Graham McBain - Original mcpizza project and MCP implementation
- pizzapi contributors - Unofficial Domino's API wrapper
- Anthropic - Model Context Protocol specification
Built with Claude Code π€