Skip to content
Back to search

crawl4ai-mcp-server

用于提供给本地开发者的 LLM的高效互联网搜索&内容获取的MCP Server, 节省你的token

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/weidwonder--crawl4ai-mcp-server/badge.svg)](/listings/weidwonder--crawl4ai-mcp-server)

HTML

<a href="/listings/weidwonder--crawl4ai-mcp-server"><img src="/api/listings/weidwonder--crawl4ai-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

方式1: 大部分的安装场景

1. 确保您的系统满足以下要求: - Python >= 3.9 - 建议使用专门的虚拟环境

2. 克隆仓库:

git clone https://github.com/yourusername/crawl4ai-mcp-server.git
cd crawl4ai-mcp-server

3. 创建并激活虚拟环境:

python -m venv crawl4ai_env
source crawl4ai_env/bin/activate  # Linux/Mac
# 或
.\crawl4ai_env\Scripts\activate  # Windows

4. 安装依赖:

pip install -r requirements.txt

5. 安装playwright浏览器:

playwright install

方式2: 安装到Claude桌面客户端 via Smithery

通过 [Smithery](https://smithery.ai/server/@weidwonder/crawl4ai-mcp-server) 将 Crawl4AI MCP 的 Claude 桌面端服务安装自动配置至您本地的 `Claude 伸展中心`:

npx -y @smithery/cli install @weidwonder/crawl4ai-mcp-server --client claude

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 203 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/weidwonder-crawl4ai-mcp-server-badge.png)](https://mseep.ai/app/weidwonder-crawl4ai-mcp-server)
  2. # Crawl4AI MCP Server
  3. [![smithery badge](https://smithery.ai/badge/@weidwonder/crawl4ai-mcp-server)](https://smithery.ai/server/@weidwonder/crawl4ai-mcp-server)
  4. 这是一个基于MCP (Model Context Protocol)的智能信息获取服务器,为AI助手系统提供强大的搜索能力和面向LLM优化的网页内容理解功能。通过多引擎搜索和智能内容提取,帮助AI系统高效获取和理解互联网信息,将网页内容转换为最适合LLM处理的格式。
  5. ## 特性
  6. - 🔍 强大的多引擎搜索能力,支持DuckDuckGo和Google
  7. - 📚 面向LLM优化的网页内容提取,智能过滤非核心内容
  8. - 🎯 专注信息价值,自动识别和保留关键内容
  9. - 📝 多种输出格式,支持引用溯源
  10. - 🚀 基于FastMCP的高性能异步设计
  11. ## 安装
  12. ### 方式1: 大部分的安装场景
  13. 1. 确保您的系统满足以下要求:
  14. - Python >= 3.9
  15. - 建议使用专门的虚拟环境
  16. 2. 克隆仓库:
  17. ```bash
  18. git clone https://github.com/yourusername/crawl4ai-mcp-server.git
  19. cd crawl4ai-mcp-server
  20. ```
  21. 3. 创建并激活虚拟环境:
  22. ```bash
  23. python -m venv crawl4ai_env
  24. source crawl4ai_env/bin/activate # Linux/Mac
  25. # 或
  26. .\crawl4ai_env\Scripts\activate # Windows
  27. ```
  28. 4. 安装依赖:
  29. ```bash
  30. pip install -r requirements.txt
  31. ```
  32. 5. 安装playwright浏览器:
  33. ```bash
  34. playwright install
  35. ```
  36. ### 方式2: 安装到Claude桌面客户端 via Smithery
  37. 通过 [Smithery](https://smithery.ai/server/@weidwonder/crawl4ai-mcp-server) 将 Crawl4AI MCP 的 Claude 桌面端服务安装自动配置至您本地的 `Claude 伸展中心`:
  38. ```bash
  39. npx -y @smithery/cli install @weidwonder/crawl4ai-mcp-server --client claude
  40. ```
  41. ## 使用方法
  42. 服务器提供以下工具:
  43. ### search
  44. 强大的网络搜索工具,支持多个搜索引擎:
  45. - DuckDuckGo搜索(默认): 无需API密钥,全面处理AbstractText、Results和RelatedTopics
  46. - Google搜索: 需要配置API密钥,提供精准搜索结果
  47. - 支持同时使用多个引擎获取更全面的结果
  48. 参数说明:
  49. - `query`: 搜索查询字符串
  50. - `num_results`: 返回结果数量(默认10)
  51. - `engine`: 搜索引擎选择
  52. - "duckduckgo": DuckDuckGo搜索(默认)
  53. - "google": Google搜索(需要API密钥)
  54. - "all": 同时使用所有可用的搜索引擎
  55. 示例:
  56. ```python
  57. # DuckDuckGo搜索(默认)
  58. {
  59. "query": "python programming",
  60. "num_results": 5
  61. }
  62. # 使用所有可用引擎
  63. {
  64. "query": "python programming",
  65. "num_results": 5,
  66. "engine": "all"
  67. }
  68. ```
  69. ### read_url
  70. 面向LLM优化的网页内容理解工具,提供智能内容提取和格式转换:
  71. - `markdown_with_citations`: 包含内联引用的Markdown(默认),保持信息溯源
  72. - `fit_markdown`: 经过LLM优化的精简内容,去除冗余信息
  73. - `raw_markdown`: 基础HTML→Markdown转换
  74. - `references_markdown`: 单独的引用/参考文献部分
  75. - `fit_html`: 生成fit_markdown的过滤后HTML
  76. - `markdown`: 默认Markdown格式
  77. 示例:
  78. ```python
  79. {
  80. "url": "https://example.com",
  81. "format": "markdown_with_citations"
  82. }
  83. ```
  84. 示例:
  85. ```python
  86. # DuckDuckGo搜索(默认)
  87. {
  88. "query": "python programming",
  89. "num_results": 5
  90. }
  91. # Google搜索
  92. {
  93. "query": "python programming",
  94. "num_results": 5,
  95. "engine": "google"
  96. }
  97. ```
  98. 如需使用Google搜索,需要在config.json中配置API密钥:
  99. ```json
  100. {
  101. "google": {
  102. "api_key": "your-api-key",
  103. "cse_id": "your-cse-id"
  104. }
  105. }
  106. ```
  107. ## LLM内容优化
  108. 服务器采用了一系列针对LLM的内容优化策略:
  109. - 智能内容识别: 自动识别并保留文章主体、关键信息段落
  110. - 噪音过滤: 自动过滤导航栏、广告、页脚等对理解无帮助的内容
  111. - 信息完整性: 保留URL引用,支持信息溯源
  112. - 长度优化: 使用最小词数阈值(10)过滤无效片段
  113. - 格式优化: 默认输出markdown_with_citations格式,便于LLM理解和引用
  114. ## 开发说明
  115. 项目结构:
  116. ```
  117. crawl4ai_mcp_server/
  118. ├── src/
  119. │ ├── index.py # 服务器主实现
  120. │ └── search.py # 搜索功能实现
  121. ├── config_demo.json # 配置文件示例
  122. ├── pyproject.toml # 项目配置
  123. ├── requirements.txt # 依赖列表
  124. └── README.md # 项目文档
  125. ```
  126. ## 配置说明
  127. 1. 复制配置示例文件:
  128. ```bash
  129. cp config_demo.json config.json
  130. ```
  131. 2. 如需使用Google搜索,在config.json中配置API密钥:
  132. ```json
  133. {
  134. "google": {
  135. "api_key": "your-google-api-key",
  136. "cse_id": "your-google-cse-id"
  137. }
  138. }
  139. ```
  140. ## 更新日志
  141. - 2025.02.08: 添加搜索功能,支持DuckDuckGo(默认)和Google搜索
  142. - 2025.02.07: 重构项目结构,使用FastMCP实现,优化依赖管理
  143. - 2025.02.07: 优化内容过滤配置,提高token效率并保持URL完整性
  144. ## 许可证
  145. MIT License
  146. ## 贡献
  147. 欢迎提交Issue和Pull Request!
  148. ## 作者
  149. - Owner: weidwonder
  150. - Coder: Claude Sonnet 3.5
  151. - 100% Code wrote by Claude. Cost: $9 ($2 for code writing, $7 cost for Debuging😭)
  152. - 3 hours time cost. 0.5 hours for code writing, 0.5 hours for env preparing, 2 hours for debuging.😭
  153. ## 致谢
  154. 感谢所有为项目做出贡献的开发者!
  155. 特别感谢:
  156. - [Crawl4ai](https://github.com/crawl4ai/crawl4ai) 项目提供的优秀网页内容提取技术支持

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.