Skip to main content
Glama

Crawl-MCP: crawl4ai 的非官方 MCP 服务器

⚠️ 重要提示:这是一个针对优秀的 crawl4ai 库的非官方 MCP 服务器实现。 与原 crawl4ai 项目无任何关联。

这是一个全面的模型上下文协议 (MCP) 服务器,它将强大的 crawl4ai 库与先进的 AI 功能相结合。从任何来源提取和分析内容:网页、PDF、Office 文档、YouTube 视频等。具备智能摘要功能,可在保留关键信息的同时大幅减少 Token 使用量。

🌟 核心功能

  • 🔍 Google 搜索集成 - 7 种优化搜索类型,支持 Google 官方搜索指令

  • 🔍 高级网页爬取:支持 JavaScript、深度站点映射、实体提取

  • 🌐 通用内容提取:网页、PDF、Word 文档、Excel、PowerPoint、ZIP 压缩包

  • 🤖 AI 驱动的摘要:智能减少 Token(最高可达 88.5%),同时保留核心信息

  • 🎬 YouTube 集成:无需 API 密钥即可提取视频字幕和摘要

  • ⚡ 生产就绪:19 个专用工具,具备完善的错误处理机制

Related MCP server: Crawl4AI MCP Server

🚀 快速开始

前置要求(必须先完成)

  • Python 3.11 或更高版本(FastMCP 要求 Python 3.11+)

安装 Playwright 的系统依赖:

Ubuntu 24.04 LTS (需要手动操作):

# Manual setup required due to t64 library transition
sudo apt update && sudo apt install -y \
  libnss3 libatk-bridge2.0-0 libxss1 libasound2t64 \
  libgbm1 libgtk-3-0t64 libxshmfence-dev libxrandr2 \
  libxcomposite1 libxcursor1 libxdamage1 libxi6 \
  fonts-noto-color-emoji fonts-unifont python3-venv python3-pip

python3 -m venv venv && source venv/bin/activate
pip install playwright==1.55.0 && playwright install chromium
sudo playwright install-deps

其他 Linux/macOS:

sudo bash scripts/prepare_for_uvx_playwright.sh

Windows (以管理员身份运行):

scripts/prepare_for_uvx_playwright.ps1

安装

UVX (推荐 - 最简单):

# After system preparation above - that's it!
uvx --from git+https://github.com/walksoda/crawl-mcp crawl-mcp

Docker (生产就绪):

# Clone the repository
git clone https://github.com/walksoda/crawl-mcp
cd crawl-mcp

# Build and run with Docker Compose (STDIO mode)
docker-compose up --build

# Or build and run HTTP mode on port 8000
docker-compose --profile http up --build crawl4ai-mcp-http

# Or build manually
docker build -t crawl4ai-mcp .
docker run -it crawl4ai-mcp

Docker 功能:

  • 🔧 多浏览器支持:Chromium、Firefox、Webkit 无头浏览器

  • 🐧 Google Chrome:包含额外的 Chrome Stable 以保证兼容性

  • ⚡ 性能优化:预配置了 Docker 浏览器标志

  • 🔒 安全性:非 root 用户执行

  • 📦 完整依赖:包含所有必需的库

Claude Desktop 设置

UVX 安装: 添加到你的 claude_desktop_config.json:

{
  "mcpServers": {
    "crawl-mcp": {
      "transport": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/walksoda/crawl-mcp",
        "crawl-mcp"
      ],
      "env": {
        "CRAWL4AI_LANG": "en"
      }
    }
  }
}

Docker HTTP 模式:

{
  "mcpServers": {
    "crawl-mcp": {
      "transport": "http",
      "baseUrl": "http://localhost:8000"
    }
  }
}

针对日语界面:

"env": {
  "CRAWL4AI_LANG": "ja"
}

📖 文档

主题

描述

安装指南

各平台的完整安装说明

API 参考

完整的工具文档和使用示例

配置示例

针对特定平台的设置配置

HTTP 集成

HTTP API 访问和集成方法

高级用法

高级用户技巧和工作流

开发指南

贡献和开发环境设置

语言特定文档

🛠️ 工具概览

网页爬取 (3)

  • crawl_url - 提取支持 JavaScript 的网页内容

  • deep_crawl_site - 以可配置的深度爬取站点中的多个页面

  • crawl_url_with_fallback - 针对反爬虫站点使用回退策略进行爬取

