article
README
🚀 OLX MCP Server
为什么要自己在所在地区搜索电子垃圾呢,Claude 可以帮你完成这项工作!这是一款 100% 由人工智能驱动的实用工具。
✨ 主要特性
- 🌍 多领域支持:可在 5 个 OLX 域名(葡萄牙、波兰、保加利亚、罗马尼亚、乌克兰)上进行搜索。
- 🔍 搜索列表:支持使用类别、位置、价格范围和排序等过滤器进行搜索。
- 📋 列表详情:可获取特定列表的详细信息,包括卖家信息。
- 🎭 浏览器自动化:使用 Playwright 进行可靠的网页数据抓取。
📦 安装指南
📋 Claude 桌面端配置
- 找到你的 Claude 桌面端配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
- 将 OLX MCP 服务器添加到你的配置中:
{
"mcpServers": {
"olx-mcp": {
"command": "npx",
"args": ["olx-mcp"]
}
}
}
- 重启 Claude 桌面端,以加载新配置。
🔄 替代方案:全局安装
如果你想进行全局安装,请执行以下命令:
npm install -g olx-mcp
然后使用以下配置:
{
"mcpServers": {
"olx-mcp": {
"command": "olx-mcp"
}
}
}
📦 开发环境:从源代码安装
git clone https://github.com/l-margiela/olx-mcp.git
cd olx-mcp
npm install
npm run build
在开发环境中使用以下配置:
{
"mcpServers": {
"olx-mcp": {
"command": "node",
"args": ["/absolute/path/to/olx-mcp/dist/index.js"]
}
}
}
💻 使用示例
基础用法
配置完成后,你可以在 MCP 客户端中使用以下工具:
搜索列表
在任何支持的 OLX 域名上使用各种过滤器搜索列表:
Can you search for "apartments" in "Lisboa" on OLX Portugal with a maximum price of 1000 euros?
Search for "telefon" in "warszawa" on OLX Poland with prices between 100-500 PLN?
参数说明:
domain(必需):OLX 域名('olx.pt', 'olx.pl', 'olx.bg', 'olx.ro', 'olx.ua')query(可选):搜索词category(可选):类别过滤器location(可选):位置过滤器minPrice(可选):最低价格maxPrice(可选):最高价格page(默认值:1):页码limit(默认值:20):每页显示的项目数sortBy(默认值:'relevance'):排序顺序('relevance', 'date', 'price-asc', 'price-desc')
列表详情
获取任何支持的域名上特定列表的详细信息:
Can you get the details for listing "ABC123" from OLX Portugal?
Show me details for listing "XYZ789" from OLX Poland including images?
参数说明:
domain(必需):OLX 域名('olx.pt', 'olx.pl', 'olx.bg', 'olx.ro', 'olx.ua')listingId(必需):列表的 IDincludeImages(默认值:false):是否包含图片 URLincludeSellerInfo(默认值:true):是否包含卖家信息
📚 详细文档
开发脚本
npm run build- 构建 TypeScript 项目npm run dev- 在开发模式下运行,支持热重载npm start- 运行已构建的服务器npm test- 运行测试(如果有)npm run clean- 清理构建产物
故障排除
MCP 检查器
若要调试 MCP 通信,你可以使用 MCP 检查器:
npx @modelcontextprotocol/inspector node dist/index.js
📄 许可证
本项目采用 MIT 许可证,详情请参阅 LICENSE 文件。
微信扫一扫