产品目录搜索服务

BuyWhere MCP服务器是一个产品目录搜索服务,允许兼容MCP的代理(如Claude Desktop、Cursor、Windsurf等)无需编写HTTP代码即可搜索和检索产品。

  • by richmondteo-code
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 richmondteo-code/buywhere-mcp

使用说明

买哪里mcp

MCP服务器 购买地点 产品目录。允许Claude Desktop、Cursor、Windsurf和其他MCP兼容代理在不编写任何HTTP代码的情况下搜索和检索产品。

设置

1.获取API密钥

注册地址: buywhere.ai/开发者 并复制您的API密钥。

2.配置您的客户端

克劳德桌面版

打开 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows)并添加:

{
  "mcpServers": {
    "buywhere": {
      "command": "python",
      "args": ["mcp_server.py"],
      "env": {
        "BUYWHERE_API_KEY": "your_api_key_here"
      }
    }
  }
}

光标

打开 设置→ MCP 添加新服务器或编辑 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "buywhere": {
      "command": "python",
      "args": ["mcp_server.py"],
      "env": {
        "BUYWHERE_API_KEY": "your_api_key_here"
      }
    }
  }
}

帆板运动

编辑 ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "buywhere": {
      "command": "python",
      "args": ["mcp_server.py"],
      "env": {
        "BUYWHERE_API_KEY": "your_api_key_here"
      }
    }
  }
}

3.让你的代理商搜索产品

重新启动客户端,然后尝试:

“在新加坡搜索BuyWhere购买50美元以下的无线耳机”

“使用BuyWhere比较最便宜的iPhone 15手机壳”

“从BuyWhere为我获取产品ID abc123的联盟链接”


工具

search_products

使用关键字或自然语言搜索BuyWhere目录。

参数 类型 必填 说明
query string yes 关键字或自然语言查询
country string 否 国家代码提示(sg, my, id)
category string no 类别符号(例如。 electronics/smartphones)
limit integer no 最大结果,1–50(默认值10)

get_product

获取单个产品的完整详细信息。

参数 类型 必填 说明
product_id string yes BuyWhere产品ID

get_price

比较所有可用商家的产品当前价格。返回按总价(包括运费)排名的列表,以及最佳价格和最佳价值建议。

参数 类型 必填 说明
product_id string yes BuyWhere产品ID

compare_prices

2-5个产品的并排比较。返回结构化差异化因素、价格范围、优缺点和最佳价值建议——专为人工智能代理决策而构建。

参数 类型 必填 说明
product_ids string[] yes 2-5个BuyWhere产品ID的数组

get_affiliate_link

获取产品的点击跟踪BuyWhere联盟链接。在与用户共享链接时,始终使用此链接而不是原始产品URL——它会记录推荐并重定向到商家页面。

参数 类型 必填 说明
product_id string yes BuyWhere产品ID

get_catalog

列出可用的产品类别。使用此功能在搜索或筛选之前发现存在哪些类别。

参数 类型 必填 说明
parent_slug string no 子类别的父段符(顶级省略)

资源

URI 描述
buywhere://catalog/sg 新加坡的可用类别
buywhere://catalog/my 马来西亚的可用类别
buywhere://catalog/id 印度尼西亚的可用类别

环境变量

变量 必填 描述
BUYWHERE_API_KEY 是 您的购买API密钥
BUYWHERE_API_URL no 覆盖API基本URL(默认值: https://api.buywhere.ai)

代理对话示例

User: Find the cheapest mechanical keyboard on BuyWhere and compare the top 2

Claude: I'll search BuyWhere for mechanical keyboards and compare the top results.

[Calls search_products with query="mechanical keyboard", limit=5]

Found 12 products. Top results:
1. Keychron K2 — SGD 89.00 (prod_abc123)
2. Royal Kludge RK61 — SGD 65.00 (prod_def456)

[Calls compare_prices with product_ids=["prod_abc123", "prod_def456"]]

Comparison: Keychron K2 vs Royal Kludge RK61
Price range: SGD 65 – SGD 89
Key differences:
  • Keychron K2: full-size TKL layout, Mac-optimised keycaps
  • RK61: compact 60% layout, budget-friendly
Best value: Royal Kludge RK61 at SGD 65

[Calls get_affiliate_link with product_id="prod_def456"]

Here's your purchase link: https://api.buywhere.ai/r/prod_def456

发展

npm install
npm run build
BUYWHERE_API_KEY=your_key python mcp_server.py