What is MCP, and how QuickCart uses it
MCP (Model Context Protocol) is an open standard for exposing tools and
resources to an agent runtime over JSON-RPC 2.0. A server advertises a list of callable tools
(each with a JSON-Schema for its inputs), and a client invokes them by name over a transport โ
either stdio for a co-located process or streamable HTTP+SSE for a networked one.
The protocol is transport-agnostic and schema-first, which is exactly what we want when talking to five
very different retail backends.
QuickCart runs a single gateway service โ mcp-adaptor โ that fronts five per-platform
MCP servers, one each for Blinkit, Zepto, BigBasket, Flipkart and Amazon. Every adaptor implements
the same normalised tool contract (ยง4), so the Aggregation service can fan a query out to all five
with identical call sites and merge the results without special-casing any platform. Each adaptor is a thin
translator: it maps our canonical tool call onto whatever surface the platform genuinely offers, then maps
the platform's native response back into QuickCart's canonical schema.
Put differently: MCP is our internal integration boundary. It is not something these retailers publish โ it is how we choose to wrap them so a new source is "just another adaptor speaking the same eleven tools."
Adaptor topology
The Aggregation service never speaks to a retailer directly. It speaks MCP to the mcp-adaptor
gateway, which routes each canonical tool call to the right per-platform server. Each server owns the
credentials, rate-limit budget, native request shape and response-normalisation for exactly one platform.
(Node.js)"] -->|MCP / JSON-RPC| GW{{"mcp-adaptor
gateway"}} GW --> B["Blinkit MCP"] GW --> Z["Zepto MCP"] GW --> G["BigBasket MCP"] GW --> F["Flipkart MCP"] GW --> A["Amazon MCP"] B --> BB["Partner Commerce API
(agreement-gated)"] Z --> ZB["Partner Commerce API
(agreement-gated)"] G --> GB["Partner Commerce API
(agreement-gated)"] F --> FB["Affiliate / Seller API
(restricted)"] A --> AB["PA-API 5.0 / SP-API"] B -.->|normalise| CS[["Canonical schema:
product ยท mrp ยท price ยท
stock ยท eta ยท offers"]] A -.->|normalise| CS F -.->|normalise| CS
The unified tool contract
Every adaptor implements the same eleven tools. Read tools are mandatory; write tools are optional and only wired up where a platform's commerce API genuinely permits programmatic cart/checkout. All price fields are in โน (INR); all availability and ETA calls are location-scoped because quick-commerce stock is hyperlocal.
| Tool | Parameters | Returns (normalised) | Notes |
|---|---|---|---|
search_products | query, location, limit | [{sourceProductId, title, brand, packSize, image, price, inStock, etaMinutes}] | Read. Ranked snippets; drives the search fan-out. |
get_product | sourceProductId | Full product: title, brand, attributes, images, description | Read. Detail-screen hydrate. |
get_price | sourceProductId, location | {mrp, sellingPrice, effectivePrice, currency} | Read. effectivePrice nets applicable auto-offers. |
check_stock | sourceProductId, location | {inStock, quantityAvailable, maxQty} | Read. Location-scoped; shortest TTL (~1 min). |
get_delivery_estimate | sourceProductId, location | {minutes, slot, deliveryFee} | Read. Real-time; drives the ETA badge. |
get_offers | sourceProductId, location | [{code, type, value, minCart, expiresAt}] | Read. Coupons & auto-applied discounts. |
list_categories | โ | Category tree | Read. Seeds catalogue & browse. |
list_products_by_category | categoryId, cursor | Paged product list | Read. Powers the missing-SKU crawl (Doc 03 ยง5). |
create_cart | location | {cartId} | Write โ only where a partner commerce API allows it. |
add_to_cart | cartId, sourceProductId, qty | {cartId, lineItems, subtotal} | Write โ partner-gated; otherwise deep-link handoff. |
checkout | cartId, address, paymentToken | {orderId, status, trackingUrl} | Write โ rarely available; most platforms are handoff-only. |
{
"name": "get_offers",
"description": "Coupons and auto-applied discounts for a product at a location",
"inputSchema": {
"type": "object",
"required": ["sourceProductId", "location"],
"properties": {
"sourceProductId": { "type": "string" },
"location": {
"type": "object",
"required": ["lat", "lng"],
"properties": {
"lat": { "type": "number" },
"lng": { "type": "number" },
"pincode": { "type": "string" }
}
}
}
}
}
get_offers โ normalised response
{
"sourceId": "blinkit",
"sourceProductId": "blk_88213",
"offers": [
{ "code": "WELCOME50", "type": "FLAT", "value": 50, "minCart": 199, "expiresAt": "2026-09-30T18:30:00Z" },
{ "code": null, "type": "AUTO_PERCENT", "value": 10, "appliesTo": "item" }
],
"fetchedAt": "2026-09-08T10:14:22Z",
"ttlSeconds": 120
}
Per-platform adaptors
Same eleven tools, five very different realities. The strength of each platform maps directly to what it is: quick-commerce players are unbeatable on hyperlocal stock and ETA; the marketplaces are richer on catalogue depth, MRP and reviews. Access mechanisms and limits below are illustrative of each platform's real posture, not published MCP specs.
Blinkit Blinkit adaptor
Underlying access: partner commerce API, agreement-gated. No public product API โ access requires a signed data/commerce partnership.
Supports: search_products, get_product, get_price,
check_stock, get_delivery_estimate, get_offers,
list_categories, list_products_by_category. Hyperlocal stock & ETA are its
standout signals.
Write / checkout: typically handoff โ deep-link into the
Blinkit app/PDP; programmatic checkout only under a commerce agreement.
Auth: OAuth2 client-credentials + per-partner API key ยท Rate: quota per agreement ยท Freshness: stock ~1 min, ETA real-time.
Zepto Zepto adaptor
Underlying access: partner commerce API, agreement-gated. Same posture as Blinkit โ a business relationship is the gate, not a public developer portal.
Supports: the full read set; excellent sub-15-minute ETA and dark-store-level stock.
get_offers reflects Zepto Pass / cart-level promos where surfaced by the API.
Write / checkout: handoff by default; cart APIs only if the partnership includes commerce endpoints.
Auth: OAuth2 + API key ยท Rate: per-agreement quota ยท Freshness: stock ~1 min, ETA real-time.
BigBasket BigBasket adaptor
Underlying access: partner/commerce API, agreement-gated. Slotted + express (BB Now) fulfilment, so ETA can be a delivery slot as well as minutes.
Supports: full read set; deepest grocery catalogue and reliable MRP/pack-size data;
get_delivery_estimate returns either express minutes or a slot window.
Write / checkout: handoff by default; slot booking via API only under agreement.
Auth: OAuth2 + API key ยท Rate: per-agreement quota ยท Freshness: price ~5 min, stock ~2 min, slots cached to slot expiry.
Flipkart Flipkart adaptor
Underlying access: Flipkart Affiliate API (historically public, now restricted/approval-only) and the Seller/Marketplace API for merchants. Product read is possible for approved affiliates; deep catalogue but no hyperlocal minute-ETA.
Supports: search_products, get_product, get_price
(MRP + selling price), get_offers, ratings/reviews, images. get_delivery_estimate
returns standard delivery days for a pincode, not minutes.
Write / checkout: affiliate deep-link buy โ no programmatic consumer checkout.
Auth: Affiliate ID + token ยท Rate: affiliate quotas ยท Freshness: price ~15 min; must honour affiliate attribution.
Amazon Amazon adaptor
Underlying access: Product Advertising API (PA-API 5.0) for Associates
and, for our own listings, SP-API. The richest read surface of the five โ full product
detail, MRP (SavingBasis), Buy Box price, images and reviews summary.
Supports: search_products (SearchItems), get_product (GetItems),
get_price, get_offers, images, ratings. get_delivery_estimate is
delivery days / Prime eligibility, not minutes.
Write / checkout: affiliate deep-link (Add-to-Cart / associate links) โ no programmatic consumer checkout via PA-API.
Auth: PA-API access/secret keys + Associate tag ยท Rate: TPS tied to shipped-items revenue (throttles hard when low) ยท Freshness: price ~15 min; strict display & attribution terms.
Reading the cards
Two families, two shapes of value:
- Quick-commerce (Blinkit, Zepto, BigBasket) โ hyperlocal stock + minute-level ETA; access is partnership-gated; checkout is usually handoff.
- Marketplaces (Flipkart, Amazon) โ deep catalogue, reliable MRP + reviews; access via affiliate/seller programs; buy is an attributed deep-link.
The Price Engine (Doc 05) weights each source's signals by exactly these strengths.
Capability matrix
What each adaptor can actually return today, given the access mechanisms above. This is the single most important table in the document โ the Aggregation service degrades gracefully around every โ and โ.
| Platform | Search | Details | MRP | Sell price | Live stock | ETA | Offers | Images | Reviews | Browse | Add cart | Checkout | Order status |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Blinkit | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| Zepto | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| BigBasket | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| Flipkart | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| Amazon | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ | โ |
โ Fully supported โ Partial / conditional (hover for the caveat) โ Not available via sanctioned access
Quick-commerce write/checkout cells are โ because they depend on a commerce partnership; marketplace checkout is โ because affiliate/PA-API programs deliberately exclude programmatic consumer purchase.
To what extent can we use them?
The honest answer differs per capability, not just per platform. Four axes govern everything:
Read vs write
All five give sanctioned read access to product, price and (for quick-commerce) stock/ETA. Write โ cart and checkout โ is the exception, available only under a commerce partnership; the default consumer path is a deep-link handoff.
Per-location queries
Stock, ETA and often price are location-scoped. Quick-commerce answers are per dark-store; a query without lat/lng/pincode is meaningless. We cache per (sourceProductId, geohash).
Rate limits & quotas
PA-API TPS scales with our shipped-items revenue and throttles aggressively when low; affiliate and partner APIs carry per-agreement quotas. The gateway enforces a token bucket per adaptor and sheds load to cache.
Data freshness
We cache with capability-specific TTLs: price ~2โ5 min, stock ~1 min, ETA real-time (no cache), catalogue/images hours. Every response carries fetchedAt so the UI can show staleness.
What we CAN rely on
- Product search & detail across all five.
- MRP + selling price on all five (marketplaces are most reliable).
- Live hyperlocal stock & minute-level ETA from Blinkit & Zepto (BigBasket express).
- Offers/coupons where the API surfaces them.
- Attributed deep-link buy to every platform (universal fallback).
What needs a partnership / is out of scope
- Programmatic cart & checkout on quick-commerce โ requires a commerce agreement.
- Any consumer checkout on Flipkart/Amazon via affiliate/PA-API โ excluded by program terms.
- Live per-unit quantity on marketplaces (only an availability message).
- Order status for orders we didn't place.
- Scraping of any platform โ out of scope on ToS/legal grounds.
Field mapping
Each adaptor's job ends here: collapse a native payload into QuickCart's canonical fields. Native field names below are illustrative โ exact for Amazon PA-API, representative for the partner APIs whose schemas aren't public.
| Canonical field | Amazon (PA-API) | Flipkart (Affiliate) | Blinkit / Zepto / BigBasket (illustrative) |
|---|---|---|---|
sourceProductId | ASIN | productId | sku_id / product_id |
title | ItemInfo.Title.DisplayValue | productBaseInfo.title | name |
mrp | Offers.Listings.SavingBasis.Amount | maximumRetailPrice.amount | mrp |
sellingPrice | Offers.Listings.Price.Amount | flipkartSpecialPrice.amount | selling_price |
effectivePrice | Price โ applied Promotions | Price โ discountPercentage | final_price (post auto-offer) |
inStock | Offers.Listings.Availability.Type | inStock | availability.in_stock |
quantityAvailable | โ (message only) | โ (flag only) | availability.qty |
deliveryEstimate.minutes | โ (delivery days) | โ (delivery days) | eta_minutes |
deliveryEstimate.deliveryFee | Prime / shipping | shippingCharges | delivery_charge |
image | Images.Primary.Large.URL | imageUrls['200x200'] | image_url |
rating | CustomerReviews.StarRating | productBaseInfo.rating.average | โ (usually absent) |
Sample MCP call
A single search_products invocation against the Blinkit adaptor over JSON-RPC, and the
normalised list it returns. Note the adaptor has already collapsed Blinkit's native payload into our
canonical fields โ the caller never sees a Blinkit-shaped object.
{
"jsonrpc": "2.0",
"id": 42,
"method": "tools/call",
"params": {
"name": "search_products",
"arguments": {
"query": "amul butter 500g",
"location": { "lat": 12.9716, "lng": 77.5946, "pincode": "560001" },
"limit": 5
}
}
}
JSON-RPC result โ blinkit MCP (normalised)
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"content": [{ "type": "json", "json": {
"sourceId": "blinkit",
"products": [
{
"sourceProductId": "blk_88213", "title": "Amul Butter (Pasteurised)",
"brand": "Amul", "packSize": "500 g",
"mrp": 290, "sellingPrice": 278, "effectivePrice": 265,
"inStock": true, "quantityAvailable": 14,
"deliveryEstimate": { "minutes": 9, "deliveryFee": 0 },
"image": "https://cdn.example/blk_88213.jpg"
}
],
"fetchedAt": "2026-09-08T10:14:22Z"
} }]
}
}
On the Aggregation side, the same call is one line via the MCP client โ the gateway hides transport and auth:
aggregation/sources.tsimport { mcp } from "./mcpAdaptorClient";
// Fan a single canonical tool out to one source; the adaptor normalises the shape.
export async function searchSource(sourceId, query, location) {
const res = await mcp.call(sourceId, "search_products", {
query, location, limit: 5
}, { timeoutMs: 800 }); // per-source deadline; see Doc 05
return res.products; // already in canonical schema
}
How these five per-source results are merged, SKU-matched and ranked into a single best-price answer is the subject of Document 05 โ Price & Availability Engine.
mcp-adaptor gateway sits inside the backend described in
Document 03 โ Architecture, called by the Aggregation service; the
list_products_by_category crawl also feeds the missing-SKU pipeline there. Merge & ranking
of everything these tools return is covered in Document 05.