使用说明
UseScraper MCP服务器
这是一个基于类型脚本的MCP服务器,使用UseScraper API提供web抓取功能。它公开了一个单一的工具“抓取”,可以从各种格式的网页中提取内容。
特性
工具
scrape-从网页中提取内容- 参数:
url(必填):要抓取的网页的URLformat(可选):保存内容的格式(文本、html、markdown)。默认值:markdownadvanced_proxy(可选):使用高级代理来规避机器人检测。默认值:falseextract_object(可选):指定要提取的数据的对象
- 参数:
安装
通过Smithery安装
通过以下方式自动安装克劳德桌面版UseScraper 史密瑟里:
npx -y @smithery/cli install usescraper-server --client claude
手动安装
-
克隆存储库:
git clone https://github.com/your-repo/usescraper-server.git cd usescraper-server -
安装依赖项:
npm install -
构建服务器:
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界面使用“刮擦”工具。示例用法:
{
"name": "scrape",
"arguments": {
"url": "https://example.com",
"format": "markdown"
}
}
发展
对于自动重建的开发:
npm run watch
调试
由于MCP服务器通过stdio进行通信,调试可能具有挑战性。我们建议使用 MCP检查员,可作为包脚本使用:
npm run inspector
检查器将提供一个URL,用于访问浏览器中的调试工具。
