mcpField
B
BuyWhere MCP

BuyWhere MCP

本地服务
github.com/BuyWhere搜索与检索154 周前更新

关于 BuyWhere MCP

BuyWhere MCP 为购物 Agent 提供多市场商品搜索、价格比较和优惠发现,面向需要接入商品数据的开发者。它通过统一接口提供实时价格与商品信息。

主要功能

  1. 01按关键词、类别和价格搜索商品
  2. 02跨商家比较商品与价格
  3. 03查找优惠和最低可配送价
  4. 04获取商品详情与相似商品
  5. 05浏览类别并提交商品链接

适用场景

  1. 01构建跨市场购物 Agent
  2. 02比较 Lazada、Shopee 和 Amazon 商品
  3. 03查找降价商品与优惠
  4. 04将商品搜索接入 MCP 应用

MCP 相关

作为 MCP 服务,它向客户端提供商品搜索、详情、比较、优惠和类别等工具。支持 stdio,也提供远程 MCP 端点。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"ai-buywhere-buywhere": {
"command": "npx",
"args": [
"-y",
"@buywhere/mcp-server"
],
"env": {
"BUYWHERE_API_KEY": "<BUYWHERE_API_KEY>",
"BUYWHERE_API_URL": "<BUYWHERE_API_URL>"
}
}
}
}
启动命令npx -y @buywhere/mcp-server
需要配置的环境变量
BUYWHERE_API_KEY密钥Your BuyWhere API key for authenticated product catalog requests
BUYWHERE_API_URLOverride the BuyWhere API base URL (default: https://api.buywhere.ai)

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@buywhere/mcp-server0.3.1

工具

5

收录的工具列表 · 更新于 2 周前

参数类型必填说明
qstring否关键词搜索查询
limitinteger否结果数(最大 100,默认值为 20)
domainstring否按商家平台筛选(例如 lazada、shopee、amazon)
offsetinteger否分页偏移量
regionstring否按地区筛选(sea、us、eu、au)
compactboolean否返回经过优化、适合 Agent 使用的紧凑结构,其中包含 structured_specs 和 comparison_attributes
categorystring否按商品类别名称筛选(例如 "Laptops"、"Smartphones"、"Televisions")。用于排除配件并获取实际商品。
max_pricenumber否最高价格
min_pricenumber否最低价格
country_codeenum否按 ISO 国家代码筛选SG | US | VN | TH | MY

详细介绍

BuyWhere MCP Server — 面向 AI Agent 的商品搜索与价格比较

AI Agent 使用 BuyWhere 实时搜索商品、比较价格,并在新加坡和美国商家中发现优惠。

30 秒完成安装

export BUYWHERE_API_KEY=bw_live_xxxx
npx -y @buywhere/mcp-server

可与 Claude Desktop、Cursor、VS Code Copilot、Cline、Windsurf、OpenCode、Codex、Continue.dev 以及任何兼容 MCP 的客户端搭配使用。

获取免费的 API 密钥

或者 3 秒即可获取,无需注册、无需邮箱:POST /v1/auth/register · 旧版表单:buywhere.ai/api-keys

npm 版本 npm 下载量 npm 每周下载量 许可证:MIT Node 版本 TypeScript GitHub 星标 Smithery MCP Registry Hashnode 博客


AI Agent:使用此软件包即可

  • 搜索商品:按关键词、类别或价格范围搜索新加坡、美国、马来西亚、泰国和越南市场的商品
  • 比较商品:通过单次查询比较 Lazada、Shopee、Amazon 和本地零售商的商品
  • 查找优惠:发现优惠并跟踪实时价格,支持多种货币
  • 构建购物 Agent:以编程方式推荐、比较商品并提供商品链接
  • 探索商品目录:查看面向受支持市场的结构化分类体系

通过 Model Context Protocol 为 AI Agent 提供商品搜索 API。专为 AI Agent 电商场景打造,而非店铺管理。

官方 MCP Registry 条目:io.github.BuyWhere/buywhere-mcp

可与 Claude Desktop、Cursor、VS Code Copilot、Cline、Windsurf、OpenCode、Codex、Continue.dev 以及任何兼容 MCP 的客户端搭配使用。还支持 Agent-to-Agent (A2A) 协议。


演示

BuyWhere MCP 在 Claude Desktop 中的演示

44 秒演示:商品搜索、优惠发现、价格比较和多地区支持。

User:   "Find me wireless earbuds under $50 available in Singapore"
Agent:  [calls search_products → returns 5 matching products]

User:   "Compare the top 3"
Agent:  [calls compare_products → side-by-side with best-value pick]

快速开始

3 秒即可获取密钥——无需注册、无需邮箱:

# 1. Register (one call, returns api_key instantly)
curl -X POST https://api.buywhere.ai/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{"agent_name":"your-agent"}'
# → {"api_key":"bw_...","tier":"unverified","rate_limit":{"rpm":20,"daily":1000}}

# 2. Use the key
export BUYWHERE_API_KEY=bw_...
npx -y @buywhere/mcp-server

旧版邮箱注册(60 秒,需手动审批)→ buywhere.ai/api-keys

教程

博客文章

阅读 BuyWhere 工程博客,深入了解 MCP 架构、Agent 商务和生态系统。

也可以关注 BuyWhere 的 Hashnode 博客镜像,在 Hashnode 上阅读相同的工程内容。

工具

工具描述
search_products按关键词、类别、价格和国家搜索目录
get_product按 ID 获取完整商品详情(价格、规格、图片)
compare_products并排比较 2–10 件商品
find_best_price查找不同商家中可配送该商品的最低价商品列表
get_deals获取价格大幅下降的商品
list_categories可用商品类别分类体系
find_similar通过向量相似度查找相似商品
ingest_products提交商品 URL 以导入目录(Agent/商家)
search_products_v2v2 搜索;需要 deliver_to(ISO 国家代码)
get_product_v2按 ID 获取 v2 商品详情
compare_products_v2v2 比较;deliver_to 为可选项
get_deals_v2v2 优惠;需要 deliver_to
find_best_price_v2v2 最优价格;需要 deliver_to

远程 MCP:POST https://api.buywhere.ai/mcp(JSON-RPC 2.0,protocolVersion 2024-11-05,13 个工具)。Glama 列表:https://glama.ai/mcp/servers/BuyWhere/buywhere-mcp

MCP 客户端配置

框架快速入门:

Claude Desktop

添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "buywhere": {
      "command": "npx",
      "args": ["-y", "@buywhere/mcp-server"],
      "env": { "BUYWHERE_API_KEY": "bw_live_xxxx" }
    }
  }
}
Cursor / VS Code / Cline

