返回市场
使用抓取器-mcp服务器

使用抓取器-mcp服务器

作者:tanevanwifferen4 星标更新:2025-02-25

项目介绍

UseScraper MCP Server

smithery 徽章 这是一个基于TypeScript的MCP服务器,使用UseScraper API提供网络抓取功能。它暴露了一个工具'scrape',可以从各种格式的网页中提取内容。

<a href="https://glama.ai/mcp/servers/oqq8he02cy"><img width="380" height="200" src="https://gips0.baidu.com/it/u=1278181274,655404807&fm=3081&app=33081&f=PNG?w=760&h=400" alt="UseScraper Server MCP服务器" /></a>

功能

工具

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

安装

通过Smithery安装

要通过Smithery自动安装UseScraper for Claude Desktop:

npx -y @smithery/cli install usescraper-server --client claude

手动安装

  1. 克隆仓库:

    git clone https://github.com/your-repo/usescraper-server.git
    cd usescraper-server
    
  2. 安装依赖项:

    npm install
    
  3. 构建服务器:

    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密钥。

使用

配置完成后,您可以通过MCP界面使用'scrape'工具。例如:

{
  "name": "scrape",
  "arguments": {
    "url": "https://example.com",
    "format": "markdown"
  }
}

开发

为了开发时自动重建:

npm run watch

调试

由于MCP服务器通过stdio通信,调试可能会很困难。我们推荐使用MCP Inspector,它作为一个包脚本可用:

npm run inspector

Inspector会提供一个URL,以便在浏览器中访问调试工具。