daily-deals-mcp-server

hebra/daily-deals-mcp-server

3.1

If you are the rightful owner of daily-deals-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Big Watermelon MCP Server is a service designed to extract and provide daily deal details from Big Watermelon, a wholesale store in Melbourne, through an MCP server for AI agents.

Big Watermelon Daily Deals MCP Server

An MCP (Model Context Protocol) server that automatically fetches and analyzes daily produce deals from Big Watermelon, a fruit and vegetable wholesale store in Melbourne, Australia. The server uses Requesty.ai to extract deal information from images and makes it available to AI agents via the MCP protocol.

Features

  • Automated Daily Fetching: Retrieves deals once per day after 7 AM Australia/Melbourne time
  • AI-Powered Extraction: Uses Requesty.ai to analyze deal images and extract structured data
  • Intelligent Caching: 24-hour cache to minimize API calls and improve performance
  • Production-Ready: Includes rate limiting, graceful shutdown, comprehensive logging, and error handling
  • Highly Configurable: All settings configurable via environment variables
  • Performance Optimized: Concurrent processing with exponential backoff retry logic
  • SSE Transport: Server-Sent Events for real-time MCP communication

Architecture

graph TB
    subgraph "MCP Clients"
        A[Cline/Roo Code]
        B[Claude Desktop]
        C[AnythingLLM]
    end
    
    subgraph "MCP Server"
        D[SSE Transport]
        E[Rate Limiter]
        F[MCP Handler]
    end
    
    subgraph "Core Logic"
        G[Deals Fetcher]
        H[Cache Manager]
        I[Image Processor]
    end
    
    subgraph "External Services"
        J[Big Watermelon Website]
        K[Requesty.ai API]
    end
    
    A --> D
    B --> D
    C --> D
    D --> E
    E --> F
    F --> G
    G --> H
    H --> I
    I --> J
    I --> K
    
    style D fill:#e1f5ff
    style G fill:#fff4e1
    style K fill:#ffe1e1

Requirements

  • Go: 1.24.3 or later
  • Requesty.ai API Key: Required for image analysis
  • Optional: Docker for containerized deployment

Installation

Local Setup

  1. Clone the repository:

    git clone https://github.com/hebra/ahemseepee/daily-deals-mcp-server.git
    cd daily-deals-mcp-server
    
  2. Set up environment variables:

    export REQUESTY_API_KEY=your-requesty-api-key-here
    
  3. Install dependencies:

    make deps
    
  4. Build and run:

    make build
    make run
    

The server will start on http://localhost:8080 with the following endpoints:

  • GET /sse - SSE connection endpoint for MCP clients
  • POST /message - MCP message endpoint
  • GET /health - Health check endpoint
  • GET /ready - Readiness check endpoint

Docker Setup

# Build Docker image
make docker-build

# Run Docker container
make docker-run

Configuration

All configuration is done via environment variables with sensible defaults:

Required Configuration

VariableDescriptionDefault
REQUESTY_API_KEYRequesty.ai API key for image analysis(Required)

Requesty.ai Configuration

VariableDescriptionDefault
REQUESTY_BASE_URLRequesty.ai API base URLhttps://router.requesty.ai/v1
REQUESTY_MODELAI model to usegoogle/gemini-2.5-flash
REQUESTY_MAX_TOKENSMaximum tokens in response4096
REQUESTY_TEMPERATUREModel temperature (0.0-1.0)0.0

Server Configuration

VariableDescriptionDefault
PORTHTTP server port8080
RATE_LIMIT_REQUESTSMaximum requests per window100
RATE_LIMIT_WINDOWRate limit time window1m

Fetching Configuration

VariableDescriptionDefault
FETCH_HOURHour to fetch deals (0-23, Melbourne time)7
CACHE_FILEPath to cache filebigwatermelon-dailydeals.cached.json
SPECIALS_URLURL to scrape for dealshttps://www.bigwatermelon.com.au/category/specials/
TIMEZONETimezone for schedulingAustralia/Melbourne

Business Information

VariableDescriptionDefault
BUSINESS_NAMEBusiness name in responsesBig Watermelon Bushy Park
LOCATION_LATITUDEBusiness latitude-37.8748714
LOCATION_LONGITUDEBusiness longitude145.2053244
LOCATION_ADDRESSStreet address1161 High St Rd
LOCATION_CITYCityWantirna South
LOCATION_STATEStateVIC
LOCATION_ZIPPostal code3152
LOCATION_COUNTRYCountryAustralia

Performance Configuration

VariableDescriptionDefault
HTTP_TIMEOUTHTTP client timeout30s
REQUESTY_TIMEOUTAPI timeout60s
OVERALL_TIMEOUTOverall operation timeout300s
MAX_RETRIESMaximum retry attempts3
RETRY_BASE_DELAYBase delay between retries1s

Development

Available Make Commands

make help          # Show all available commands
make build         # Build the application
make run           # Build and run the application
make dev           # Start development server with hot reload (requires air)
make test          # Run tests
make coverage      # Generate test coverage report
make fmt           # Format code
make lint          # Run linter
make vet           # Run go vet
make tidy          # Tidy and verify dependencies
make clean         # Clean build artifacts

Running Tests

# Run all tests
make test

# Run specific test
go test -v ./internal -run TestFunctionName

# Generate coverage report
make coverage

Code Quality

# Format code
make fmt

# Run linter
make lint

# Run static analysis
make vet

Configuring MCP Clients

This server uses SSE (Server-Sent Events) transport. You can either:

  1. Run the server locally (see Installation)
  2. Use the hosted instance at https://daily-deals-mcp-server-7ow81.kinsta.app/

