BAEWATCH
MCP服务器,用于eBay价格研究和交易搜寻。将Claude Code直接连接到易趣的API,这样您就可以研究公平的市场价格并找到可翻转的交易。
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Claude Code │ ←──→ │ BAEWATCH │ ←──→ │ eBay API │
│ │ │ MCP Server │ │ (Internet) │
└─────────────┘ └─────────────┘ └─────────────┘工具
| 工具 | 说明 |
|---|---|
ping | 验证服务器是否正在运行并已连接 |
ebay_status | 检查您的易趣凭据是否已配置(没有API调用) |
test_ebay_connection | 测试与易趣API的实时连接 |
search_sold | 使用价格统计搜索最近出售的房源 |
search_active | 搜索当前包含配送信息的Buy It Now商品列表 |
price_check | 集交易分析于一体的市场价格查询 |
快速开始
1.先决条件
2.克隆和安装
git clone https://github.com/jj70785/baewatch-mcp.git
cd baewatch-mcp
npm install
npm run build3.连接到克劳德代码
claude mcp add baewatch node C:\path\to\baewatch-mcp\dist\index.js重新启动Claude代码,然后使用以下命令进行测试: “使用ping工具”
4.配置易趣凭据
一旦您的易趣开发者帐户获得批准:
copy config\config.example.json config\config.json编辑 config/config.json 使用您的凭据:
{
"ebay": {
"appId": "your-app-id",
"certId": "your-cert-id",
"devId": "your-dev-id",
"refreshToken": "your-refresh-token",
"environment": "production"
},
"defaults": {
"resultsLimit": 10,
"marketplace": "EBAY_US"
}
}然后通过以下方式进行验证:
- “使用ebay_status” --检查配置文件是否已填写所有字段
- “使用test_ebay_connection” -进行真正的API调用以验证密钥是否有效
5.获取您的易趣凭据
- 首选 developer.ebay.com 并登录
- 首选 应用程序访问密钥 并创建密钥集(生产)
- 复制您的 应用程序ID(客户端ID), 证书ID(客户端密码),以及 开发人员ID
- 首选 用户令牌 >选择您的应用程序> 通过您的应用程序从易趣获取令牌
- 保存 刷新令牌 --这在配置文件中
使用示例
配置好易趣凭据后,只需自然地与Claude交谈:
“我在脸书市场上找到了一台售价150美元的戴尔Latitude 7420。这是一笔好交易吗?"
“显示400美元以下的二手iPhone 13列表”
“最近任天堂Switch OLED的售价是多少?”
Claude将自动选择正确的BAEWATCH工具。
项目结构
baewatch-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── tools/
│ │ ├── searchSold.ts # search_sold tool
│ │ ├── searchActive.ts # search_active tool
│ │ └── priceCheck.ts # price_check tool
│ ├── ebay/
│ │ ├── client.ts # eBay API connection & search functions
│ │ ├── auth.ts # OAuth token management
│ │ └── types.ts # TypeScript types
│ └── utils/
│ ├── formatters.ts # Output formatting
│ └── stats.ts # Price statistics
├── config/
│ └── config.example.json # Template for credentials
├── package.json
└── tsconfig.json发展
npm run build # Compile TypeScript to dist/
npm run start # Run the compiled server
npm run dev # Run directly with ts-node (no build step)故障排除
| 问题 | 修复 |
|---|---|
| 克劳德没有看到BAEWATCH | Run claude mcp list 检查。重新添加并重新启动Claude Code。 |
| “找不到配置文件” | 复制 config/config.example.json 到 config/config.json |
| “无效凭据” | 请仔细检查config.json中的appId和certId(无额外空格) |
| “无法访问易趣服务器” | 检查互联网连接,几分钟后重试 |
| “未找到结果” | 尝试使用更简单/更广泛的搜索词 |
| TypeScript构建错误 | 运行 npm run build 并检查错误输出 |
许可证
麻省理工学院
