Skip to main content
Glama

šŸ• MCPizza - Enhanced

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.

Credits

This project is based on GrahamMcBain/mcpizza, with significant enhancements:

Original Project

  • Author: Graham McBain

  • Purpose: Educational MCP protocol demonstration

  • Design: Safe-mode ordering without real placement

Our Enhancements

  • āœ… Real API Integration - Actually calls Domino's pricing and validation APIs

  • āœ… Pizza Customization - add_pizza_with_toppings tool for proper coupon + topping configuration

  • āœ… Interaction Logging - Complete 2-way logging system for all MCP interactions

  • āœ… Coupon Discovery - get_coupons and get_ordering_guidance tools

  • āœ… Enhanced Error Handling - Detailed error reporting and validation

  • āœ… Comprehensive Documentation - WORKFLOW.md with step-by-step instructions

Related MCP server: Food402

What This Project Demonstrates

  1. MCP Protocol Integration - Full implementation of Model Context Protocol

  2. Real-world API Interaction - Integration with Domino's unofficial API

  3. Complex Tool Orchestration - 12 tools working together for multi-step workflows

  4. State Management - Order state management across tool calls

  5. Error Handling - Graceful handling of API validation and errors

Features

Store & Menu Tools

  • šŸ“ 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

Ordering Tools

  • šŸ“ 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)

Guidance Tools

  • šŸŽÆ get_ordering_guidance - AI-powered deal recommendations (NEW!)

Installation

Prerequisites

  • Python 3.10+

  • uv package manager

Setup

# Clone the repository
git clone https://github.com/dshanklin-bv/mcp-pizza.git
cd mcp-pizza

# Install dependencies
uv pip install -e .

Claude Desktop Integration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "pizza": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/mcp-pizza",
        "run",
        "mcpizza"
      ]
    }
  }
}

Usage

See WORKFLOW.md for complete ordering workflow documentation.

Basic Example

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

Architecture

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

Benefits of This Architecture

  1. Maintainability: Each module has a single responsibility

  2. Testability: Services and utilities are easily unit tested

  3. Readability: Clear separation between MCP layer, business logic, and API calls

  4. Scalability: Easy to add new tools or services

  5. Reusability: Services can be reused outside of MCP context

Logging

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.

Limitations

CAPTCHA Requirement

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.

What Works

  • Store lookup and menu browsing

  • Coupon discovery and deal analysis

  • Order validation and pricing

  • Complete order preparation

  • All MCP protocol features

What Doesn't Work

  • Final order submission (CAPTCHA required)

  • Real payment processing

Development

Testing

# Run autonomous test suite (tests all tools except order placement)
python test_mcp_with_ollama.py

Contributing

This is an educational project demonstrating MCP protocol integration. Contributions that enhance the educational value are welcome!

Technical Details

  • 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)

Disclaimer

āš ļø Educational Use Only

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.

License

MIT License

Based on GrahamMcBain/mcpizza (MIT License)

Acknowledgments

  • Graham McBain - Original mcpizza project and MCP implementation

  • pizzapi contributors - Unofficial Domino's API wrapper

  • Anthropic - Model Context Protocol specification


Built with Claude Code šŸ¤–

Available Tools

12 tools
add_item_to_orderB

Add a menu item to the current order. Must create an order first.

Inputs: item_code (required), quantity, options.

add_pizza_with_toppingsC

Add a customized pizza with toppings using a coupon code. Handles proper product + topping configuration.

Inputs: coupon_code (required), toppings (required), size, crust.

clear_orderB

Clear the current order and start over.

Inputs: no named parameters.

create_orderB

Create a new order for delivery or carryout. Required before adding items.

Inputs: store_id (required), customer_name (required), customer_email (required), customer_phone (required), +5 more.

find_storesB

Find nearby Domino's stores by address or zip code. Returns store IDs, addresses, and phone numbers.

Inputs: query (required).

get_couponsC

Get available coupons and deals for a store. Returns coupon codes, descriptions, and prices.

Inputs: store_id (required).

get_menuB

Get the full menu for a specific store. Returns all available items organized by category.

Inputs: store_id (required).

get_ordering_guidanceC

Get AI guidance on how to build the best order based on user preferences. Analyzes deals, suggests optimal pizza counts, and provides ordering strategy.

Inputs: store_id (required), user_request (required).

get_store_infoC

Get detailed information about a specific Domino's store including hours and services.

Inputs: store_id (required).

place_orderA

āš ļø PLACES A REAL ORDER with real payment! Submit the current order to Domino's. Requires payment information.

Inputs: card_number (required), card_expiry (required), card_cvv (required), card_zip (required).

search_menuC

Search for specific menu items at a store. Can filter by category and search term.

Inputs: store_id (required), query, category.

view_orderB

View the current order including all items, prices, and totals.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no significant overlap. For example, 'get_menu' retrieves the full menu, while 'search_menu' filters it, and 'add_item_to_order' and 'add_pizza_with_toppings' handle different item types. The descriptions clearly differentiate their functions, making misselection unlikely.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as 'create_order', 'get_menu', and 'place_order'. This uniformity makes the tool set predictable and easy to understand, with no deviations in naming style.

    Tool Count5/5

    With 12 tools, the server is well-scoped for a pizza ordering domain. Each tool serves a specific role in the ordering workflow, from store lookup to order placement, without being excessive or insufficient for the intended functionality.

    Completeness5/5

    The tool set provides complete coverage for the pizza ordering domain, including store discovery, menu browsing, order creation and management, coupon retrieval, and final placement. There are no obvious gaps, as all essential CRUD and lifecycle operations are covered, ensuring agents can handle the full process without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that allows AI assistants to order Domino's Pizza through an unofficial API, with features for store location, menu browsing, and order management.
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to order food from TGO Yemek by browsing restaurants, managing carts, and completing checkouts. It allows users to handle address selection and order tracking directly through natural language interactions.
      2 npm
      12
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI agents to discover restaurants and place food delivery orders on Uber Eats and Thuisbezorgd (Just Eat Takeaway). It provides tools for restaurant discovery and order management through normalized platform APIs.
      7 npm
      4
      MIT