返回 MCP 目录
public公开dns本地运行

olx-mcp

OLX MCP服务器是一个基于Playwright的浏览器自动化工具,支持在5个不同国家的OLX域名上搜索商品列表、获取详细信息和卖家信息。

article

README

🚀 OLX MCP Server

为什么要自己在所在地区搜索电子垃圾呢,Claude 可以帮你完成这项工作!这是一款 100% 由人工智能驱动的实用工具。

✨ 主要特性

  • 🌍 多领域支持:可在 5 个 OLX 域名(葡萄牙、波兰、保加利亚、罗马尼亚、乌克兰)上进行搜索。
  • 🔍 搜索列表:支持使用类别、位置、价格范围和排序等过滤器进行搜索。
  • 📋 列表详情:可获取特定列表的详细信息,包括卖家信息。
  • 🎭 浏览器自动化:使用 Playwright 进行可靠的网页数据抓取。

📦 安装指南

📋 Claude 桌面端配置

  1. 找到你的 Claude 桌面端配置文件
    • macOS~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows%APPDATA%\Claude\claude_desktop_config.json
    • Linux~/.config/Claude/claude_desktop_config.json
  2. 将 OLX MCP 服务器添加到你的配置中
{
  "mcpServers": {
    "olx-mcp": {
      "command": "npx",
      "args": ["olx-mcp"]
    }
  }
}
  1. 重启 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(必需):列表的 ID
  • includeImages(默认值:false):是否包含图片 URL
  • includeSellerInfo(默认值: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 文件。

help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端