
maitreyam/web-scraping-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCPの特長 ウェブスクレイピングとLMベースのコンテンツ抽出(Markdown、テキストスニペット、スマート抽出)のためにcrawing4aiサーバー。 AIエージェントの統合用に設計された.
概要
このプロジェクトは、Webスクレイピングとインテリジェントなコンテンツ抽出タスクを実行するライブラリを使用するMCP(Model Context Protocol)サーバーを提供します。 これにより、AIエージェント(Claude、LangChain/LangGraphで構築されたエージェントなど)がWebページとやり取りしたり、コンテンツを検索したり、特定のテキストを検索したり、自然言語の指示に基づいてLMベースの抽出を実行したりすることができます。 ※MCPサーバエンドポイントの作成 * 必須 コアWebクロールと抽出ロジックのため。 * .envファイルでAPIキーを管理するため。 * 必須 コンテナ化されたデプロイメントのために、Pythonと依存関係を束ねる。 * ウェブインタラクションのMCPツールを公開: * rube url:Markdown形式のウェブページのフルコンテンツを取得します。 * extract text by query: クエリに基づいてページ上の特定のテキストスニペットを検索します。 * smart extract:指示に基づいて構造化された情報を抽出するためにLM(現在のGoogle Gemini)を使用してください。 ※環境変数(APIキー)で設定可能.
概要(AI 翻訳)
このプロジェクトは、crawl4aiライブラリを使用して、Webスクレイピングとインテリジェントなコンテンツ抽出タスクを実行するMCP(Model Context Protocol)サーバーを提供します。 これにより、AIエージェント(Claude、LangChain/LangGraphで構築されたエージェントなど)がWebページとやり取りしたり、コンテンツを検索したり、特定のテキストを検索したり、自然言語の指示に基づいてLMベースの抽出を実行したりすることができます。
このサーバは:
- FastMCP: MCP サーバーエンドポイントの作成
- crawl4ai: コアWebクロールと抽出ロジックのため。
- dotenv: [
.env]ファイルでAPIキーを管理する。 (任意) Docker: コンテナ化されたデプロイメントのために、Pythonと依存関係を束ねる。
##特徴
- ウェブインタラクションのMCPツールを公開します。
scrape_url: Markdown 形式の Web ページの完全なコンテンツを取得します。extract_text_by_query: クエリに基づいてページ上の特定のテキストスニペットを見つけます。- [
smart_extract:指示に基づいて構造化された情報を抽出するためにLM(現在のGoogle Gemini)を使用してください。 ※環境変数(APIキー)で設定可能。 - Docker の設定 (
Dockerfile) は、簡単に、自己完結したデプロイメントに含まれています。 - デフォルトでは、ポート 8002 の Server-Sent イベント (SSE) を通信します.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Crawl4AI Web Scraper MCP Server
This project provides an MCP (Model Context Protocol) server that uses the crawl4ai library to perform web scraping and intelligent content extraction tasks. It allows AI agents (like Claude, or agents built with LangChain/LangGraph) to interact with web pages, retrieve content, search for specific text, and perform LLM-based extraction based on natural language instructions.
This server uses:
- FastMCP: For creating the MCP server endpoint.
- crawl4ai: For the core web crawling and extraction logic.
- dotenv: For managing API keys via a
.envfile. - (Optional) Docker: For containerized deployment, bundling Python and dependencies.
Features
- Exposes MCP tools for web interaction:
scrape_url: Get the full content of a webpage in Markdown format.extract_text_by_query: Find specific text snippets on a page based on a query.smart_extract: Use an LLM (currently Google Gemini) to extract structured information based on instructions.
- Configurable via environment variables (API keys).
- Includes Docker configuration (
Dockerfile) for easy, self-contained deployment. - Communicates over Server-Sent Events (SSE) on port 8002 by default.
Exposed MCP Tools
scrape_url
Scrape a webpage and return its content in Markdown format.
Arguments:
url(str, required): The URL of the webpage to scrape.
Returns:
- (str): The webpage content in Markdown format, or an error message.
extract_text_by_query
Extract relevant text snippets from a webpage that contain a specific search query. Returns up to the first 5 matches found.
Arguments:
url(str, required): The URL of the webpage to search within.query(str, required): The text query to search for (case-insensitive).context_size(int, optional): The number of characters to include before and after the matched query text in each snippet. Defaults to300.
Returns:
- (str): A formatted string containing the found text snippets or a message indicating no matches were found, or an error message.
smart_extract
Intelligently extract specific information from a webpage using the configured LLM (currently requires Google Gemini API key) based on a natural language instruction.
Arguments:
url(str, required): The URL of the webpage to analyze and extract from.
インストール
docker run -it --rm -p 8002:8002 --env-file .env crawl4ai-mcp-server