UseScraper MCP Server

UseScraper MCP Server

site icon
2025.02.17 0
JavaScript网页抓取数据提取浏览器自动化
UseScraper MCP Server 是一个基于 TypeScript 的 MCP 服务器,提供网页抓取功能,使用 UseScraper API 从网页中提取内容。它提供了一个名为 'scrape' 的工具,可以从网页中提取各种格式的内容。
View on GitHub

Overview

基本能力

产品定位

UseScraper MCP Server 是一个专注于网页内容抓取的服务,适用于需要从网页中提取信息的场景。

核心功能

  • 提供 scrape 工具,可以从网页中提取内容
  • 参数:
    • url (必填): 要抓取的网页 URL
    • format (可选): 保存内容的格式 (text, html, markdown)。默认: markdown
    • advanced_proxy (可选): 使用高级代理绕过机器人检测。默认: false
    • extract_object (可选): 指定要提取的数据对象

适用场景

  • 网页内容抓取
  • 数据提取
  • 自动化测试

工具列表

  • scrape: 从网页中提取内容

常见问题解答

  • 调试困难:由于 MCP 服务器通过 stdio 通信,调试可能具有挑战性。建议使用 MCP Inspector 进行调试。

使用教程

使用依赖

  1. 确保已安装 Node.js 和 npm

安装教程

  1. 克隆仓库: bash git clone https://github.com/your-repo/usescraper-server.git cd usescraper-server

  2. 安装依赖: bash npm install

  3. 构建服务器: bash npm run build

配置

要与 Claude Desktop 一起使用,添加服务器配置:

在 MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json 在 Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "usescraper-server": {
      "command": "node",
      "args": ["/path/to/usescraper-server/build/index.js"],
      "env": {
        "USESCRAPER_API_KEY": "your-api-key-here"
      }
    }
  }
}

/path/to/usescraper-server 替换为服务器的实际路径,your-api-key-here 替换为您的 UseScraper API 密钥。

调试方式

npm run inspector

检查器将提供一个 URL,用于在浏览器中访问调试工具。

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。