TheCrawler

io.github.manchittlab由 GitHub 帳號 manchittlab 發布v0.5.8更新於 Oct 24, 2026

Universal web scraper with LLM-ready markdown, RAG chunking, PDF/DOCX support.

概覽

AI 產生的概覽

本機 MCP 伺服器,可將網頁擷取為 Markdown、結構化資料與 LLM 擷取欄位,並支援契約驗證與就緒診斷。

可以做什麼
TheCrawler 會爬取 URL 並回傳頁面資料,包括正文、去除樣板內容的 Markdown、連結、圖片、中繼資料、JSON-LD、電商資料、表單與偵測到的分析追蹤器。它可依 JSON Schema 或內建契約(如 real-estate-listing、product-page)進行 LLM 擷取,回傳具型別的資料與驗證結果。無 LLM 的診斷模式可在消耗 token 前評估頁面是否適合某契約,另支援搜尋後擷取、網站地圖爬取與 PDF/DOCX 解析。
適用情境
當助理需要讀取公開網頁、將其轉為適合 RAG 的乾淨 Markdown,或從房源與商品頁擷取結構化欄位時使用。也適合在投入擷取流程前先檢查擷取就緒度。
執行需求
以本機 Node.js 程序執行,可透過 npm 套件或 GitHub 原始碼建置;已發布的 npm 套件比 GitHub 原始碼舊。LLM 擷取需要可公開存取的 OpenAI 相容 chat-completions 端點與 API 金鑰,可設為 THECRAWLER_LLM_API_KEY。可靠搜尋可選配 SerpAPI 金鑰。需要網路存取。
安裝前請注意
擷取會把目標 URL 與頁面內容傳送到所設定的 LLM 端點,應避免使用私有 URL 或敏感資料。LLM 端點費用與逐頁計費分開計算。Apify 託管路徑依成功擷取的頁面計費,並在確認合適後提供 500 美元的就緒評估服務。不要在公開 issue 表單中填寫憑證、私有 URL 或個人資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 TheCrawler,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

TheCrawler — AI-ready web scraper with validated extraction contracts

Scrape web pages, run LLM-powered structured extraction, or diagnose whether URLs are ready for a built-in extraction contract before spending LLM tokens. Open source engine (AGPL-3.0). $0.005 per successfully scraped page on Apify.

Start with a safe test: run one public URL with dryRun: true on Apify, or clone the current GitHub source and run the local CLI/MCP build from engine/. A small proof pack is in examples/diagnostic-challenge, including a sample readiness report at examples/diagnostic-challenge/sample-report.md.

$500 extraction readiness sprint

Use this when you need to know whether one real public-web workflow is worth automating before you spend engineering time on extraction.

  • Scope: up to 25 public URLs and one target output shape.
  • First step: send a public fit check through the structured issue form or use the private fit-check path on the sprint page.
  • Payment: requested only after the workflow looks like a fit, by one-off $500 payment link or invoice.
  • Output: a readiness report with ready, mixed, blocked, or not-worth-automating-yet guidance.
  • Credit: if the workflow continues into setup or hosted usage, the $500 is credited toward that next step.

The public offer thread is GitHub issue #1. The proof pack includes a sample readiness report showing the report shape before a buyer sends URLs.

Public fit checks should use this shape:

text
Workflow type:Public URLs (up to 25):Target output shape / required fields:Known blockers or constraints:Timing:

Do not include login credentials, private URLs, personal data, or raw customer data in GitHub issues.

