Metadata-Version: 2.4
Name: best-price-mcp
Version: 0.3.0
Summary: MCP tool for comparing prices across JD, Taobao, and PDD
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp[cli]>=1.0.0

# best-price-mcp

MCP tool for comparing prices across JD (京东), Taobao (淘宝/天猫), and PDD (拼多多).

## Installation

```bash
pip install best-price-mcp
```

## Usage

### As MCP Server

```bash
best-price-mcp
```

### Tool: compare_price

Search for the same product across major Chinese e-commerce platforms and compare final prices.

**Parameters:**
- `query` (string): Product keyword, title, or link. For best results, copy the full product title.
- `platform` (string, optional): "jd", "taobao", "pdd", or "all" (default)

### Supported Categories (37 Standard Product Types)

Phones, smart watches, tablets, laptops, monitors, printers, storage, GPUs, earphones, cameras, projectors, game consoles, routers, keyboards/mice, robot vacuums, TVs, refrigerators, washing machines, ACs, water heaters, hair dryers, shavers, electric toothbrushes, air purifiers, water purifiers, blenders, air fryers, rice cookers, branded sneakers, branded bags, branded watches, perfume, liquor, baby formula, diapers, books, branded grain/oil.

### Not Supported

Clothing, non-branded shoes/bags, accessories, home decor, custom/handmade items.

### Usage Scenarios

| Scenario | Example | Handling |
|----------|---------|----------|
| Copy product title (recommended) | 华为Mate70 Pro 12+512 雅丹黑 | Noise cleaning → search |
| Type brand + model | iPhone 17 Pro Max 256G | Direct search |
| APP share link (fallback) | 【淘宝】https://e.tb.cn/... | Parse → search |
| PC link | item.jd.com/12345.html | Prompt to copy title |
| Vague input | 华为手机 | Guide to copy title |

### Selection Logic

Each platform returns **1 best pick** + **0-2 alternatives**:

| Platform | Best Pick Logic |
|----------|----------------|
| JD | Brand flagship self-operated store → lowest price → highest rating. Rating <95% flagged. |
| Taobao | Tmall only. Brand flagship store priority → lowest price → highest sales. |
| PDD | Brand name match priority → lowest price → highest sales. Irrelevant results filtered out. |

### Link Resolution Strategy

| Scenario | JD | Taobao/Tmall | PDD |
|----------|-----|-------------|-----|
| APP share link | Extract name from 「」 | API lookup → fallback 「」 | Prompt user to copy title |
| PC link | Prompt user to copy title | Prompt user to copy title | N/A |

## License

MIT
