Usescraper Mcp Server

Usescraper Mcp Server

🚀 使用UseScraper MCP服务器

这是一个基于 TypeScript 的 MCP 服务器,可借助 UseScraper API 实现网页抓取功能。它仅暴露了一个名为 'scrape' 的工具,却能以多种格式从网页中提取内容。

smithery badge

✨ 主要特性

工具

  • scrape:用于从网页中提取内容。
    • 参数
      • url(必填):待抓取网页的 URL。
      • format(可选):保存内容的格式,支持 texthtmlmarkdown,默认格式为 markdown
      • advanced_proxy(可选):可使用高级代理来规避反爬虫检测,默认值为 false
      • extract_object(可选):用于指定要提取的数据对象。

📦 安装指南

通过 Smithery 安装

若要为 Claude Desktop 自动安装 UseScraper,可通过 Smithery 执行以下命令:

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

手动安装

  1. 克隆仓库:
git clone https://github.com/your-repo/usescraper-server.git
cd usescraper-server
  1. 安装依赖项:
npm install
  1. 构建服务器:
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 服务器通过标准输入输出进行通信,调试可能存在一定挑战。我们推荐使用 MCP Inspector,可通过以下包脚本运行:

npm run inspector

Inspector 会提供一个 URL,你可在浏览器中访问该 URL 来使用调试工具。

  • 0 关注
  • 0 收藏,22 浏览
  • system 提出于 2025-09-22 08:06

相似服务问题

相关AI产品