list_extraction_contracts
List built-in extraction contracts agents can use for validated schema extraction. Use this before diagnose_extraction_contract or extract_extraction_contract.
Scrapes pages into clean markdown with structured data attached, and can tell you whether a set of URLs is even worth running an LLM over before you spend the tokens.
LABSCO SUMMARY
Most scrapers let you find out a page was unextractable after you paid a model to try. Scoring readiness first — with named blockers and a recommended next step, and no LLM call in the loop — turns that into a decision you make before spending. The contract validation follows the same instinct: an agent branching on whether required fields are present is doing something a confidence score cannot support.
A web scraping engine with an MCP server build. Three modes sit on the same crawler: a plain crawl that returns rich page data, an LLM extraction mode driven by your JSON Schema, and a diagnostic mode that scores whether URLs are ready for extraction without making an LLM call at all.
validation.valid and the list of missing required fields rather than loose markdown an agent has to trust — the built-in contracts are real-estate-listing, product-page and docs-pagediagnoseMode returns a per-URL verdict, a readiness flag, a score, blockers, warnings and a recommended next step, and diagnosticReport saves a readable Markdown summaryerrorType enum covering dns, timeout, rate-limit, blocked-bot, js-required, http-4xx, http-5xx, parse, network and unknown, paired with an errorRetryable booleanonlyMainContent plus CSS allow and deny lists across text, markdown, links and HTML output, with cleaned and raw HTML both availableFor the MCP build: clone the repository, build the engine, and run the MCP entry point from the build output — the README notes the published npm package lags the GitHub source, so the current contracts and MCP tools come from the source path. Node.js. Extraction mode needs a reachable OpenAI-compatible endpoint and its key, which should be supplied as an environment variable rather than in run inputs; on the hosted Apify actor that endpoint must be publicly reachable, because LAN addresses such as http://192.168.x.x cannot be reached from Apify's infrastructure. Running it yourself avoids the hosted per-page charge; on Apify the crawl is $0.005 per successfully scraped page, with failed pages not charged, and dryRun gives you a smoke test that emits no billing event. Licence is AGPL-3.0.
Build from source — git clone https://github.com/manchittlab/TheCrawler.git
USE CASES
Run the readiness pass over a sample of real URLs and read the verdicts, blockers and recommended next step before writing any extraction code.
Define the fields you need as a schema, point the extractor at the endpoint you already run, and branch on whether the required fields came back.
Crawl to boilerplate-stripped markdown, chunk it at heading boundaries with overlap, and send the chunks and their hashes to a vector database.
Branch on the error type and the retryable flag — retrying a timeout, escalating a bot block, and not retrying a parse failure — instead of matching on error text.
Read the ranked palette, theme colour and logo candidates from the rendered page, with no model call involved.
Listed in project code.
list_extraction_contractsList built-in extraction contracts agents can use for validated schema extraction. Use this before diagnose_extraction_contract or extract_extraction_contract.
diagnose_extraction_contractRun a no-LLM readiness diagnostic for one extraction contract before spending LLM tokens. Returns per-URL verdicts, scores, blockers, branchable error types, missing readiness signals, and a workflow-level recommended next step. This does not claim a site will work; it tells the agent whether to extract, retry with browser/proxy, review manually, or stop.
extract_extraction_contractCrawl URLs and extract against a built-in validated extraction contract with an OpenAI-compatible LLM. Returns parsed data plus required-field validation and missingRequiredFields evidence. Use diagnose_extraction_contract first when the source is unknown.
crawlScrape one or more URLs. Returns rich structured data: title, description, text, markdown, links, images, meta, OG/Twitter cards, JSON-LD, microdata, headings, tables, forms, redirect chain, hreflang, pagination links, commerce data (price/rating/sku from JSON-LD), analytics tracker detection (16 trackers), and optional email-like/phone-like public text fields when explicitly enabled. Auto-handles PDF and DOCX URLs. Default Cheerio (fast HTTP+parse); set usePlaywright=true for JS rendering, or adaptiveCrawling=true to auto-detect SPAs and re-crawl them with Playwright. On failure, returns structured error with errorType (dns|timeout|rate-limit|blocked-bot|js-required|http-4xx|http-5xx|parse|network|unknown) and retryable flag.
crawl_markdownExtract clean markdown for a single URL. Strips boilerplate (nav/header/footer/cookie banners). Returns markdown text only — no surrounding metadata. Ideal for feeding a single page to an LLM. For multi-URL or structured output, use crawl, extract_structured, or extract_extraction_contract instead.
search_and_crawlSearch Google for a query, then scrape the top N results. Returns structured data per result page. Without a SerpAPI key, falls back to scraping Google's HTML — fragile, can break when Google updates their HTML. For production agent use, supply serpApiKey.
crawl_sitemapFetch URL list from a sitemap.xml (supports sitemap-index files), then optionally scrape them. Use scrape=false to just get the URL list (cheap), scrape=true to also extract content from each.
extract_structuredLLM-powered structured extraction. Crawls each URL → cleans to markdown → asks an OpenAI-compatible LLM (llama.cpp / vLLM / LM Studio / Ollama / OpenAI) to return ONLY a JSON object matching your jsonSchema or prompt. Returns parsed typed data, not raw markdown. LLM endpoint configurable per-call or via env vars (THECRAWLER_LLM_BASEURL, THECRAWLER_LLM_MODEL, THECRAWLER_LLM_API_KEY).
BEFORE YOU INSTALL
8 tools registered in the project's code.
All 4 documented clients run the server on your machine.
INSTALLATION
git clone https://github.com/manchittlab/TheCrawler.git
cd TheCrawler/engine
npm install
npm run build
node dist/mcp.js{
"mcpServers": {
"thecrawler": {
"command": "node",
"args": [
"<YOUR_PATH_TO_CRAWLER>/engine/dist/mcp.js"
],
"env": {
"NODE_OPTIONS": "--use-system-ca"
}
}
}
}