deliverect-conversational-data

JelteVrijhoef/deliverect-conversational-data

3.2

If you are the rightful owner of deliverect-conversational-data 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 providing natural language access to Deliverect restaurant analytics with business insights and controlled data access.

Tools
5
Resources
0
Prompts
0

Deliverect Analytics MCP Server POC

A Model Context Protocol (MCP) server that provides natural language access to Deliverect restaurant analytics with business insights and controlled data access.

๐Ÿš€ Status: Core Implementation Complete

โœ… Working MCP Server with all 5 tools implemented
โœ… Business Intelligence with actionable insights
โœ… Rate Limiting & Validation following security best practices
โœ… Comprehensive Testing framework included
โณ Real Data Integration pending database setup

๐ŸŽฏ Quick Start

1. Environment Setup

# Clone and navigate to project
cd deliverect-mcp-poc

# Copy environment template
cp .env.example .env

# Edit .env with your credentials (see section below)

2. Install Dependencies

pip install -r requirements.txt

3. Run the MCP Server

python -m src.deliverect_mcp_server

4. Test the Server

python test_client.py "python -m src.deliverect_mcp_server"

๐Ÿ”ง Required Credentials

Update .env file with these required variables:

# Deliverect API (get from your Deliverect Developer Account)
DELIVERECT_CLIENT_ID=your_client_id_here
DELIVERECT_CLIENT_SECRET=your_client_secret_here
DELIVERECT_ENV=sandbox  # or 'production'
DELIVERECT_BASE_URL=https://staging-api.deliverect.com

# Database (PostgreSQL for analytics storage)
ANALYTICS_DB_URL=postgresql://user:password@localhost:5432/deliverect_analytics

# Cache (Redis for fast data access)
REDIS_URL=redis://localhost:6379/0

# Google Cloud (for BigQuery ETL - optional for testing)
GOOGLE_CLOUD_PROJECT=your_gcp_project_id
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json

๐Ÿ› ๏ธ Available MCP Tools

1. get_popular_items

Analyze most popular menu items with sales trends and business insights.

{
    "timeframe": "week",     # day, week, month, quarter
    "location_id": null,     # specific location or null for all
    "limit": 10              # max 50 items
}

2. get_store_performance

Compare restaurant location performance with operational metrics.

{
    "location_ids": ["loc_downtown", "loc_mall"],  # max 10 locations
    "timeframe": "month",                          # analysis period
    "comparison": true                             # include comparisons
}

3. get_revenue_analytics

Analyze revenue trends and financial performance with forecasting.

{
    "timeframe": "quarter",        # week, month, quarter, year
    "breakdown_by": "month",       # day, week, month, category
    "include_forecast": false      # experimental forecasting
}

4. get_order_summary

Analyze order volume patterns and operational efficiency metrics.

{
    "timeframe": "week",           # analysis period
    "include_patterns": true,      # detailed pattern analysis
    "breakdown_by_hour": false     # hourly breakdown data
}

5. search_locations

Discover and list available restaurant locations for analysis.

{
    "search_term": "downtown",     # filter by name/address
    "location_type": "restaurant", # restaurant, food_truck, etc.
    "active_only": true,           # only active locations
    "include_metrics": false       # basic performance metrics
}

๐Ÿ”’ Security & Rate Limiting

  • Rate Limited: 5 calls per minute per tool
  • Query Limits: Max 90 days, 50 items, 10 locations per query
  • Input Validation: All parameters sanitized and validated
  • Controlled Access: NO direct database or API access from tools
  • Pre-Aggregated Data: Fast responses from cached analytics

๐Ÿ“Š Response Format

All tools return standardized responses with:

{
    "success": true,
    "data": {
        # Tool-specific data (items, locations, etc.)
    },
    "business_context": {
        "insights": [],           # Actionable business insights
        "benchmarks": {},         # Performance comparisons
        "trends": [],             # Notable trends identified
        "recommendations": []     # Specific action items
    },
    "metadata": {
        "data_freshness": "15min old",
        "confidence": 0.95,
        "source": "analytics_service",
        "query_time_ms": 87
    }
}

๐Ÿงช Testing

The included test client validates all functionality:

# Run comprehensive tests
python test_client.py "python -m src.deliverect_mcp_server"

# Tests include:
# โœ… All 5 MCP tools
# โœ… Error handling scenarios  
# โœ… Rate limiting behavior
# โœ… Response format validation

๐Ÿ—๏ธ Architecture

LLM/Claude โ†” MCP Protocol โ†” Deliverect MCP Server โ†” Analytics Service โ†” Pre-Aggregated Data

Key Design Principles:

  • Business-First: Every response includes actionable insights
  • Controlled Access: Tools never query BigQuery/APIs directly
  • Rate Limited: Prevents expensive operations and abuse
  • Real Data Only: NO mock data (pending database setup)

๐Ÿ“ Current Limitations

  • Mock Data: Tools return structured mock data pending database setup
  • ETL Pipeline: BigQuery โ†’ Analytics DB pipeline not yet implemented
  • Docker: Containerization pending
  • Real-Time Data: Currently simulated data freshness

๐Ÿšง Next Steps

  1. Database Setup - PostgreSQL + Redis infrastructure
  2. ETL Implementation - BigQuery extraction and aggregation
  3. Real API Integration - Connect to actual Deliverect endpoints
  4. Docker Deployment - Complete containerization
  5. Production Testing - Integration tests with live data

๐Ÿ“š Documentation

  • plan.md - Comprehensive implementation plan
  • progress.md - Current status and completed milestones
  • CLAUDE.md - Development guidelines and architecture requirements
  • test_client.py - Testing and validation framework

๐Ÿ†˜ Troubleshooting

Server Won't Start

  • Check all environment variables are set in .env
  • Verify Python dependencies installed: pip install -r requirements.txt
  • Check for port conflicts if using WebSocket mode

Tools Return Errors

  • Verify .env configuration matches .env.example
  • Check rate limiting - wait 1 minute between test runs
  • Review server logs for detailed error information

Database Connection Issues

  • Ensure PostgreSQL is running and accessible
  • Verify ANALYTICS_DB_URL connection string
  • Check database permissions and network access

๐Ÿค Contributing

This is a POC implementation following the requirements in CLAUDE.md. Key development principles:

  • NO Direct API Access - All tools use controlled analytics service
  • Business Context Required - Every response must include insights
  • Rate Limiting Enforced - Security and cost controls mandatory
  • Real Data Only - NO mock data in production

๐Ÿ“„ License

Internal POC - See organization licensing requirements.


๐ŸŽ‰ Ready to chat with your restaurant data through natural language queries!