这是一个基于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(必需):要抓取的网页的URLformat(可选):保存内容的格式(text, html, markdown)。默认值:markdownadvanced_proxy(可选):使用高级代理以绕过机器人检测。默认值:falseextract_object(可选):指定要提取的数据的对象要通过Smithery自动安装UseScraper for Claude Desktop:
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界面使用'scrape'工具。例如:
{
"name": "scrape",
"arguments": {
"url": "https://example.com",
"format": "markdown"
}
}
为了开发时自动重建:
npm run watch
由于MCP服务器通过stdio通信,调试可能会很困难。我们推荐使用MCP Inspector,它作为一个包脚本可用:
npm run inspector
Inspector会提供一个URL,以便在浏览器中访问调试工具。