The Scrapy MCP Server is a robust, enterprise-grade web scraping platform that offers comprehensive data extraction capabilities for commercial use.
Core Scraping Capabilities:
Multiple scraping methods: HTTP requests, Scrapy framework, Selenium, or Playwright with intelligent method selection
Concurrent processing: Scrape multiple URLs simultaneously with exponential backoff retry mechanisms
JavaScript support: Fully render dynamic, JavaScript-heavy websites using complete browser rendering
Advanced data extraction: Configure flexible extraction rules using simple or advanced selectors, or automatically extract structured data like contact information, social media links, product details, and addresses
Link extraction: Specialized link extraction with domain filtering and internal/external link options
Form interaction: Automatically fill and submit various form types including text inputs, checkboxes, and file uploads
Anti-Detection & Performance:
Stealth techniques: Bypass anti-bot measures using undetected-chromedriver, Playwright stealth, random User-Agent rotation, and proxy support
Performance optimization: In-memory caching, rate limiting, and intelligent request handling to prevent server overload
Monitoring tools: Track server metrics including request counts, success rates, cache statistics, and detailed performance monitoring
Enterprise Features:
Ethical compliance: Check robots.txt files for responsible data collection
Error handling: Robust error classification and handling mechanisms
Cache management: Clear scraping results cache and manage server resources
Provides web scraping capabilities using the Scrapy framework for large-scale data extraction, with support for concurrent requests, custom pipelines, and advanced crawling features.
Enables browser automation and JavaScript-heavy website scraping through Selenium WebDriver, with support for form filling, element waiting, and dynamic content extraction.
Scrapy MCP Server
一个基于 Scrapy 和 FastMCP 构建的强大、稳定的网页爬取 MCP Server,专为商业环境中的长期使用而设计。
系统要求: Python 3.12 或更高版本
🚀 特性
核心功能
- 多种爬取方法: 支持简单 HTTP 请求、Scrapy 框架和浏览器自动化
- 智能方法选择: 自动选择最适合的爬取方法
- 并发处理: 支持多个 URL 的并发爬取
- 配置化提取: 灵活的数据提取配置系统
高级功能
- 反反爬虫: 使用 undetected-chromedriver 和 Playwright 的隐身技术
- 表单处理: 自动填写和提交各种类型的表单
- JavaScript 支持: 完整的浏览器渲染支持
- 智能重试: 指数退避重试机制
- 结果缓存: 内存缓存提升性能
企业级特性
- 错误处理: 完善的错误分类和处理
- 性能监控: 详细的请求指标和统计
- 速率限制: 防止服务器过载
- 代理支持: 支持 HTTP 代理配置
- 随机 UA: 防检测的用户代理轮换
📦 安装
🔧 配置
创建 .env
文件来自定义配置:
🚦 快速开始
启动服务器
MCP Client 配置
在您的 MCP client (如 Claude Desktop) 中添加服务器配置:
方式一:直接命令方式
方式二:通过 uv 启动(推荐)
方式三:从 GitHub 仓库直接安装和运行
方式四:指定 Git Tag 版本(推荐用于生产环境)
通过指定 git tag 可以确保使用特定版本,提高稳定性:
也可以指定其他标签或分支:
方式五:Python 模块方式(使用 uv)
注意事项:
- 将路径替换为您的项目实际路径(示例路径:
/Users/cm.huang/Documents/workspace/projects/aurelius/scrapy-mcp
) - GitHub 仓库地址:
git@github.com:ThreeFish-AI/scrapy-mcp.git
- HTTPS 仓库地址:
https://github.com/ThreeFish-AI/scrapy-mcp.git
- 项目目录名:
scrapy-mcp
- 推荐使用方式二(uv 启动),具有更好的依赖管理和性能
- 方式三适合直接从 GitHub 仓库运行,无需本地克隆
🛠️ 可用工具
1. scrape_webpage
基础网页爬取工具,支持多种方法和自定义提取规则。
参数:
url
: 要爬取的 URLmethod
: 爬取方法 (auto/simple/scrapy/selenium)extract_config
: 数据提取配置 (可选)wait_for_element
: 等待的 CSS 选择器 (Selenium 专用)
示例:
2. scrape_multiple_webpages
并发爬取多个网页。
示例:
3. scrape_with_stealth
使用高级反检测技术爬取网页。
参数:
url
: 目标 URLmethod
: 隐身方法 (selenium/playwright)extract_config
: 提取配置wait_for_element
: 等待元素scroll_page
: 是否滚动页面加载动态内容
示例:
4. fill_and_submit_form
表单填写和提交。
参数:
url
: 包含表单的页面 URLform_data
: 表单字段数据 (选择器:值 对)submit
: 是否提交表单submit_button_selector
: 提交按钮选择器method
: 方法 (selenium/playwright)
示例:
5. extract_links
专门的链接提取工具。
参数:
url
: 目标 URLfilter_domains
: 只包含这些域名的链接exclude_domains
: 排除这些域名的链接internal_only
: 只提取内部链接
示例:
6. extract_structured_data
自动提取结构化数据 (联系信息、社交媒体链接等)。
参数:
url
: 目标 URLdata_type
: 数据类型 (all/contact/social/content)
示例:
7. get_page_info
快速获取页面基础信息。
示例:
8. check_robots_txt
检查网站的 robots.txt 文件。
9. get_server_metrics
获取服务器性能指标和统计信息。
10. clear_cache
清除缓存的爬取结果。
📖 数据提取配置
简单选择器
高级配置
🎯 最佳实践
1. 选择合适的方法
- simple: 静态内容,快速爬取
- scrapy: 大规模爬取,需要高级特性
- selenium: JavaScript 重度网站
- stealth: 有反爬保护的网站
2. 遵守网站规则
- 使用
check_robots_txt
工具检查爬取规则 - 设置合适的延迟和并发限制
- 尊重网站的使用条款
3. 性能优化
- 使用缓存避免重复请求
- 合理设置超时时间
- 监控
get_server_metrics
调整配置
4. 错误处理
- 实施重试逻辑
- 监控错误类别
- 根据错误类型调整策略
🔍 故障排除
常见问题
1. Selenium/Playwright 启动失败
- 确保安装了 Chrome 浏览器
- 检查系统权限和防火墙设置
2. 反爬虫检测
- 使用
scrape_with_stealth
工具 - 启用随机 User-Agent
- 配置代理服务器
3. 超时错误
- 增加
browser_timeout
设置 - 检查网络连接
- 使用更稳定的爬取方法
4. 内存占用过高
- 减少并发请求数
- 清理缓存
- 检查是否有资源泄露
📊 性能指标
使用 get_server_metrics
工具监控:
- 请求总数和成功率
- 平均响应时间
- 错误分类统计
- 方法使用分布
- 缓存命中率
🔒 安全注意事项
- 不要在日志中记录敏感信息
- 使用 HTTPS 代理服务器
- 定期更新依赖包
- 遵守数据保护法规
🤝 贡献
欢迎提交 Issue 和 Pull Request 来改进这个项目。
📄 许可证
MIT License - 详见 LICENSE 文件
📞 支持
如遇问题请提交 GitHub Issue 或联系维护团队。
注意: 请负责任地使用此工具,遵守网站的使用条款和 robots.txt 规则,尊重网站的知识产权。
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
A powerful web scraping MCP server built on Scrapy and FastMCP that supports multiple scraping methods (HTTP, Scrapy, browser automation), anti-detection techniques, form handling, and concurrent crawling. Designed for commercial environments with enterprise-grade features like intelligent retry mechanisms, performance monitoring, and configurable data extraction.
Related MCP Servers
- AsecurityAlicenseAqualityA TypeScript-based MCP server utilizing the UseScraper API to provide web scraping capabilities, allowing users to extract content from webpages in various formats.Last updated -2MIT License
- AsecurityAlicenseAqualityMCP Server enabling integration with Scrapezy to retrieve structured data from websites.Last updated -1217MIT License
- -securityAlicense-qualityA Python-based MCP server that crawls websites to extract and save content as markdown files, with features for mapping website structure and links.Last updated -3MIT License
- AsecurityFlicenseAqualityAn MCP Server for Web scraping and Crawling, built using Crawl4AILast updated -225