What makes this different

  • Validated extraction contracts: select a built-in contract, get normalized data plus validation.valid, required fields, and missing-field evidence. Current contracts: real-estate-listing, product-page, docs-page.
  • Brand identity extraction (extractBrand: true): one call returns the site's ranked color palette, themeColor, and best-guess logo candidates (JSON-LD / header SVG / favicons / og:image). In Playwright mode it reads rendered colors via getComputedStyle — works on SPAs where static CSS can't. Deterministic, no LLM.
  • Content controls: onlyMainContent plus includeTags / excludeTags (CSS allow/deny) strip nav, footer, sidebars, and ads from text, markdown, links, and HTML output. Firecrawl-compatible. waitFor alias supported.
  • HTML formats: extractHtml (cleaned, main-content HTML) and extractRawHtml (full serialized DOM) alongside markdown.
  • No-LLM diagnostics: run diagnoseMode to score source readiness, identify blockers, and save a buyer-readable Markdown report before extraction.
  • LLM-powered extraction: send a JSON Schema or use a contract, get parsed typed data back. Endpoint-agnostic — point at OpenAI, your own llama.cpp / vLLM / LM Studio / Ollama. You bring the LLM, no vendor lock-in.
  • Adaptive crawling: Cheerio first (fast HTTP+parse), auto-fall-back to Playwright when an SPA shell is detected. Keeps browser rendering optional instead of mandatory for every page.
  • Structured errors: errorType enum (dns | timeout | rate-limit | blocked-bot | js-required | http-4xx | http-5xx | parse | network | unknown) + errorRetryable boolean. Agents branch programmatically — no regex on error strings.
  • Challenge-page detection: 200 OK responses with access-control or challenge-page bodies are flagged as errorType: 'blocked-bot' instead of returning challenge HTML as useful content.
  • Out-of-box extractors: JSON-LD, microdata, commerce data (price/SKU/rating), forms with field types, 16 analytics trackers detected (GA4, GTM, Meta Pixel, Hotjar, Segment, Mixpanel, etc.), hreflang, pagination, redirect chain. Email-like and phone-like public text extraction is opt-in.
  • Heading-aware RAG chunking: markdown chunked at h1-h3 boundaries with overlap and per-chunk SHA. Feed straight to a vector DB.

Three modes

Safe first run

Use dryRun: true for an Apify smoke test. The actor crawls the page but does not emit a billing event.

json
{  "urls": ["https://example.com"],  "extractMarkdown": true,  "dryRun": true}

For the current local MCP/CLI build:

bash
git clone https://github.com/manchittlab/TheCrawler.gitcd TheCrawler/enginenpm installnpm run buildnode dist/cli.js crawl https://example.com --markdown

Plain crawl (default)

json
{  "urls": ["https://example.com"],  "extractMarkdown": true,  "rotateUserAgent": true,  "requestRetries": 3}

Returns rich PageData per URL: title, description, language, canonical URL, robots directives, full text, boilerplate-stripped markdown, links (with internal/external flag), images (with lazy-load src), meta tags, OG/Twitter Card, JSON-LD, microdata, commerce data, forms, analytics-detected, optional email-like/phone-like public text fields, social links, hreflang, pagination, redirect chain, response headers + timing, plus structured errorType + errorRetryable on failure.

LLM-powered extract mode

json
{  "urls": ["https://shop.example.com/products/123"],  "extractMode": true,  "extractJsonSchema": {    "type": "object",    "properties": {      "productName": { "type": "string" },      "price": { "type": "number" },      "currency": { "type": "string" },      "inStock": { "type": "boolean" }    },    "required": ["productName"]  },  "llmBaseUrl": "https://api.openai.com/v1/chat/completions",  "llmModel": "gpt-4o-mini"}

Crawls the URL → cleans to markdown → sends (markdown + schema) to your OpenAI-compatible chat-completions endpoint → returns parsed typed data per URL. Schema-backed extraction uses JSON Schema response format where supported, with fallbacks for endpoints that only support JSON-object or text output. Supports natural-language extractPrompt instead of/alongside the schema. The actor charges per page like normal; the LLM call cost is whatever your endpoint charges.