添加到 MCP 设置文件:

{
  "mcpServers": {
    "buywhere": {
      "command": "npx",
      "args": ["-y", "@buywhere/mcp-server"],
      "env": { "BUYWHERE_API_KEY": "bw_live_xxxx" }
    }
  }
}
Windsurf

添加到 ~/.windsurf/mcp.json:

{
  "mcpServers": {
    "buywhere": {
      "command": "npx",
      "args": ["-y", "@buywhere/mcp-server"],
      "env": { "BUYWHERE_API_KEY": "bw_live_xxxx" }
    }
  }
}
OpenCode / Codex

添加到 opencode.json:

{
  "mcpServers": {
    "buywhere": {
      "command": "npx",
      "args": ["-y", "@buywhere/mcp-server"],
      "env": { "BUYWHERE_API_KEY": "bw_live_xxxx" }
    }
  }
}
Continue.dev (VS Code / JetBrains)

添加到 ~/.continue/config.json:

{
  "experimental": {
    "mcpServers": {
      "buywhere": {
        "command": "npx",
        "args": ["-y", "@buywhere/mcp-server"],
        "env": { "BUYWHERE_API_KEY": "bw_live_xxxx" }
      }
    }
  }
}
Mastra

Mastra 是一个以 TypeScript 为先、原生支持 MCP 的 AI Agent 框架。

npm install @mastra/core @mastra/mcp
import { Mastra } from '@mastra/core';
import { MastraMCPClient } from '@mastra/mcp';

const buywhere = new MastraMCPClient({
  name: 'buywhere',
  server: {
    url: new URL('https://api.buywhere.ai/mcp'),
    requestInit: {
      headers: { 'Authorization': `Bearer ${process.env.BUYWHERE_API_KEY}` },
    },
  },
});

const agent = new Mastra({
  agents: {
    shoppingAgent: {
      instructions: 'You are a shopping assistant. Use BuyWhere to find and compare products.',
      tools: await buywhere.tools(),
    },
  },
});

const result = await agent.agents.shoppingAgent.generate(
  'Find me the best deal on a Sony WH-1000XM5 in Singapore'
);

完整指南:BuyWhere + Mastra 集成

LangChain

通过 MCP 适配器在 LangChain Agent 中使用 BuyWhere 工具:

from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic

async def main():
    async with MultiServerMCPClient({
        "buywhere": {
            "url": "https://api.buywhere.ai/mcp",
            "transport": "streamable_http",
            "headers": {"Authorization": f"Bearer {BUYWHERE_API_KEY}"},
        }
    }) as client:
        tools = await client.get_tools()
        agent = create_react_agent(ChatAnthropic(model="claude-sonnet-4-5"), tools)
        result = await agent.ainvoke({"messages": [("user", "Find the cheapest Sony headphones in Singapore")]})
LlamaIndex

通过 LlamaIndex MCP 客户端连接 BuyWhere:

from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
from llama_index.agent.openai import OpenAIAgent

async def main():
    mcp_client = BasicMCPClient(
        command_or_url="https://api.buywhere.ai/mcp",
        headers={"Authorization": f"Bearer {BUYWHERE_API_KEY}"},
    )
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = mcp_tool_spec.to_tool_list()
    agent = OpenAIAgent.from_tools(tools)
    response = await agent.achat("Compare prices for iPhone 16 Pro across Singapore and US")
