pinduoduo-mcp
# pinduoduo-mcp
**运行在 Windows 本机的拼多多 MCP 服务,支持 stdio 和 Streamable HTTP,默认只读。**
通过自然语言提出购物需求,由 AI 客户端调用本机浏览器搜索商品、读取详情与图片、核对具体规格及参考价,再组织比较结果。MCP 提供页面数据和筛选能力,需求理解与推荐由客户端完成,服务端无需额外的模型 API Key。
本项目用于非商业学习、技术研究与交流,禁止商用,非拼多多官方产品。
## 功能
| 功能 | 说明 |
|---|---|
| 商品搜索 | 关键词搜索,支持价格范围、标题词和明确多人团筛选 |
| 详情与图片 | 读取商品信息、属性、价格条件及已加载的商品主图 |
| 规格核验 | 读取规格组,核对完整组合、商品身份及对应 SKU |
| 参考价比较 | 关联具体规格价格,保留拼单、优惠条件及费用说明 |
| 推荐模板 | 提供通用购物、猫粮、耳机三个自然语言需求模板 |
| 状态与恢复 | 查询浏览器连接、任务状态及冷却信息,支持受保护的只读恢复 |
| 本机接入 | 标准 stdio,可选带 Bearer 认证的本机 Streamable HTTP |
项目提供 10 个 MCP 工具和 3 个模板。接口及字段说明见 [工具与能力](CAPABILITIES.md)。
## 环境要求
- Windows。
- Node.js 22 或以上。
- 本机 Chrome 或 Edge。
- 支持本地 stdio,或支持本机 Streamable HTTP 的 MCP 客户端。
浏览器由使用者本人登录。每台电脑使用自己的安装目录、浏览器配置和登录会话。
## 快速开始
```powershell
git clone https://github.com/LUNA70612/pinduoduo-mcp.git
Set-Location '.\pinduoduo-mcp'
.\Install.ps1
npm.cmd run browser
```
也可以下载仓库源码 ZIP,解压后在源码目录执行安装命令。安装器按锁文件安装依赖、配置 9 个适配器并生成客户端配置。
在打开的浏览器中人工登录,然后将配置合并到客户端,保留其他 MCP 服务:
| 接入方式 | 配置文件或说明 |
|---|---|
| Codex stdio | `outputs/codex-mcp.generated.toml` |
| mcpServers JSON | `outputs/mcp-config.generated.json` |
| 本机 HTTP | [HTTP 接入指南](http/README.md) |
stdio 客户端每次工具调用预留至少 240 秒;HTTP 客户端建议至少 300 秒。页面操作按默认 90 秒间隔串行执行。
已有项目浏览器和登录会话时,直接复用原窗口与 CDP 绑定。完整安装步骤、配置示例和浏览器绑定方法见 [安装指南](AI-INSTALL.md)。
## 使用示例
客户端加载服务后,保持项目浏览器打开,在新对话中提出需求:
> 用拼多多 MCP 找 200 元以内、安卓通勤用的入耳式耳机。续航优先,兼顾音质,给出 2~3 个有差异的选择,列出具体规格、参考价、价格条件和选择理由。
> 给健康成猫选主粮,预算 200 元,没有特殊饮食限制。比较适用阶段、完整主粮声明、包装规格和元/kg。
客户端依次完成连接检查、搜索、详情读取和完整规格核验,再整理比较结果。每个连接建立自己的搜索来源;新连接先重新搜索。
价格按具体规格比较,拼单、优惠资格和运费分别说明。结果包含页面来源、读取时间及尚未确认的信息。更多示例见 [使用指南](USAGE.md)。
## 工作方式
```text
自然语言需求 → AI 客户端 → MCP 工具 → OpenCLI → 本机浏览器
← 商品、规格、价格与图片 ←
```
商品通过同一连接的正常搜索卡片进入,规格通过可见控件核对。默认关闭写权限,不执行加购、客服发送、下单、结算或支付。登录及验证码由使用者本人处理。
## 文档
- [安装指南](AI-INSTALL.md):安装、配置与浏览器绑定。
- [使用指南](USAGE.md):自然语言需求、搜索策略与比较格式。
- [工具与能力](CAPABILITIES.md):工具、模板与主要字段。
- [规格与价格](docs/SKU-MODEL-PRICE.md):完整规格、型号和价格口径。
- [HTTP 接入](http/README.md):本机认证、客户端配置与会话。
- [开发说明](DEV.md)、[测试指南](TESTING.md)与[贡献规范](CONTRIBUTING.md)。
- [变更记录](CHANGELOG.md)。
## 许可
采用 [PolyForm Noncommercial 1.0.0](LICENSE),仅用于许可允许的非商业用途。分发时保留许可和第三方声明,详见 [中文许可说明](LICENSING.md)与[第三方声明](THIRD-PARTY-NOTICES.md)。
TDQS
Scored across 10 tools
Several tool pairs have soft boundaries: pdd_status vs pdd_resume (both inspect session/runtime state without navigating), pdd_search vs pdd_browse_home (both extract product cards), and pdd_read_item vs pdd_read_sku (both surface price/spec info). The very long descriptions do draw distinctions (e.g. link-as-identifier only, spec-combination requirement), so an agent can recover, but selection still requires careful reading rather than obvious intent.
All ten tools share a uniform pdd_ prefix and are overwhelmingly verb_or_resource + noun (read_item, read_cart, read_sku, add_cart, browse_home, contact_seller). Minor deviations exist where the second segment is a bare noun or verb (pdd_status, pdd_resume, pdd_login), but the pattern remains predictable.
Ten tools is well within the ideal range and each maps to a distinct stage of the shopping loop: status/login/resume for session handling, search/browse/read_item/read_sku for discovery, read_cart/add_cart for cart, contact_seller for communication. No tool looks like filler.
Read coverage is thorough, but the cart surface is write-once: there is pdd_add_cart and pdd_read_cart with no update-quantity, remove-item, or select/deselect tools, and no order placement or order-history tools at all. Some of this is deliberate read-only-by-design, but the lifecycle dead-ends (cannot correct a cart, cannot verify a purchase) will force agents to stop short.