site-crawler-mcp
site-crawler-mcp
サイト全体をクロールするMCPサーバーで、crawl4ai(Apache-2.0)をベースに構築されています。 検索エンジンのスパイダー(BFS)のようにウェブサイトのすべての内部リンクをクロールし、 公開時間 / タイトル / URLでページをフィルタリングし、クロールしたページに対して操作(要約、リンククリック、ファイルダウンロード)を行うことができます。 結果はJSONとして返され、SQLiteに永続化され、後続のプロジェクトで再利用できます。
中文简介:一个「像谷歌爬虫一样」的全站内链爬虫 MCP。基于 crawl4ai 自研封装, 支持 BFS 全站遍历、时间/标题/URL 筛选、页面操作(LLM 概括/点击链接/下载文件)、 结果 JSON 返回 + SQLite 持久化。注册到 Reasonix / Claude Desktop / Cursor 等任意 MCP 客户端即可全局复用。
機能
✅ サイト全体のBFSクロール — すべての内部リンクを巡回(max_depth / max_pages を制御可能)
✅ 時間フィルタ — ページのメタ / JSON-LD / URL から公開時間を抽出し、 利用できない場合はクロール時間をフォールバック(結果には
time_sourceがタグ付けされます)✅ タイトルフィルタ — タイトルのキーワードで包含 / 除外(大文字小文字を区別しない)
✅ URLパターン&ドメインフィルタ — glob/regex URLマッチング、同一ドメイン制限
✅ 礼儀正しいクロール — デフォルトで
robots.txtを尊重し、レート制限を実施(切り替え可能)✅ ページ操作 — LLMによる要約(LiteLLM: DeepSeek / GLM / OpenAI…、ローカルフォールバック)、 特定のリンクのクリック(CSSセレクタまたはリンクテキスト)、ファイルのダウンロード
✅ SQLite永続化 —
query_crawlsツールで、後のプロジェクトでクロールデータを再利用可能
Related MCP server: read-website-fast
ツール
ツール | 説明 |
| BFSサイト全体クロール。パラメータ: |
| 単一ページをスクレイピング(マークダウン / タイトル / 公開時間 / リンク) |
| ページ内容を要約。 |
| ページ内のリンクをクリック( |
| ページのファイルを出力ディレクトリにダウンロード(デフォルト |
| SQLiteから永続化されたクロール結果をクエリ(タイトル/URL/時間フィルタ) |
要件
Python ≥ 3.12(3.12.13でテスト済み)
uv 推奨(オプション — 通常の
pipでも動作します)Playwright ブラウザ:
python -m playwright install chromium(またはPLAYWRIGHT_BROWSERS_PATHを既存のブラウザインストールに指定)
インストールと登録
# 1. Create environment & install
uv venv .venv --python 3.12
uv pip install --python .venv\Scripts\python.exe crawl4ai "mcp>=1.2,<2"
uv pip install --python .venv\Scripts\python.exe -e .
# 2. Install browser (once)
.venv\Scripts\python.exe -m playwright install chromium
# 3. Register as MCP server (example for Reasonix config.toml)
[[plugins]]
name = "site-crawler-mcp"
type = "stdio"
command = "C:\\path\\to\\site-crawler-mcp\\.venv\\Scripts\\python.exe"
args = ["-m", "site_crawler_mcp.server"]Claude Desktop / Cursor の場合、設定ファイルの mcpServers の下に同じ command/args を追加してください。
クイックスタート(Python API)
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def main():
params = StdioServerParameters(command="python", args=["-m", "site_crawler_mcp.server"])
async with stdio_client(params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
res = await session.call_tool("crawl_site", {
"start_url": "https://example.com",
"max_depth": 2,
"max_pages": 20,
"title_contains": "Example",
})
print(res.content[0].text)
asyncio.run(main())時間フィルタの仕組み
crawl4aiのURLフィルタはURLのみで機能するため、コンテンツレベルのフィルタリングはここで実装されています:
URLレベルの絞り込み —
TimeRangeFilter/TitleFilter(URLの日付パターン、URLキーワード)コンテンツレベル — 各ページが取得された後、公開時間は
<meta property="article:published_time">、JSON-LDdatePublished、<time datetime>、 または URL 内のYYYY/MM/DDから抽出されます。見つからない場合はクロール時間が使用されます(判断はtime_sourceとして文書化されます)。
コンプライアンス
デフォルトで
robots.txtとレート制限を尊重し、対象サイトへの負荷やIP禁止を避けます。学習用 / 研究用 / 自身のサイト向けです。対象サイトの利用規約と現地の法律に従ってください。
ライセンス
crawl4ai(Apache-2.0)をベースに構築されています。
Available Tools
6 toolsclick_linkC
点击页面内指定链接(CSS selector 或链接文本)并抓取目标页内容。
Inputs: url (required), selector, link_text.
crawl_siteA
BFS 全站爬取(谷歌爬虫式):从 start_url 遍历站内所有内链。
筛选:published_after/before(ISO 时间,发布时间优先、抓取时间兜底)、 title_contains/title_exclude(标题包含)、url_pattern(glob/regex 模式)。 默认遵守 robots.txt 并按 0.5s/请求限速,可关闭。 结果 JSON 返回并持久化到 SQLite。
Inputs: start_url (required), max_depth, max_pages, rate_limit, +7 more.
download_fileC
下载页面文件(图片/文档等)到 E:\Reasonix-项目\crawler-output。
Inputs: url (required), filename.
query_crawlsC
查询已持久化的爬取结果(SQLite),供其它项目复用。
Inputs: limit, success_only, url_contains, title_contains, +2 more.
scrape_pageA
抓取单个页面,返回 markdown、标题、发布时间与链接列表,并持久化。
Inputs: url (required), respect_robots.
summarize_pageA
概括页面内容。mode: auto(LLM 优先,失败回落本地)/ llm / local。
llm_provider 如 "deepseek/deepseek-chat" 或 "openai/gpt-4o-mini"(LiteLLM 格式); llm_api_key_env 指定 API key 的环境变量名(默认 DEEPSEEK_API_KEY)。
Inputs: url (required), mode, llm_provider, llm_api_key_env.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: full site crawling, single page scraping, summarization, link clicking, file downloading, and querying. No overlap or ambiguity.
All tools follow a consistent verb_noun pattern in snake_case (e.g., crawl_site, scrape_page, query_crawls), making the tool set predictable and easy to navigate.
With 6 tools, the server is well-scoped. It covers the essential operations for a site crawler without unnecessary bloat or missing functionality.
The tool set covers core workflows: crawling, scraping, summarizing, interacting, downloading, and querying. Minor gaps like explicit crawl session management or update/delete operations exist, but the surface is largely complete for typical use cases.
Related MCP Connectors
Crawl a site for SEO issues per page and broken links. Respects robots.txt.
Web search, URL content extraction to Markdown, site mapping, and recursive web crawler.
Crawl a website into clean Markdown for LLMs/RAG: main content only, linked docs converted.
Crawls any documentation or SaaS site and compiles a standards-compliant /llms.txt manifest and J.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceFetches web content locally, removes clutter, and converts pages to clean Markdown for efficient LLM consumption, with optional crawling and caching.-
- AlicenseNot gradedqualityAmaintenanceFetches webpages and crawls sites locally, stripping noise and converting content into clean, link-preserving Markdown with a minimal token footprint. Supports configurable crawl depth, concurrency, robots.txt compliance, and caching for efficient AI agent and LLM pipelines.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents and MCP clients to fetch webpages locally, strip noise, preserve links, and convert content into clean, token-efficient Markdown, with optional depth crawling, caching, and robots.txt-aware rate limiting.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to crawl websites, follow internal links, render JavaScript pages, and extract clean main text and linked PDF tables into structured records. It exposes a crawl tool over stdio that returns records inline and writes a complete JSONL file.MIT