CrewAI

通过 MCP 工具集成,在 CrewAI Agent 中使用 BuyWhere:

from crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter

buywhere_server = MCPServerAdapter(
    server_params={
        "url": "https://api.buywhere.ai/mcp",
        "headers": {"Authorization": f"Bearer {BUYWHERE_API_KEY}"},
        "transport": "streamable-http",
    }
)

shopping_agent = Agent(
    role="Shopping Research Analyst",
    goal="Find the best deals across Singapore and US markets",
    tools=[buywhere_server],
)

task = Task(
    description="Find the best price for Sony WH-1000XM5 headphones across all available markets",
    agent=shopping_agent,
    expected_output="Product comparison with prices and merchant links",
)

crew = Crew(agents=[shopping_agent], tasks=[task])
result = crew.kickoff()

配置

变量默认值描述
BUYWHERE_API_KEY(必需)API 密钥(无需注册:POST /v1/auth/register {"agent_name":"<name>"})— 即时返回,无需邮箱验证
BUYWHERE_API_URLhttps://api.buywhere.ai/mcp自定义 API 基础 URL

安装

# Run directly (no install)
npx -y @buywhere/mcp-server

# Install globally
npm install -g @buywhere/mcp-server
buywhere-mcp

使用场景

  • 购物 Agent — 构建可跨市场搜索、比较和推荐商品的 AI Agent
  • 价格比较 — 通过单次查询比较 Lazada、Shopee、Amazon 和本地零售商的多市场价格
  • 发现优惠 — 实时查找性价比最高的商品及其价格和库存
  • 电商自动化 — 将商品搜索集成到任何兼容 MCP 的应用中
  • 跨境商务 — 比较新加坡、美国、马来西亚、泰国和越南市场的价格
  • Agent 间商务 — 通过 A2A 协议在 Agent 之间委派购物任务

架构

Developer's AI Agent (Claude, Cursor, etc.)
  │
  ├── MCP Protocol (stdio)
  │
  ├── @buywhere/mcp-server
  │     ├── search_products(q, category, min_price, max_price, country_code, deliver_to)
  │     ├── get_product(product_id)
  │     ├── compare_products(product_ids[])
  │     ├── find_best_price(product_name, country_code, deliver_to)
  │     ├── get_deals(country_code, deliver_to, category)
  │     ├── list_categories()
  │     ├── find_similar(product_id)
  │     └── ingest_products(urls[])
  │
  └── BuyWhere API (api.buywhere.ai)
        └── Product catalog across SG, US, MY, TH, and VN merchants

开发

git clone https://github.com/BuyWhere/buywhere-mcp.git
cd buywhere-mcp
npm install
npm run build
npm start

为什么选择 BuyWhere?

BuyWhere 是面向 AI Agent 的商品搜索 API。我们将来自新加坡、美国、马来西亚、泰国和越南商家的商品数据汇总到一个适用于 Agent 的界面中 — 无需管理店铺,也无需集成 Shopify。只需实时搜索和比较商品。

  • 一个 API — 覆盖所有市场和零售商
  • 原生支持 Agent — 从第一天起就为 MCP 构建
  • 实时数据 — 实时价格和库存情况
  • 开发者优先 — 无需 SDK,只需添加服务即可

搭配使用效果出色

这些互补的 MCP 软件包可将 BuyWhere 扩展为强大的多工具工作流:

  • @modelcontextprotocol/server-filesystem — 将购物结果和商品调研保存到本地文件系统。与 BuyWhere 搭配使用,可将优惠清单、价格比较和商品规格导出为结构化文件。
  • @supabase/mcp-server-supabase — 在 Supabase 中存储收藏商品、用户偏好和价格提醒。跨 Agent 会话保留购物历史记录。
  • n8n-mcp — 自动化价格监控工作流。构建无代码流程,监控 BuyWhere 价格,并在降价时触发通知。
  • tavily-mcp — 购买前调研商品。使用 Tavily 查找评价和比较信息,再使用 BuyWhere 获取当前价格和购买链接。
  • @playwright/mcp — 对购物 Agent 交互进行端到端测试。在浏览器自动化中验证商品搜索、价格比较和结账流程是否正常运行。

协议

协议支持情况
MCP(Model Context Protocol)完全支持 — 10 个工具,stdio 传输
A2A(Agent-to-Agent)多 Agent 任务委派 — Agent 卡片

参与贡献

请参阅 CONTRIBUTING.md,了解如何报告问题、提交 PR 和提出功能建议。

博客文章

进一步了解 MCP 服务和 BuyWhere 生态系统:

支持

如果你觉得这个项目有用:

  • ⭐ 为仓库点星 — 帮助更多人发现 BuyWhere
  • 🐛 如需报告错误或提出功能请求,请提交 issue
  • 💬 如有问题或想法,请发起讨论
  • 📣 与其他开发 AI Agent 工具的开发者分享

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。