A server for web crawling and content extraction using the Crawl4AI library.
一个基于 Crawl4AI 的下一代 Model Context Protocol (MCP) 服务器,为 Amazon Q Developer 和其他 AI 工具提供强大的网页爬取和智能研究功能。
crawl_with_intelligence
- 智能网页爬取,支持搜索引擎结果页面smart_research_v6
- 基于搜索的深度研究助手configure_search_engines
- 搜索引擎配置管理analyze_search_intent
- 用户意图分析和解释v6_system_status
- V6 系统状态监控research_anything_v5
- 主力研究工具,支持所有模式research_quick_v5
- 3-8秒快速研究research_deep_v5
- 30-60秒深度分析research_competitive_v5
- 专业竞争分析crawl
- 基础网页爬取,返回 Markdown 格式crawl_clean
- 智能清理,自动过滤噪音内容crawl_dynamic
- 动态内容处理,支持 JavaScript 渲染crawl_with_selector
- CSS 选择器精确提取crawl_multiple
- 批量爬取多个 URLcrawl_smart_batch
- 智能批量处理,内容类型优化crawl_with_screenshot
- 网页截图 + 内容提取health_check
- 网站可访问性检查包括隐身爬取、地理位置伪装、重试机制、并发优化等专业功能
# 克隆项目
git clone https://github.com/ddipass/context-scraper-mcp-server.git
cd context-scraper-mcp-server
# 使用 uv 安装依赖
uv sync
# 激活虚拟环境
source .venv/bin/activate
# 运行 Crawl4AI 后安装设置
crawl4ai-setup
# 克隆项目
git clone https://github.com/ddipass/context-scraper-mcp-server.git
cd context-scraper-mcp-server
# 安装依赖
pip install -e .
# 安装浏览器依赖
python -m playwright install chromium
# 运行 Crawl4AI 设置
crawl4ai-setup
我们推荐使用 uv - 这是一个用 Rust 构建的现代 Python 包管理器,它:
# 使用 uv (推荐)
uv run --with mcp mcp run server.py
# 或使用 pip
python -m mcp run server.py
将以下配置添加到你的 MCP 客户端配置中:
在 .amazonq
目录中创建 mcp.json
文件:
{
"mcpServers": {
"ContextScraper": {
"command": "uv",
"args": ["run", "--with", "mcp", "mcp", "run", "server.py"],
"cwd": "/path/to/context-scraper-mcp-server"
}
}
}
{
"mcpServers": {
"context-scraper": {
"command": "uv",
"args": ["run", "--with", "mcp", "mcp", "run", "server.py"],
"cwd": "/path/to/context-scraper-mcp-server"
}
}
}
启动服务器后,你应该能看到类似以下的输出:
MCP Server running on stdio
V6 支持 Claude 3.7 API 集成,用于高级内容分析功能。
编辑 Claude 配置文件
# 编辑配置文件
nano v6_config/claude_config.json
填入你的 API Key
{
"claude_api": {
"api_key": "你的Claude API Key",
"base_url": "http://Bedroc-Proxy-dZmq8lX6J5TY-92025060.us-west-2.elb.amazonaws.com/api/v1",
"model": "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
"enabled": true,
"timeout": 30,
"max_tokens": 4000,
"temperature": 0.7
}
}
重启服务器使配置生效
python tools/manage_server.py restart
参数 | 说明 | 默认值 |
---|---|---|
api_key | Claude API 密钥 | "" (必填) |
base_url | API 基础URL | Bedrock代理地址 |
model | 使用的模型 | claude-3-7-sonnet |
enabled | 是否启用Claude功能 | false |
timeout | 请求超时时间(秒) | 30 |
max_tokens | 最大token数 | 4000 |
temperature | 生成温度 | 0.7 |
V6 支持多搜索引擎配置,详见 v6_config/search_engines.json
:
{
"google": {
"name": "Google",
"enabled": true,
"priority": 1
},
"baidu": {
"name": "百度",
"enabled": true,
"priority": 2
}
}
项目提供了便捷的服务器管理工具:
# 查看服务器状态
python tools/manage_server.py status
# 停止服务器
python tools/manage_server.py stop
# 启动服务器
python tools/manage_server.py start
# 重启服务器
python tools/manage_server.py restart
严格遵循用户指定的搜索引擎,消除系统偏见:
"用Google搜索最新的AI新闻" → 严格使用Google
"百度搜索Python教程" → 严格使用百度
"用必应查找学术论文" → 严格使用Bing
"DuckDuckGo匿名搜索隐私保护" → 严格使用DuckDuckGo
# 使用crawl_with_intelligence进行搜索
await crawl_with_intelligence("https://www.google.com/search?q=AI新闻")
await crawl_with_intelligence("https://www.baidu.com/s?wd=Python教程")
# 智能研究,通过prompt引导选择搜索引擎
await smart_research_v6("机器学习发展", preferred_engine="google")
# 意图分析 - 了解V6如何理解你的需求
await analyze_search_intent("用Google搜索最新科技新闻")
# 查看所有搜索引擎状态
await configure_search_engines("list")
# 设置默认搜索引擎
await configure_search_engines("set_default", engine="baidu")
# 健康检查
await configure_search_engines("health_check")
# 自动模式 - AI 选择最佳策略
result = await research_anything_v5("分析特斯拉自动驾驶技术", "https://tesla.com")
# 快速模式 - 3-8秒获取核心信息
result = await research_quick_v5("了解公司基本情况", "https://company.com")
# 深度模式 - 30-60秒全面分析
result = await research_deep_v5("市场竞争分析", "https://competitor1.com,https://competitor2.com")
# 竞争分析 - 专业对比研究
result = await research_competitive_v5("产品功能对比", "https://product1.com,https://product2.com")
# 基础网页爬取
result = await crawl("https://example.com")
# CSS 选择器提取
result = await crawl_with_selector("https://example.com", "article, .content")
# 批量处理
result = await crawl_multiple("https://site1.com,https://site2.com,https://site3.com")
# 智能内容过滤
result = await crawl_clean("https://news-site.com/article")
# 动态内容处理
result = await crawl_dynamic("https://spa-app.com", wait_time=5)
# 智能批量处理
result = await crawl_smart_batch("https://shop1.com,https://shop2.com", content_type="product")
# 截图功能
result = await crawl_with_screenshot("https://example.com")
context-scraper-mcp-server/
├── server.py # 🚀 主服务器 (V6)
├── v6_core/ # 🧠 V6 核心模块
│ ├── config_manager.py # ⚙️ 统一配置管理
│ ├── intent_analyzer.py # 🎯 无偏见意图分析
│ └── search_manager.py # 🔍 多搜索引擎管理
├── v6_config/ # 📋 V6 配置文件
│ ├── search_engines.json # 🔧 搜索引擎配置
│ ├── user_preferences.json # 👤 用户偏好设置
│ ├── system_config.json # 🖥️ 系统配置
│ └── claude_config.json # 🤖 Claude API配置
├── docs/ # 📚 文档目录
│ ├── architecture/ # 🏗️ 架构文档
│ ├── development/ # 🔧 开发文档
│ └── versions/ # 📋 版本文档
├── tools/ # 🛠️ 管理工具
│ └── manage_server.py # 🎮 服务器管理
├── legacy/ # 📦 历史版本
│ ├── servers/ # 🗂️ 历史服务器文件
│ ├── tests/ # 🧪 历史测试文件
│ └── configs/ # ⚙️ 历史配置文件
└── README.md # 📖 项目说明
server.py (主服务器)
├── v6_core/
│ ├── config_manager.py # 配置管理 (独立模块)
│ ├── intent_analyzer.py # 意图分析 (独立模块)
│ └── search_manager.py # 搜索管理 (依赖 config_manager + intent_analyzer)
├── v6_config/ # 配置文件 (JSON格式)
│ ├── search_engines.json # 搜索引擎配置
│ ├── user_preferences.json # 用户偏好
│ ├── system_config.json # 系统配置
│ └── claude_config.json # Claude API配置
└── 外部依赖
├── crawl4ai # 网页爬取引擎
├── mcp # Model Context Protocol
├── aiohttp # 异步HTTP客户端
└── beautifulsoup4 # HTML解析
server.py
→ 主入口,集成所有V6功能config_manager.py
→ 被所有模块使用的配置中心intent_analyzer.py
→ 独立的意图分析引擎search_manager.py
→ 依赖配置管理器和意图分析器欢迎提交 Issue 和 Pull Request!
本项目采用 MIT 许可证。
Hyperbrowser is the next-generation platform empowering AI agents and enabling effortless, scalable browser automation.
AI-powered web scraping using the ScrapeGraph AI API. Requires an API key.
Discovers and collects MCP servers from the internet.
AI-powered tools for web scraping, crawling, and browser automation.
A browser screenshot tool to capture scrolling screenshots of webpages using Playwright, with support for intelligent section identification and multiple output formats.
Secure fetch to prevent access to local resources
A server for browser automation using Playwright, providing powerful tools for web scraping, testing, and automation.
Scrape websites with Oxylabs Web API, supporting dynamic rendering and parsing for structured data extraction.
Query financial web tables from sources like iwencai, tdx, and eastmoney using Playwright.
Extracts and transforms webpage content into clean, LLM-optimized Markdown using the Readability algorithm.