代理刮刀MCP服务器
AI代理最受欢迎的实用程序 -通过MCP+REST API进行专业的网页抓取、屏幕截图和内容提取。
  
特性
🌐 清洁内容提取 --从任何网页提取可读文本/标记(如可读性)\ 🎯 结构化报废 --使用CSS选择器提取特定数据\ 📸 截图 --使用Playwright捕获整页或视口屏幕截图\ 🔗 链接提取 --使用可选的正则表达式过滤从页面获取所有链接\ 📋 元数据抽取 --提取标题、描述、Open Graph标签、favicon等\ 🔍 谷歌搜索 --搜索谷歌并以编程方式获取结果
快速开始
MCP配置
添加到MCP设置文件(cline_mcp_settings.json 或类似):
{
"mcpServers": {
"agent-scraper": {
"url": "https://agent-scraper-mcp.onrender.com/mcp"
}
}
}REST API
基本URL: https://agent-scraper-mcp.onrender.com
废弃URL(干净内容)
curl -X POST https://agent-scraper-mcp.onrender.com/api/v1/scrape_url \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/article",
"format": "markdown"
}'答复:
{
"success": true,
"url": "https://example.com/article",
"title": "Article Title",
"content": "# Article Title\n\nClean markdown content...",
"format": "markdown"
}报废结构化数据
curl -X POST https://agent-scraper-mcp.onrender.com/api/v1/scrape_structured \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/product",
"selectors": {
"title": "h1.product-title",
"price": ".price",
"reviews": ".review-text"
}
}'答复:
{
"success": true,
"url": "https://example.com/product",
"data": {
"title": "Product Name",
"price": "$29.99",
"reviews": ["Great product!", "Worth the money"]
}
}屏幕截图URL
curl -X POST https://agent-scraper-mcp.onrender.com/api/v1/screenshot_url \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"width": 1280,
"height": 720,
"full_page": false
}'答复:
{
"success": true,
"url": "https://example.com",
"image": "iVBORw0KGgoAAAANSUhEUgAA...",
"width": 1280,
"height": 720,
"full_page": false
}提取链接
curl -X POST https://agent-scraper-mcp.onrender.com/api/v1/extract_links \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"filter": "https://example.com/blog/.*"
}'提取元数据
curl -X POST https://agent-scraper-mcp.onrender.com/api/v1/extract_meta \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'搜索谷歌
curl -X POST https://agent-scraper-mcp.onrender.com/api/v1/search_google \
-H "Content-Type: application/json" \
-d '{
"query": "python web scraping",
"num_results": 10
}'定价
免费层
- 每个IP每天50个请求
- 包括所有工具
- 无需信用卡
付费层(HTTP 402支付)
免费等级用尽后:
- 报废工具:$0.005/请求(scrape_url、scrape_structured、extract_links、extract_data、search_google)
- 屏幕截图工具:0.01美元/请求(由于计算成本而增加)
使用加密钱包通过HTTP 402付款:
- 钱包地址:
0x8E844a7De89d7CfBFe9B4453E65935A22F146aBB - 包含
X-Payment带有付款证明的标题
工具参考
1. scrape_url
从任何网页中提取干净、可读的内容(如可读性)。
参数:
url(字符串,必填):要抓取的URLformat(字符串,可选):输出格式--text,markdown,或html(默认值:markdown)
退货: {success, url, title, content, format}
______________________________________________________________________
2. scrape_structured
使用CSS选择器提取特定数据。
参数:
url(字符串,必填):要抓取的URLselectors(对象,必填):骰子name → CSS selector
退货: {success, url, data}
选择器示例:
{
"title": "h1.post-title",
"author": ".author-name",
"price": "span.price",
"images": "img.product-image"
}______________________________________________________________________
3. screenshot_url
捕获任何网页的屏幕截图。
参数:
url(字符串,必填):截图URLwidth(int,可选):视口宽度(默认值:1280)height(int,可选):视口高度(默认值:720)full_page(bool,可选):捕获完整的可滚动页面(默认值:false)
退货: {success, url, image, width, height, full_page}
图像是base64编码的PNG。
______________________________________________________________________
4. extract_links
从网页中提取所有链接。
参数:
url(字符串,必填):要抓取的URLfilter(字符串,可选):用于过滤URL的正则表达式模式
退货: {success, url, links, count}
链接数组包含 {text, href} 物体。
______________________________________________________________________
5. extract_meta
从网页中提取元数据。
参数:
url(字符串,必填):要抓取的URL
退货: {success, url, meta}
元对象包括:
title:页面标题description:元描述canonical:规范URLfavicon:收藏夹URLog:打开图形标记twitter:推特卡标签
______________________________________________________________________
6. search_google
搜索谷歌并获得结果。
参数:
query(字符串,必填):搜索查询num_results(int,可选):结果数(默认值:10)
退货: {success, query, results, count}
结果数组包含 {title, url, snippet} 物体。
______________________________________________________________________
发展
本地设置
# Clone repo
git clone https://github.com/aparajithn/agent-scraper-mcp.git
cd agent-scraper-mcp
# Install dependencies
pip install -e ".[dev]"
# Install Playwright browsers
playwright install chromium --with-deps
# Run server
uvicorn src.main:app --reload --port 8080测试MCP协议
# Initialize
curl -X POST http://localhost:8080/mcp -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}'
# List tools
curl -X POST http://localhost:8080/mcp -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
# Call scrape_url
curl -X POST http://localhost:8080/mcp -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"scrape_url","arguments":{"url":"https://example.com","format":"markdown"}}}'码头工人
# Build
docker build -t agent-scraper-mcp .
# Run
docker run -p 8080:8080 -e PUBLIC_HOST=localhost agent-scraper-mcp部署
部署于 渲染 (免费等级):
- 服务:
agent-scraper-mcp - 运行时:Docker
- 地区:俄亥俄州
- 从GitHub自动部署:
aparajithn/agent-scraper-mcp
环境变量:
PUBLIC_HOST:agent-scraper-mcp.onrender.comX402_WALLET_ADDRESS:0x8E844a7De89d7CfBFe9B4453E65935A22F146aBB
技术栈
- Python 3.11 --现代async/await
- 快速API -REST API框架
- FastMCP --MCP协议实现(流式HTTP)
- 剧作家 --屏幕截图的浏览器自动化
- httpx --快速异步HTTP客户端
- 美丽的Soup4 --HTML解析
- 可读性lxml --内容提取(如Firefox阅读器视图)
许可证
MIT许可证——见 许可证 了解详情。
支持
- 问题:
- 电子邮件:support@agent-scraper.com
- 文件: https://agent-scraper-mcp.onrender.com/docs
______________________________________________________________________
由AI工程师为AI代理构建 🤖