Note: extract mode requires a publicly-reachable LLM endpoint. LAN URLs (e.g. http://192.168.x.x) are not reachable from Apify infrastructure. Use OpenAI, hosted vLLM, or expose your local server via a tunnel.

Set THECRAWLER_LLM_API_KEY as an Actor environment variable so the LLM key never lands in run inputs (visible in run history).

Contract diagnostic mode

json
{  "urls": ["https://example.com/listing-1", "https://example.com/listing-2"],  "diagnoseMode": true,  "extractContract": "real-estate-listing",  "diagnosticReport": true}

Runs crawl + readiness scoring without an LLM call. Dataset output includes per-URL verdict, readyForExtraction, score, blockers, warnings, and recommendedNextStep, plus a workflow summary. When diagnosticReport is true, the actor saves contract-diagnostic-report in the run key-value store as Markdown with a missing-readiness-signal summary. The report intentionally excludes raw extracted contact details.

Contract extract mode

json
{  "urls": ["https://example.com/listing-1"],  "extractMode": true,  "extractContract": "product-page",  "llmBaseUrl": "https://api.openai.com/v1/chat/completions",  "llmModel": "gpt-4o-mini"}

Uses the selected contract schema and prompt, then appends contract validation to the extraction result. Agents can branch on validation.valid and validation.missingRequiredFields instead of trusting loose markdown. Built-in contracts currently cover real-estate-listing and product-page.

Reliability features

FeatureDefaultWhy
requestRetries3Transient failures (5xx, network, timeout) auto-retried
requestTimeoutSecs30Cap on per-request time
rotateUserAgenttrueUses standard browser User-Agent strings for compatibility; does not override access controls
cacheEnabledfalseOpt-in 5-min in-memory LRU per (URL + extract-flags)
Challenge-page detectionalways onFlags access-control or challenge-page bodies as errorType: 'blocked-bot'
Adaptive crawlopt-inadaptiveCrawling: true tries Cheerio first, escalates to Playwright on SPA detection

Search → scrape

Top-N Google results crawled in one call. Optional SerpAPI key for reliable search.

json
{ "searchQuery": "best CRM 2026", "searchLimit": 10, "extractMarkdown": true }

Sitemap → scrape

Sitemap.xml + sitemap-index files resolved automatically.

json
{ "sitemapUrl": "https://example.com/sitemap.xml", "maxPages": 50 }

File extraction

PDF and DOCX URLs are auto-detected and parsed. Returns extracted text + (for PDFs) metadata, page count.

Pricing

  • Crawl mode: $0.005 per page successfully scraped (failed pages don't charge).
  • Extract mode / diagnostic mode: still charged per successfully scraped page. LLM endpoint cost is paid by the endpoint owner, not by this actor.
  • Extraction readiness sprint: $500 after fit confirmation for one public workflow: up to 25 public URLs, one target output shape, and a ready / mixed / blocked report. Payment is by one-off link or invoice after scope is confirmed. If the workflow continues into setup or hosted usage, the $500 is credited toward that next step. If another stack is a better fit, the report says so.

Beyond the Apify Store

The current open-source engine source for this actor build is in engine/; drop it into your own Node project, MCP server, CLI, or REST API server. The published npm package is older than this GitHub source until the next npm publish, so use the GitHub-source path below for current validated-contract and MCP tools. Self-hosting avoids Apify per-page charges, while your own infrastructure and LLM endpoint costs still apply.

bash
# Current GitHub source buildcd enginenpm installnpm run build
# CLInode dist/cli.js crawl https://example.com --markdownnode dist/cli.js extract https://example.com --schema '{...}'
# MCP server (Cline, Claude Code, Cursor, Windsurf)node dist/mcp.js
# REST API serverTHECRAWLER_API_KEY=local_test_key node dist/server.js --port 3000curl -H "Authorization: Bearer local_test_key" \  "http://localhost:3000/v1/contracts?includeSchema=true"curl -X POST "http://localhost:3000/v1/scrape" \  -H "Authorization: Bearer local_test_key" \  -H "Content-Type: application/json" \  -d '{"url":"https://example.com/product","formats":["markdown","metadata","links","structuredData","commerceData"]}'curl -X POST "http://localhost:3000/v1/diagnose" \  -H "Authorization: Bearer local_test_key" \  -H "Content-Type: application/json" \  -d '{"contractName":"product-page","urls":["https://example.com/product"],"reportMarkdown":true}'curl -X POST "http://localhost:3000/v1/map" \  -H "Authorization: Bearer local_test_key" \  -H "Content-Type: application/json" \  -d '{"url":"https://example.com","maxPages":1}'curl -X POST "http://localhost:3000/v1/extract-contract" \  -H "Authorization: Bearer local_test_key" \  -H "Content-Type: application/json" \  -d '{"contractName":"product-page","urls":["https://example.com/product"],"llmBaseUrl":"http://localhost:1234/v1/chat/completions","llmModel":"qwen/qwen3.5-9b"}'
# Older npm package; use for plain crawl only until the next publishnpm install thecrawlerthecrawler crawl https://example.com --markdown

For Cline setup from a GitHub clone, use llms-install.md. The current GitHub source is the review path for validated contracts and MCP tools until npm is updated.

GitHub: https://github.com/manchittlab/TheCrawler · License: AGPL-3.0

來源:README.md,提交 fe6019e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.8最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分