数据提取 (3)

  • intelligent_extract - 使用 LLM 从网页中提取特定数据

  • extract_entities - 从网页中提取实体(电子邮件、电话等)

  • extract_structured_data - 使用 CSS 选择器或 LLM 提取结构化数据

YouTube (4)

  • extract_youtube_transcript - 提取带时间戳的 YouTube 字幕

  • batch_extract_youtube_transcripts - 从多个 YouTube 视频中提取字幕(最多 3 个)

  • get_youtube_video_info - 获取 YouTube 视频元数据和字幕可用性

  • extract_youtube_comments - 提取带分页的 YouTube 视频评论

搜索 (4)

  • search_google - 使用类型过滤进行 Google 搜索

  • batch_search_google - 执行多次 Google 搜索(最多 3 次)

  • search_and_crawl - 搜索 Google 并爬取搜索结果前几名

  • get_search_genres - 获取可用的搜索类型

文件处理 (3)

  • process_file - 将 PDF、Word、Excel、PowerPoint、ZIP 转换为 Markdown

  • get_supported_file_formats - 获取支持的文件格式和功能

  • enhanced_process_large_content - 使用分块和 BM25 过滤处理大型内容

批量操作 (2)

  • batch_crawl - 使用回退策略爬取多个 URL(最多 3 个 URL)

  • multi_url_crawl - 基于模式配置的多 URL 爬取(最多 5 个 URL 模式)

💾 将大型结果持久化到磁盘 (token-saver)

所有信息收集工具都接受一个可选的 output_path 参数,该参数将获取到的完整内容直接写入磁盘,并仅返回精简的元数据响应。这使得 LLM 可以获取巨大的页面、长篇 YouTube 字幕或整个批次的内容,而不会耗尽其上下文预算——仅在需要时从保存的文件中读取。

工作原理:

  • 单文件工具(如 crawl_url、extract_youtube_transcript)写入一个 .md 文件(或 JSON 类工具写入 .json)——传入绝对文件路径;如果省略扩展名,则会自动添加。除非设置 overwrite=true,否则拒绝覆盖现有的常规文件。

  • 批量工具(batch_crawl、multi_url_crawl、deep_crawl_site、search_and_crawl、batch_extract_youtube_transcripts)期望一个绝对目录路径,并为每个 URL 写入一个 .md 文件以及一个 index.json。任何不存在的路径都会被视为目录并创建——包括包含点号的名称,如 /tmp/run.v1。如果路径已作为常规文件存在,则调用被拒绝。batch_crawl / multi_url_crawl 保留其 list 返回形状,并在每个成功项上嵌入 output_file 键。

  • 请求字典工具(search_google、batch_search_google、search_and_crawl、batch_extract_youtube_transcripts)直接从其请求字典中读取持久化键。

  • 通用参数:output_path(绝对路径;None 或 "" 跳过持久化)、include_content_in_response(默认为 false——当为 true 时,内容也会包含在响应中,仍受任何 content_limit/content_offset/max_content_per_page 切片限制)、overwrite(默认为 false)。

  • 写入操作是每个文件原子的(临时文件 + os.replace);父目录会自动创建;完整的未切片负载在任何切片或工具内部截断之前被持久化,因此即使响应被切片,磁盘上的副本也始终是完整的。

  • 批量字典工具(deep_crawl_site、search_and_crawl、batch_extract_youtube_transcripts)会跳过对报告 success=false 的项进行持久化;这些项仍会出现在 index.json 中,且 file: null,以便调用者可以分析尝试列表。

Markdown 单文件示例:

{
  "tool": "crawl_url",
  "arguments": {
    "url": "https://example.com/long-article",
    "output_path": "/tmp/crawl_out/article.md"
  }
}

JSON 结构化提取(自动添加扩展名):

{
  "tool": "extract_structured_data",
  "arguments": {
    "url": "https://example.com/products",
    "extraction_type": "css",
    "css_selectors": {"price": ".price", "name": "h1"},
    "output_path": "/tmp/crawl_out/products"
  }
}

批量目录模式:

{
  "tool": "batch_crawl",
  "arguments": {
    "urls": ["https://a.example", "https://b.example"],
    "output_path": "/tmp/crawl_out/batch_run1"
  }
}

每个持久化的 Markdown 文件开头都有一个 YAML 前置元数据块,包含 url、title、fetched_at 和 source_tool,以便工件具有自描述性。

🎯 常见用例

内容研究:

search_and_crawl → extract_structured_data → analysis

文档挖掘:

deep_crawl_site → batch processing → extraction

媒体分析:

extract_youtube_transcript → summarization workflow

站点映射:

batch_crawl → multi_url_crawl → comprehensive data

🚨 快速故障排除

安装问题:

  1. 以适当的权限重新运行安装脚本

  2. 尝试开发安装方法

  3. 检查是否安装了浏览器依赖

性能问题:

  • 对于 JavaScript 繁重的站点,使用 wait_for_js: true

  • 增加加载缓慢页面的超时时间

  • 使用 extract_structured_data 进行针对性提取

配置问题:

  • 检查 claude_desktop_config.json 中的 JSON 语法

  • 验证文件路径是否为绝对路径

  • 配置更改后重启 Claude Desktop

🏗️ 项目结构

  • 原始库:crawl4ai (作者: unclecode)

  • MCP 封装:本仓库 (walksoda)

  • 实现:非官方第三方集成

📄 许可证

本项目是 crawl4ai 库的非官方封装。请参阅原始的 crawl4ai 许可证 以了解底层功能。

🤝 贡献

请参阅我们的 开发指南 以获取贡献准则和开发设置说明。

🔗 相关项目

Available Tools

21 tools
batch_crawlBatch CrawlA

Crawl multiple URLs with fallback. Max 3 URLs per call. Use output_path (directory) to persist full per-URL markdown + index.json; the return shape stays a list, each success item gets an output_file key.

Inputs: urls (required), overwrite, output_path, wait_for_js, +4 more. Returns: result

batch_extract_youtube_transcriptsBatch Extract YouTube TranscriptsB
Read-only

Extract transcripts from multiple YouTube videos. Max 3 URLs per call. Supply output_path (directory) in the request to persist per-video markdown files + index.json and receive a slim response.

Inputs: request (required). Returns: object

batch_search_googleBatch Search GoogleA
Read-only

Deprecated alias of batch_search_web (same request keys and results). Use batch_search_web.

Inputs: request (required). Returns: object

batch_search_webBatch Search WebA
Read-only

Perform multiple web searches. Max 3 queries per call. Supply output_path in the request to persist the full result set to disk as JSON and receive a slim response.

Inputs: request (required). Returns: object

crawl_urlCrawl URLA

Extract web page content with JavaScript support. Use wait_for_js=true for SPAs. Use content_offset/content_limit to paginate the response. Use output_path to persist the full unsliced content to disk as markdown and receive a slim metadata-only response.

Inputs: url (required), timeout, overwrite, output_path, +12 more. Returns: object

crawl_url_with_fallbackCrawl URL with FallbackA
Read-only

Crawl with fallback strategies for anti-bot sites. Use content_offset/content_limit to paginate the response. Use output_path to persist the full unsliced content to disk as markdown and receive a slim response.

Inputs: url (required), timeout, overwrite, output_path, +10 more. Returns: object

deep_crawl_siteDeep Crawl SiteB
Read-only

Crawl multiple pages from a site with configurable depth. Use output_path (directory) to persist per-URL markdown files + index.json; the response is then slimmed to metadata only.

Inputs: url (required), max_depth, max_pages, overwrite, +8 more. Returns: object

enhanced_process_large_contentEnhanced Process Large ContentC
Read-only

Process large content with chunking and BM25 filtering. Use output_path to persist chunks + summaries to disk as JSON and receive a slim response.

Inputs: url (required), overwrite, output_path, filter_query, +10 more. Returns: object

extract_entitiesExtract EntitiesB
Read-only

Extract entities (emails, phones, etc.) from web pages. Use output_path to persist the full entity extraction output to disk as JSON and receive a slim response.

Inputs: url (required), entity_types (required), use_llm, llm_model, +7 more. Returns: object

extract_structured_dataExtract Structured DataC
Read-only

Extract structured data using CSS selectors or LLM. Use output_path to persist the full extraction (including table_data) to disk as JSON and receive a slim response.

Inputs: url (required), timeout, overwrite, output_path, +8 more. Returns: object

extract_youtube_commentsExtract YouTube CommentsA
Read-only

Extract YouTube video comments. Supports pagination via comment_offset. Use output_path to persist the full unsliced comment list to disk as JSON; the response is then slimmed to metadata only.

Inputs: url (required), sort_by, overwrite, output_path, +6 more. Returns: object

extract_youtube_transcriptExtract YouTube TranscriptA
Read-only

Extract YouTube transcripts with timestamps. Works with public captioned videos. Supports fallback to page crawl. Use output_path to persist the full unsliced transcript to disk as markdown.

Inputs: url (required), timezone, languages, llm_model, +16 more. Returns: object

get_search_genresGet Search GenresB
Read-only

Get available search genres for targeted searching.

Inputs: no named parameters. Returns: object

get_supported_file_formatsGet Supported File FormatsA
Read-only

Get supported file formats (PDF, Office, ZIP) and their capabilities.

Inputs: no named parameters. Returns: object

get_youtube_video_infoGet YouTube Video InfoA
Read-only

Get YouTube video metadata and transcript availability. Use output_path to persist the video info to disk as markdown and receive a slim response.

Inputs: video_url (required), timezone, llm_model, overwrite, +7 more. Returns: object

intelligent_extractIntelligent ExtractB
Read-only

Extract specific data from web pages using LLM. Use output_path to persist the full extraction output to disk as JSON and receive a slim response.

Inputs: url (required), extraction_goal (required), use_llm, llm_model, +8 more. Returns: object

multi_url_crawlMulti-URL CrawlB
Read-only

Multi-URL crawl with pattern-based config. Max 5 URL patterns per call. Use output_path (directory) to persist full per-URL markdown + index.json; the return shape stays a list, each success item gets an output_file key.

Inputs: url_configurations (required), overwrite, output_path, base_timeout, +4 more. Returns: result

process_fileProcess FileA
Read-only

Convert PDF, Word, Excel, PowerPoint, ZIP to markdown. A refused download is retried in a headless browser; error_code download_blocked means the site serves the file to neither, and not_a_document means the URL is a web page (use crawl_url). Use output_path to persist the full unsliced converted markdown to disk and receive a slim response.

Inputs: url (required), llm_model, overwrite, max_size_mb, +10 more. Returns: object

search_and_crawlSearch and CrawlB
Read-only

Search the web (engine as in search_web) and crawl top results. Combines search with full content extraction. Supply output_path (directory) in the request to persist per-page markdown (unsliced) + index.json and receive a slim response.

Inputs: request (required). Returns: object

search_googleSearch GoogleA
Read-only

Deprecated alias of search_web (same request keys and results; the engine is not limited to Google). Use search_web.

Inputs: request (required). Returns: object

search_webSearch WebA
Read-only

Search the web with Google Custom Search, Brave, Exa, SearXNG or TinyFish (engine key, or the server default). Optional search_genre filtering (file types or language; see get_search_genres). Supply output_path in the request to persist the full unsliced result set to disk as JSON and receive a slim response.

Inputs: request (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 21 tools

    Disambiguation3/5

    Several tools have overlapping purposes: crawl_url vs crawl_url_with_fallback, batch_crawl vs multi_url_crawl (both multi-URL with output_path), and intelligent_extract vs extract_structured_data (the latter also supports LLM). Deprecated aliases (search_google, batch_search_google) add further confusion even though descriptions redirect to the canonical tools.

    Naming Consistency3/5

    All names are snake_case, but verb conventions are mixed: crawl_url, deep_crawl_site, multi_url_crawl, batch_crawl, enhanced_process_large_content, and get_* variants don't follow a single predictable pattern. The deprecated *_google aliases also break the search_web naming family.

    Tool Count3/5

    21 tools is on the heavy side for this surface. Several earn their place (crawl, extract, YouTube, file processing), but deprecated aliases and near-duplicate crawl variants inflate the count without adding distinct capability.

    Completeness4/5

    The domain is broad (web search, single/batch/deep crawling, structured extraction, YouTube transcripts/comments/info, file conversion, large-content processing) and the surface covers most of it. Minor gaps like sitemap-aware crawling or explicit cache/robots handling are workable.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A locally-hosted MCP server that provides AI assistants with advanced web crawling capabilities, including structured data extraction, deep site crawling, and page screenshots. It enables users to convert single or multiple URLs into clean Markdown content for processing by LLMs without requiring external API keys for basic features.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server integrating Crawl4AI for universal web crawling and data extraction. Enables AI agents to crawl, extract markdown/HTML, take screenshots, generate PDFs, and execute JavaScript on web pages.
      45 npm
      7
      MIT