Skip to main content
Glama
coolaigit

site-crawler-mcp

by coolaigit

site-crawler-mcp

一个基于 crawl4ai (Apache-2.0) 构建的全站爬虫 MCP 服务器。 它像搜索引擎蜘蛛(BFS)一样爬取网站的所有内部链接,按发布时间/标题/URL 过滤页面,并可对爬取页面进行操作(摘要、点击链接、下载文件)。 结果以 JSON 返回并持久化到 SQLite,供任何项目复用。

中文简介:一个「像谷歌爬虫一样」的全站内链爬虫 MCP。基于 crawl4ai 自研封装, 支持 BFS 全站遍历、时间/标题/URL 筛选、页面操作(LLM 概括/点击链接/下载文件)、 结果 JSON 返回 + SQLite 持久化。注册到 Reasonix / Claude Desktop / Cursor 等任意 MCP 客户端即可全局复用。

功能特性

  • 全站 BFS 爬取 — 遍历所有内部链接(可控制 max_depth / max_pages)

  • 时间筛选 — 优先从页面 meta / JSON-LD / URL 提取发布时间, 不可用时回退到爬取时间(结果标记 time_source

  • 标题筛选 — 按标题关键词包含/排除(不区分大小写)

  • URL 模式与域名筛选 — glob/regex URL 匹配,同域名限制

  • 礼貌爬取 — 默认遵守 robots.txt 和速率限制(可切换)

  • 页面操作 — LLM 摘要(LiteLLM: DeepSeek / GLM / OpenAI…,本地回退), 点击特定链接(CSS 选择器或链接文本),下载文件

  • SQLite 持久化query_crawls 工具可在后续项目中复用爬取数据

Related MCP server: Spider MCP Server

工具

工具

描述

crawl_site

BFS 全站爬取。参数:start_urlmax_depthmax_pagespublished_after/beforetitle_contains/title_excludeurl_patterninclude_externalrespect_robotsrate_limit

scrape_page

抓取单个页面(markdown / 标题 / 发布时间 / 链接)

summarize_page

摘要页面内容。mode=auto(LLM 优先 → 本地回退)/ llm / localllm_provider(LiteLLM 格式,例如 deepseek/deepseek-chat)、llm_api_key_env(默认 DEEPSEEK_API_KEY

click_link

点击页面内的链接(selector CSS 或 link_text)并抓取目标页面

download_file

将页面文件下载到输出目录(默认 E:\Reasonix-项目\crawler-output

query_crawls

从 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,因此内容级别的筛选在此实现:

  1. URL 级别修剪 — TimeRangeFilter / TitleFilter(URL 日期模式、URL 关键词)

  2. 内容级别 — 每个页面获取后,从 <meta property="article:published_time">、JSON-LD datePublished<time datetime> 或 URL 中的 YYYY/MM/DD 提取发布时间。如果未找到,则使用爬取时间(决策记录为 time_source)。

合规性

  • 默认遵守 robots.txt 和速率限制,以避免对目标网站造成压力或被 IP 封禁。

  • 用于学习/研究/您自己的网站;请遵守目标网站的服务条款和当地法律。

许可证

MIT

基于 crawl4ai (Apache-2.0) 构建。

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Enables automated web research and intelligence gathering through recursive web crawling, multi-engine search integration, and persistent SQLite storage with support for keyword filtering and multiple export formats.
    MIT
  • A
    license
    A
    quality
    F
    maintenance
    A comprehensive website crawler and SEO analyzer that stores site data in a local SQLite database for AI-driven auditing. It enables users to detect technical SEO issues, broken links, and security vulnerabilities through natural language queries or terminal commands.
    4
    54
    16
    Apache 2.0
  • A
    license
    -
    quality
    C
    maintenance
    Enables web crawling and content extraction from web pages, supporting multiple output formats like text, markdown, XML, and JSON, with robots.txt compliance and rate limiting.
    14
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Scrape, crawl, map & search the web. Open-source, self-hostable Rust crawler & search for AI agents.

  • Converts any URL to clean, LLM-ready Markdown using real Chrome browsers

  • Web scraping for AI agents. Converts URLs to clean, LLM-ready Markdown with anti-bot bypass.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/coolaigit/site-crawler-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server