SC

stgmt/crawl4ai-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

7 stars 6 forks 质量 66 趋势 15MIT

Model Context Protocol (MCP) server for Crawl4AI with HTTP transport, Bearer token authentication, and remote deployment support

概览

- Universal web crawling and data extraction for AI agents. Integrate powerful web scraping capabilities into Claude, ChatGPT, and any MCP-compatible AI assistant. Official Docker image available on Docker Hub: Extract complete content from any webpage. Get clean markdown content from webpages. We welcome contributions! See CONTRIBUTING.md for guidelines. MIT License - see LICENSE file for details. - : https://www.npmjs.com/package/crawl4ai-mcp-sse-stdio - : https://github.com/stgmt/crawl4ai-mcp - : https://hub.docker.com/r/stgmt/crawl4ai-mcp

README

以下为原文 README 节选,完整内容请查看原文。

🕷️ Crawl4AI MCP Server

MCP (Model Context Protocol) server for Crawl4AI - Universal web crawling and data extraction for AI agents.

Integrate powerful web scraping capabilities into Claude, ChatGPT, and any MCP-compatible AI assistant.

📑 Table of Contents

🚀 Quick Start

# Install globally
npm install -g crawl4ai-mcp-sse-stdio

# Run in different modes
npx crawl4ai-mcp --stdio --endpoint https://your-crawl4ai-server.com
npx crawl4ai-mcp --sse --port 3001 --endpoint https://your-crawl4ai-server.com
npx crawl4ai-mcp --http --port 3000 --endpoint https://your-crawl4ai-server.com

# With optional bearer token
npx crawl4ai-mcp --stdio --endpoint https://your-crawl4ai-server.com --bearer-token your-token

With Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "crawl4ai": {
      "command": "npx",
      "args": [
        "crawl4ai-mcp-sse-stdio",
        "--stdio",
        "--endpoint", "https://your-crawl4ai-server.com",
        "--bearer-token", "your-optional-token"
      ]
    }
  }
}

🐳 Docker Usage

Docker Hub

Official Docker image available on Docker Hub:

# Pull and run the official Docker image
docker pull stgmt/crawl4ai-mcp:latest
docker run -p 3000:3000 stgmt/crawl4ai-mcp:latest

Docker Compose

Create a docker-compose.yml:

version: '3.8'
services:
  crawl4ai-mcp:
    image: stgmt/crawl4ai-mcp:latest
    ports:
      - "3000:3000"
    environment:
      - CRAWL4AI_ENDPOINT=https://your-crawl4ai-server.com
      - CRAWL4AI_BEARER_TOKEN=your-optional-token
    restart: unless-stopped

Run with:

docker-compose up -d

🛠️ Available Tools

1. crawl - Full Web Crawling

Extract complete content from any webpage.

{
  "name": "crawl",
  "arguments": {
    "url": "https://example.com",
    "wait_for": "css:.content",
    "timeout": 30000
  }
}

2. md - Markdown Extraction

Get clean markdown content from webpages.

在 GitHub 查看完整 README

安装

npx crawl4ai-mcp-sse-stdio --stdio --endpoint https://your-crawl4ai-server.com --bearer-token your-optional-token
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "crawl4ai": { "command": "npx", "args": [ "crawl4ai-mcp-sse-stdio", "--stdio", "--endpoint", "https://your-crawl4ai-server.com", "--bearer-token", "your-optional-token" ] } } }