Cline / Roo Code

Add to your MCP settings file (typically ~/.roo/mcp_settings.json or VSCode settings):

Hosted Server:

{
  "mcpServers": {
    "bigwatermelon-deals": {
      "type": "sse",
      "url": "https://daily-deals-mcp-server-7ow81.kinsta.app/sse"
    }
  }
}

Local Server:

{
  "mcpServers": {
    "bigwatermelon-deals": {
      "type": "sse",
      "url": "http://localhost:8080/sse"
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

Hosted Server:

{
  "mcpServers": {
    "bigwatermelon-deals": {
      "type": "sse",
      "url": "https://daily-deals-mcp-server-7ow81.kinsta.app/sse"
    }
  }
}

Local Server:

{
  "mcpServers": {
    "bigwatermelon-deals": {
      "type": "sse",
      "url": "http://localhost:8080/sse"
    }
  }
}

AnythingLLM

  1. Navigate to Settings → MCP Servers
  2. Add a new server with:
    • Name: bigwatermelon-deals
    • Transport: SSE
    • URL: https://daily-deals-mcp-server-7ow81.kinsta.app/sse (hosted) or http://localhost:8080/sse (local)

Generic MCP Client

For any MCP-compatible client that supports SSE transport:

Hosted Server:

{
  "transport": "sse",
  "url": "https://daily-deals-mcp-server-7ow81.kinsta.app/sse"
}

Local Server:

{
  "transport": "sse",
  "url": "http://localhost:8080/sse"
}

Available Tools

get-big-watermelon-deals

Retrieves today's fruit and vegetable deals from Big Watermelon.

Parameters: None

Returns:

{
  "lastUpdated": "2025-01-23",
  "business": "Big Watermelon Bushy Park",
  "location": {
    "latitude": -37.8748714,
    "longitude": 145.2053244,
    "address": "1161 High St Rd",
    "city": "Wantirna South",
    "state": "VIC",
    "zip": "3152",
    "country": "Australia"
  },
  "offers": [
    {
      "productName": "Bananas",
      "price": 2.99,
      "currency": "AUD",
      "size": "kg"
    }
  ]
}

Project Structure

.
├── main.go                          # Application entry point, MCP server setup
├── internal/
│   ├── config.go                    # Configuration management
│   ├── config_test.go               # Configuration tests
│   ├── models.go                    # Data models
│   ├── requesty-client.go           # Requesty.ai API client
│   ├── big-watermelon-deals-fetcher.go    # Core fetching logic
│   └── big-watermelon-deals-fetcher_test.go  # Fetcher tests
├── .roo/                            # Roo Code AI assistant rules
│   └── rules-code/
│       └── AGENTS.md                # Code mode specific rules
├── AGENTS.md                        # General project guidance
├── Makefile                         # Build and development commands
├── go.mod                           # Go module definition
├── go.sum                           # Go module checksums
├── LICENSE                          # GPL-3.0 license
└── README.md                        # This file

How It Works

  1. Scheduling: Server waits until 7 AM Australia/Melbourne time before fetching deals
  2. Cache Check: Checks if deals for today are already cached
  3. Web Scraping: If not cached, scrapes the Big Watermelon specials page for image URLs
  4. Image Processing:
    • Downloads images matching the pattern SPECIALS*.jpg (case-insensitive)
    • Encodes images as base64 data URLs with proper MIME type detection
    • Sends to Requesty.ai API for analysis
  5. Data Extraction: AI extracts product names, prices, and sizes from images
  6. Caching: Stores results in local cache file for 24 hours
  7. Response: Returns structured JSON data to MCP clients

Performance & Reliability Features

  • Concurrent Processing: Concurrent image downloads with mutex-protected operations
  • Exponential Backoff: Retry logic with exponential backoff for failed operations
  • Timeout Management: Configurable timeouts with context cancellation support
  • Rate Limiting: Protects server from abuse (default: 100 requests/minute)
  • Graceful Shutdown: Properly closes connections on termination
  • Structured Logging: Comprehensive logging with request IDs for tracing
  • Error Handling: Robust error handling with structured error parsing
  • Race Condition Protection: Mutex-protected concurrent operations
  • Prompt Caching: Ephemeral cache control for efficient API usage

Troubleshooting

Server won't start

Problem: API key not set

Configuration validation failed: validation error for REQUESTY_API_KEY: API key is required

Solution: Set the environment variable:

export REQUESTY_API_KEY=your-api-key-here

No deals returned

Problem: Server hasn't reached 7 AM Melbourne time yet

Solution: The server only fetches deals after 7 AM Australia/Melbourne time. Check logs for:

Too early to fetch deals, waiting for configured hour

You can override this by setting FETCH_HOUR=0 to fetch immediately.

Rate limit errors

Problem: Too many requests

Rate limit exceeded: Too many requests. Please try again later.

Solution: Wait for the rate limit window to reset (default: 1 minute) or increase limits:

export RATE_LIMIT_REQUESTS=200
export RATE_LIMIT_WINDOW=1m

Timeout errors

Problem: Operations timing out

Solution: Increase timeout values:

export HTTP_TIMEOUT=60s
export REQUESTY_TIMEOUT=120s
export OVERALL_TIMEOUT=600s

API errors

Problem: Requesty.ai API errors

Solution: Check your API key and ensure you have sufficient credits. The server logs structured error messages from the API:

requesty API error [error_type]: error message

License

This project is licensed under the GNU General Public License v3.0 - see the file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments