Smithery的网页刮刀MCP
用于网络抓取操作的强大MCP(模型上下文协议)服务器,部署在 铁匠铺 -AI代理的编排层。此扩展程序通过自动ChromeDriver管理将任何网站转换为干净、结构化的markdown格式。
🌟 Smithery有售
此MCP服务器是 Smithery市场 随着 7953+技能和扩展 由社区建造。立即部署,将网络抓取功能集成到您的AI代理中。
✨ 特性
- 🚀 高性能:与uv包管理器直接功能集成,实现最佳速度
- 🔄 零配置:具有版本兼容性的自动ChromeDriver管理
- 🌐 智能URL处理:自动添加HTTPS协议并验证URL
- 📝 Markdown转换:将web内容转换为干净、结构化的markdown
- ⚡ 异步操作:使用适当的async/await进行非阻塞web抓取
- 🛡️ 生产就绪:全面的错误处理和优雅的回退
- 🐳 Smithery优化:具有安全最佳实践的容器化部署
📋 先决条件
- Smithery账户 - 在smithery.ai注册
- Python 3.12+ (用于地方发展)
- 紫外线 包管理器
- 谷歌浏览器 (在部署中自动管理)
🚀 Smithery部署
部署到Smithery平台
- 访问 Smithery网刮器MCP
- 点击“部署服务器” 添加到您的代理
- 配置 使用您的首选设置
- 开始刮擦 网站立即!
地方发展```bash
Clone the repository
git clone https://github.com/rockerritesh/scraper-mcp-smithery.git
cd scraper-mcp-smithery
Install dependencies with uv
uv sync
Run the MCP development server
uv run mcp dev server.py
### Python直接使用(开发)```python
from scraper_doc import scrape_website
# Scrape a website
content = scrape_website("https://example.com")
print(content) # Returns markdown formatted content
URL格式要求
- ✅ 支持:
https://example.com,http://example.com - ✅ 自动修复:
example.com→https://example.com - ❌ 无效:格式错误的URL返回描述性错误消息
🏗️ 史密瑟里建筑
集成流程```
Smithery Agent → MCP Protocol → search_web_tool → Chrome/Selenium → Markdown Output
### 平台优势
- **🎯 零设置**:无需基础设施管理即可立即部署
- **📊 监控**:内置健康检查和绩效指标
- **🔗 代理集成**:与Smithery的AI编排无缝连接
- **📈 可扩展性**:基于使用模式的自动缩放
### 关键改进
- **❌ 老的**:具有性能开销的子流程调用
- **✅ 新**:异步执行的直接函数导入
- **🎯 结果**:Smithery平台上的性能提高了约3倍
## 🛠️ 开发与测试
### 局部测试```bash
# Test the scraper directly
uv run python scraper_doc.py https://example.com
# Test with output directory
uv run python scraper_doc.py https://example.com ./output
# Run MCP development server
uv run mcp dev server.py
调试模式```bash
MCP_DEBUG=1 uv run mcp dev server.py
### 依赖关系(由UV管理)
- **mcp\[cli\]** -模型上下文协议框架
- **硒** -Web浏览器自动化
- **网络驱动程序管理器** -自动ChromeDriver管理
- **请求:** -用于图像下载的HTTP客户端
- **python dotenv** -环境变量管理
## 🐛 故障排除
### Smithery常见问题
- **部署超时**:通常自动解析;检查Smithery状态
- **未找到工具**:确保在server.py中正确注册MCP工具
- **内存限制**:大页面可能需要优化(自动处理)
### ChromeDriver问题
由Web驱动程序管理器自动解析,但用于本地开发:```bash
# Clear webdriver cache if needed
rm -rf ~/.wdm/
# Verify Chrome installation
google-chrome --version
📊 Smithery演出
- 🚀 刮擦速度:每页2-5秒
- 💾 内存使用:每次操作约50-100MB
- ⚡ 并行支持:多个异步操作
- 🔄 自动缩放:由Smithery平台处理
🔐 安全特性
- 🛡️ 沙盒执行:Chrome运行时带有安全标志
- 👤 非root用户:增强集装箱安全
- 🔒 URL验证:防止恶意URL处理
- 📊 审计日志:Smithery平台监控
🌐 Smithery集成示例
聊天代理```
Agent: "Can you scrape the latest news from example.com?"
Web Scraper MCP: Scrapes and returns structured content
Agent: "Here's the latest news in markdown format..."
### 在自动化工作流中```
Trigger → Smithery Agent → Web Scraper MCP → Content Analysis → Action
📚 资源
- Smithery平台 -部署和管理MCP服务器
- Smithery文件 -平台指南和API参考
- MCP规范 -协议文件
- 社区不和 -获得帮助并分享想法
📜 许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
🤝 为Smithery生态系统做出贡献
- 分叉此存储库
- 创建要素分支
- Smithery平台上的测试
- 提交拉取请求
- 分享 Smithery社区
🚀 部署于 铁匠铺 · 使用FastMCP、Selenium和UV构建 · 7953+社区扩展的一部分```
This README provides clear setup instructions while highlighting the tool's async capabilities and Smithery integration. The structure follows best practices for developer tools documentation.
```
