Crawl4AI智能爬虫
STDIO多引擎搜索和LLM优化网页内容提取MCP服务器
多引擎搜索和LLM优化网页内容提取MCP服务器
这是一个基于MCP (Model Context Protocol)的智能信息获取服务器,为AI助手系统提供强大的搜索能力和面向LLM优化的网页内容理解功能。通过多引擎搜索和智能内容提取,帮助AI系统高效获取和理解互联网信息,将网页内容转换为最适合LLM处理的格式。
确保您的系统满足以下要求:
克隆仓库:
git clone https://github.com/yourusername/crawl4ai-mcp-server.git cd crawl4ai-mcp-server
python -m venv crawl4ai_env source crawl4ai_env/bin/activate # Linux/Mac # 或 .\crawl4ai_env\Scripts\activate # Windows
pip install -r requirements.txt
playwright install
通过 Smithery 将 Crawl4AI MCP 的 Claude 桌面端服务安装自动配置至您本地的 Claude 伸展中心:
npx -y @smithery/cli install @weidwonder/crawl4ai-mcp-server --client claude
服务器提供以下工具:
强大的网络搜索工具,支持多个搜索引擎:
参数说明:
query: 搜索查询字符串num_results: 返回结果数量(默认10)engine: 搜索引擎选择
示例:
# DuckDuckGo搜索(默认) { "query": "python programming", "num_results": 5 } # 使用所有可用引擎 { "query": "python programming", "num_results": 5, "engine": "all" }
面向LLM优化的网页内容理解工具,提供智能内容提取和格式转换:
markdown_with_citations: 包含内联引用的Markdown(默认),保持信息溯源fit_markdown: 经过LLM优化的精简内容,去除冗余信息raw_markdown: 基础HTML→Markdown转换references_markdown: 单独的引用/参考文献部分fit_html: 生成fit_markdown的过滤后HTMLmarkdown: 默认Markdown格式示例:
{ "url": "https://example.com", "format": "markdown_with_citations" }
示例:
# DuckDuckGo搜索(默认) { "query": "python programming", "num_results": 5 } # Google搜索 { "query": "python programming", "num_results": 5, "engine": "google" }
如需使用Google搜索,需要在config.json中配置API密钥:
{ "google": { "api_key": "your-api-key", "cse_id": "your-cse-id" } }
服务器采用了一系列针对LLM的内容优化策略:
项目结构:
crawl4ai_mcp_server/
├── src/
│   ├── index.py      # 服务器主实现
│   └── search.py     # 搜索功能实现
├── config_demo.json  # 配置文件示例
├── pyproject.toml    # 项目配置
├── requirements.txt  # 依赖列表
└── README.md        # 项目文档
cp config_demo.json config.json
{ "google": { "api_key": "your-google-api-key", "cse_id": "your-google-cse-id" } }
MIT License
欢迎提交Issue和Pull Request!
感谢所有为项目做出贡献的开发者!
特别感谢: