Crawl4AI MCP 智能内容获取服务

Crawl4AI MCP 智能内容获取服务

为开发者提供高效的网页搜索和内容提取服务,优化LLM处理,节省token。

快速入门

特性

  • 强大的多引擎搜索功能
  • 面向LLM的内容提取与优化
  • 支持多种输出格式

安装

  1. 克隆仓库:git clone https://github.com/weidwonder/crawl4ai-mcp-server.git
  2. 创建虚拟环境:
    • python -m venv crawl4ai_env
    • 激活环境:source crawl4ai_env/bin/activate (Linux/Mac) 或 crawl4ai_env\Scripts\activate (Windows)
  3. 安装依赖:pip install -r requirements.txt
  4. 安装Playwright浏览器:playwright install

使用

  • search 功能:执行网络搜索,支持DuckDuckGo和Google。 示例: { "query": "python programming", "num_results": 5 }

  • read_url 功能:提取并转换网页内容为Markdown等格式。 示例: { "url": "https://example.com", "format": "markdown_with_citations" }

配置

如需使用Google搜索,请在 config.json 中配置API密钥:

{
    "google": {
        "api_key": "your-api-key",
        "cse_id": "your-cse-id"
    }
}