Skip to main content
Glama
Deal Radar MCP Server

Deal Radar MCP Server

README.md
# ๐ŸŽฏ Deal Radar MCP Server
> **Universal E-Commerce, 10-Minute Quick Commerce & GDS Flight Price Radar for AI Agents**  
> *Powered by the Model Context Protocol (MCP)*

[![MCP](https://img.shields.io/badge/MCP-Compatible-blue.svg)](https://modelcontextprotocol.io/)
[![Node](https://img.shields.io/badge/Node-v20%2B-green.svg)](https://nodejs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.8.2-blue.svg)](https://www.typescriptlang.org/)
[![License](https://img.shields.io/badge/license-MIT-purple.svg)](LICENSE)
[![Status](https://img.shields.io/badge/Dashboard-Port%203333-brightgreen.svg)](http://localhost:3333)

**Deal Radar MCP** empowers AI assistants (Claude, Cursor, Antigravity, Gemini, Zed) to monitor e-commerce and flight pricing, uncover trending discounts, calculate effective out-of-pocket costs with card offers, predict airfare movements, avoid checkout phantom holds, track historical lows, and fire autonomous alerts when prices hit target thresholds.

Built with an **extensible, plug-and-play adapter architecture**, Deal Radar combines:
1. **Multi-Store National E-Commerce:** Amazon, Flipkart, Myntra, Croma, Reliance Digital, Tata CLiQ, eBay, and generic OpenGraph/JSON-LD stores.
2. **Hyper-Local 10-Minute Quick Commerce:** Blinkit, Zepto, Swiggy Instamart, Flipkart Minutes, Amazon Fresh with PIN code and GPS location filtering.
3. **Skyscanner-Grade Flight Radar & GDS Price Prediction:** Live flight deals across airlines & OTAs, bank/card discounts, flexible +/-3 day ribbons, bucket depth meters, phantom seat hold detection, and overnight GDS sweep watchers.

---

## ๐ŸŒŸ Key Features

### ๐Ÿ›๏ธ E-Commerce & 10-Minute Quick Commerce
- ๐Ÿ” **Cross-Store Price Comparison**: Query multiple national storefronts and local dark stores in parallel.
- โšก **Hyper-Local Delivery Gating**: Real Indian PIN code resolution (`GeoResolver`) checks serviceability (e.g. Tier-1 metros vs Tier-2/3 cities) for Blinkit, Zepto, Instamart, Minutes, and Amazon Fresh.
- ๐Ÿ’ณ **Effective Price Intelligence**: Calculates true out-of-pocket costs by factoring in instant credit/debit card offers (HDFC, ICICI, Axis, SBI, Amex), coupons, and delivery charges.
- ๐Ÿ“‰ **Watchlist & Fluctuation History**: Automatically logs price histories to uncover artificial markup before big sales.
- ๐Ÿ”” **Autonomous Background Poller**: Periodic cron engine audits active watchlist items and dispatches desktop notifications and MCP alerts.

### โœˆ๏ธ Flights Aggregator & Price Prediction Engine
- ๐ŸŒ **Multi-Provider Flight Search**: Searches major carriers (IndiGo, Air India, SpiceJet, Akasa Air) and aggregators (EaseMyTrip, MakeMyTrip, Cleartrip, Yatra, Skyscanner) with direct deep links landing on exact itineraries.
- ๐Ÿ’ณ **Credit Card Flight Offers**: Select your card (e.g., *HDFC Infinia/Regalia, Axis Atlas, ICICI Emeralde, SBI Card Elite, Amex Platinum*) to reveal max discounts, effective net fares, and airport lounge perks.
- ๐Ÿ“… **Flexible Date Fare Ribbon**: Skyscanner-style horizontal fare calendar strip showing prices for adjacent dates (+/- 3 days) with cheapest date callouts.
- ๐Ÿ’บ **Interactive Cabin & Passenger Selector**: Filter by Adults (1โ€“9) and Cabin Class (Economy, Premium Economy, Business, First).
- ๐Ÿ•’ **Time-of-Day Departure Filters**: One-click toggles for Early Morning (00:00โ€“06:00), Morning (06:00โ€“12:00), Afternoon (12:00โ€“18:00), and Evening (18:00โ€“24:00).
- ๐ŸŽ›๏ธ **Live GDS Bucket Depth Meter**: Displays real-time fare class codes (RBD: `O`, `Q`, `N`, `S`, `V`, `L`, `M`, `K`, `Y`) and remaining seats (`Class Q โ€ข 7 seats left` vs `Class N โ€ข 1 seat left - HIGH JUMP RISK`).
- โฑ๏ธ **Phantom Hold Cooldown Banner**: Detects when repetitive checkouts lock temporary 15-minute GDS seat holds, providing a live countdown timer so you don't compete against your own locked seat.
- ๐Ÿง  **Price Prediction & AP Cliff Strategy**: Recommends `BUY_NOW`, `WAIT_FOR_SWEEP`, or `HOLD_FARE` based on 21/14/7-day Advance Purchase (AP) cliffs and 21โ€“45 DTD load-factor sweet spots.
- ๐ŸŒ™ **Overnight GDS Sweep Watcher**: Schedules monitoring for the **03:30 AM โ€“ 05:00 AM IST** window when expired PNR holds and unassigned agency blocks are returned to cheaper buckets.

---

## ๐ŸŒ Supported Stores & Flight Providers

### E-Commerce & Quick Commerce
| Store | ID | Category | Coverage | Adapter Mechanism |
|:---|:---|:---|:---|:---|
| **Amazon India** | `amazon` | National E-Commerce | Pan-India | Native Scraper + Variant ASIN Resolver |
| **Flipkart** | `flipkart` | National E-Commerce | Pan-India | 2026 Resilient DOM + ?pid= Preserver |
| **Myntra** | `myntra` | Fashion / Lifestyle | Pan-India | Embedded SSR Catalog JSON Deserializer |
| **Blinkit** | `blinkit` | Quick Commerce | 10-15 Min Metros | Hyper-local Dark Store Adapter |
| **Zepto** | `zepto` | Quick Commerce | 10-Min Tier-1 Metros | PIN-gated Metro Inventory Scraper |
| **Swiggy Instamart**| `instamart` | Quick Commerce | 10-15 Min Metros | Hyper-local Dark Store Adapter |
| **Flipkart Minutes**| `flipkart_minutes`| Quick Commerce | 10-15 Min Metros | Hyper-local Dark Store Adapter |
| **Amazon Fresh** | `amazon_fresh`| Grocery / Fresh | Select Metros Only | Perishable PIN-gated Catalog |
| **Croma** | `croma` | Electronics | Pan-India | Declarative JSON Selector Adapter |
| **Reliance Digital**| `reliance_digital`| Electronics | Pan-India | Declarative JSON Selector Adapter |
| **Tata CLiQ** | `tata_cliq` | E-Commerce | Pan-India | Declarative JSON Selector Adapter |
| **eBay** | `ebay` | Global E-Commerce | Global | Declarative JSON Selector Adapter |
| **Universal Web** | `generic` | Any Online Store | Global | Schema.org JSON-LD & OpenGraph |

### Flight Airlines & Aggregators
| Provider | Type | Direct Booking URL Support |
|:---|:---|:---|
| **IndiGo** (`6E`) | Direct Airline | Direct deeplink with passenger & cabin payload |
| **Air India** (`AI`) | Direct Airline | Direct flight search & itinerary landing |
| **SpiceJet** (`SG`) | Direct Airline | Direct route deeplink |
| **Akasa Air** (`QP`) | Direct Airline | Direct booking deeplink |
| **EaseMyTrip** | Aggregator / OTA | Exact search list URL with `srch`, `px`, and `c` params |
| **MakeMyTrip** | Aggregator / OTA | Search URL with formatted flight route and date |
| **Cleartrip** | Aggregator / OTA | Search URL with route parameters |
| **Yatra** | Aggregator / OTA | Itinerary search deeplink |
| **Skyscanner** | Meta-Search | Deep comparison link |

---

## ๐Ÿ’ป CLI Usage

```bash
# Search national e-commerce deals
npm run cli -- search "Sony WH-1000XM5" --limit 5

# Search hyper-local quick commerce with PIN code
npm run cli -- search "Amul Milk" --category quick_commerce --pincode 560001

# Track a specific product URL
npm run cli -- track "https://www.flipkart.com/apple-iphone-15-blue-128-gb/p/itm387c20f1f5347"

# Set a price drop alert
npm run cli -- alert "https://www.flipkart.com/apple-iphone-15-blue-128-gb/p/itm387c20f1f5347" 64999

# Search flights with passenger count and cabin class
npm run cli -- search-flights --from DEL --to BOM --date 2026-11-20 --adults 2 --cabin economy

# Audit checkout price inflation and phantom holds
npm run cli -- audit-inflation --from IDR --to BLR --date 2026-11-25 --flight 6E-1117 --checkout-price 8200

# View your monitored watchlist
npm run cli -- watchlist

# Manually trigger an immediate price-drop poll
npm run cli -- poll

# Launch the visual Web Dashboard
npm run web
```

---

## ๐Ÿ–ฅ๏ธ Local Web Dashboard

Launch the unified Web UI on port `3333`:
```bash
npm run web
```

Open **[http://localhost:3333](http://localhost:3333)** to access:
- **๐Ÿ›๏ธ Products & Deals Tab:** Side-by-side e-commerce and 10-minute grocery comparison with serviceability banners, image carousels, and one-click alert configuration.
- **โœˆ๏ธ Flights & Prediction Tab:** Full flight search bar with city autocomplete, passenger & class selectors, +/- 3 day flexible ribbon, time-of-day filters, credit card discount selector, live bucket depth meters, phantom hold countdown banners, and price prediction strategy cards.
- **๐Ÿ”” Watchlist & Alerts Tab:** View, pause, edit, and delete active product and flight price alerts.
- **๐Ÿ”„ State Preservation:** All tab selections, origin/destination cities, departure dates, and filters sync with URL search parameters for seamless reloading and bookmarking.

---

## ๐Ÿ› ๏ธ Complete MCP Tools Reference (21 Tools)

### E-Commerce & Watchlist Tools
| Tool | Description | Key Arguments |
|:---|:---|:---|
| `search_deals` | Multi-store product search with category & location gating | `query`, `stores`, `pincode`, `category`, `limit` |
| `track_product` | Live product details, effective price & bank offers from URL | `url` |
| `set_price_alert` | Register target price threshold for background alerting | `url`, `targetPrice`, `notes` |
| `check_watchlist` | Poll active watchlist items and trigger alerts | *(none)* |
| `get_price_history` | Retrieve price fluctuation timeline, low & high records | `url` |
| `compare_prices` | Side-by-side store price comparison with net savings | `query` |
| `list_watchlist` | List all monitored products and alert states | *(none)* |
| `delete_price_alert`| Remove a product from the alert watchlist | `id` |
| `start_alert_poller`| Start periodic background polling for price drops | `intervalMinutes` |
| `stop_alert_poller` | Stop background poller | *(none)* |
| `get_poller_status` | Retrieve poller status, interval, and total checks | *(none)* |
| `poll_alerts_now` | Trigger immediate audit of all watchlist items | *(none)* |
| `add_store_adapter` | Register a new e-commerce store with declarative selectors | `id`, `name`, `domains`, `selectors` |
| `list_supported_stores`| List all built-in and custom store adapters | *(none)* |

### Flight Radar & GDS Prediction Tools
| Tool | Description | Key Arguments |
|:---|:---|:---|
| `search_flights` | Search flights across airlines and OTAs with card offers & predictions | `origin`, `destination`, `departureDate`, `cardBank`, `adults`, `cabinClass` |
| `get_flight_card_offers` | Get eligible bank/credit card offers for flights | `cardBank` |
| `calculate_flight_card_discount` | Compute exact card savings, net fare, and perk notes | `baseFare`, `cardBank`, `airlineCode` |
| `set_flight_price_alert` | Set price drop alert for a specific flight route | `origin`, `destination`, `targetPrice`, `departureDate` |
| `get_flight_itinerary_links` | Generate direct booking deep links for airlines and OTAs | `origin`, `destination`, `departureDate`, `flightNumber`, `adults`, `cabinClass` |
| `list_flight_providers` | List all supported airlines and OTA booking engines | *(none)* |
| `add_flight_provider` | Register custom flight airline or aggregator engine | `id`, `name`, `type`, `urlPattern` |
| `poll_passive_inventory` | Zero-footprint query returning base fare, taxes, RBD, and seat count | `origin`, `destination`, `departureDate`, `flightNumber` |
| `analyze_fare_bucket_state` | Prediction engine evaluating quantiles, AP cliffs, and buy/wait advice | `origin`, `destination`, `departureDate`, `flightNumber`, `currentPrice` |
| `detect_checkout_inflation` | Diagnoses phantom TTL seat holds vs OTA markups with cooldown timers | `origin`, `destination`, `departureDate`, `flightNumber`, `checkoutPrice` |
| `schedule_sweep_watcher` | Schedules monitoring for 04:00 AM IST sweeps and post-TTL releases | `origin`, `destination`, `departureDate`, `flightNumber`, `targetPrice` |

---

## ๐Ÿš€ Connecting to MCP Clients

### Claude Desktop
Add to your `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "deal-radar": {
      "command": "node",
      "args": ["/path/to/deal-radar-mcp/dist/index.js"]
    }
  }
}
```

### Antigravity / Gemini CLI
Add to `~/.gemini/config/mcp_config.json`:
```json
{
  "mcpServers": {
    "deal-radar": {
      "command": "node",
      "args": ["/path/to/deal-radar-mcp/dist/index.js"]
    }
  }
}
```

### Cursor / Zed
Point the MCP server setting to:
- **Command:** `node`
- **Args:** `["/path/to/deal-radar-mcp/dist/index.js"]`

---

## ๐Ÿงช Testing

Run the automated integration and regression test suites:
```bash
# Run all unit and integration tests
npm test

# Test GDS inventory, price prediction & phantom hold mechanics
node test/price_prediction_gds.test.js

# Test booking deeplinks and aggregator routing
node test/booking_urls.test.js

# Test flight features, ribbon, card discounts & filters
node test/flight_features.test.js

# Test airport autocomplete
node test/autocomplete.test.js
```

---

## ๐Ÿ“„ License
MIT ยฉ Antigravity & Shri-Ram

TDQS

B3/5.0

Scored across 25 tools

Disambiguation2/5

Several tools are functionally indistinguishable: check_watchlist ("Poll all active watchlist items... trigger notifications") and poll_alerts_now ("Trigger an immediate check across all active watchlist items for price drops") appear to do exactly the same thing, with start_alert_poller/stop_alert_poller/get_poller_status forming a fourth overlapping cluster around the same alert loop. The two-domain split (e-commerce vs flights) does help separate set_price_alert from set_flight_price_alert, and compare_prices vs search_deals are reasonably distinguishable, but the watchlist/poller cluster will cause frequent misselection.

Naming Consistency4/5

All names are snake_case and overwhelmingly verb_noun (track_product, set_price_alert, search_flights, list_supported_stores), which is a strong, predictable pattern. Minor deviations: poll_alerts_now uses a suffix instead of a verb_object form, and flight tools are domain-prefixed (flight_) while e-commerce tools are unprefixed, creating an asymmetry in how the two halves are labelled.

Tool Count3/5

25 tools is at the heavy end, and the server is effectively two products bolted together (retail price tracking + flight fare intelligence) with roughly 12 tools each. A handful of the watchlist/poller tools duplicate functionality and do not earn their place, pushing the count above what the domain requires.

Completeness3/5

Core lifecycle coverage is broad (search, track, alert, compare, history, store/provider registration, fare analysis, card discounts), so the main workflows exist. But there are notable gaps: no update/edit target price, no unwatch/untrack a product short of deleting its alert, no cancel or list for schedule_sweep_watcher, and no delete equivalent for set_flight_price_alert, leaving several dead ends once things are created.