It obeys the site
The crawler reads robots.txt as RFC 9309 specifies. It obeys Retry-After, and it stops at a challenge, a 401, a 402 or a 403. Test a robots.txt.
npm install polite-crawlerclaude mcp add polite-crawler -- npx -y polite-crawler-mcpen.wikipedia.org0 of 5 pagesdocs.example.org0 of 4 pagesmuseum.example0 of 2 pagesapi.busy.example0 of 3 pagesnews.example0 of 3 pagesshop.example0 of 3 pagesmembers.examplerobots.txt refuses: no requestblog.example0 of 3 pagesEach site gets one request at a time, and the sites run in parallel.
Research reads the same sources again and again. A plain web fetch goes back to the site each time, and nothing stays. This crawler fetches a page one time, keeps the response, and answers the next questions from a local index. Each site sees one request at a time, from a crawler that tells its name.
It obeys the site
The crawler reads robots.txt as RFC 9309 specifies. It obeys Retry-After, and it stops at a challenge, a 401, a 402 or a 403. Test a robots.txt.
It reads the cheap way
The crawler reads the JSON-LD, the visible text and the links with no browser. It opens a headless browser only for a page that needs JavaScript. See what it reads.
It answers from the disk
Each response goes into a capture log. A full-text index finds passages, and a local model can also find them by meaning. A quote check finds the exact text to cite. How hybrid search ranks.
It tells its name
Each request sends the User-Agent PoliteCrawler with a link to a page for site owners. A site can refuse it by name, and the crawler obeys.
It reads hours and prices
The recipes read the opening hours of a venue and the price of a product, with the source of each value. polite-crawler venue and polite-crawler product start them. Write a recipe for a source of your own.
It watches pages
The daemon checks a watch list on a schedule. A change needs a second check, and then the daemon writes it as one JSON line. The daemon, tick by tick.
One command gives Claude nine tools. The tools fetch pages politely, search the store, read a range of a document, check a quote and check the field values of a page. Two more tools list the pages of a site and crawl a few of them. The last two compare two versions of a page and list the watched pages.
claude mcp add polite-crawler -- npx -y polite-crawler-mcpA site gives status 503 for its robots.txt. Can a crawler fetch the pages of the site? Cite the standard.
crawl_fetch{ "urls": ["https://www.rfc-editor.org/rfc/rfc9309.html"] }[{
"doc": "url:https://www.rfc-editor.org/rfc/rfc9309.html",
"outcome": "ok",
"status": 200,
"chars": 21050,
"captures": ["fetch.f403dd2770c1"],
"age": "0s"
}]
<untrusted-web-content id="4f1c09a2" capture="fetch.f403dd2770c1">
title: RFC 9309: Robots Exclusion Protocol
</untrusted-web-content id="4f1c09a2">Two requests: the robots.txt of the site, then the page. Each one goes into the capture log. The title is page text, so it comes in an envelope.
crawl_find{ "q": "unreachable server error" }[{ "doc": "url:https://www.rfc-editor.org/rfc/rfc9309.html", "kind": "page", "age": "1m" }]
<untrusted-web-content id="b83e5d10" capture="fetch.f403dd2770c1">
snippet: …2.3.1.4. "[Unreachable]" Status If the robots.txt file is [unreachable] due to [server] or network [errors], this means…
</untrusted-web-content id="b83e5d10">No request: a full-text search of the store on the disk.
crawl_read{ "doc": "url:https://www.rfc-editor.org/rfc/rfc9309.html", "from": 14315, "length": 420 }{ "from": 14315, "to": 14735, "total": 21050, "next_from": 14735, "captures": ["fetch.f403dd2770c1"] }
<untrusted-web-content id="70d2a6e4" capture="fetch.f403dd2770c1">
2.3.1.4. "Unreachable" Status
If the robots.txt file is unreachable due to server or network
errors, this means the robots.txt file is undefined and the crawler
MUST assume complete disallow. …
</untrusted-web-content id="70d2a6e4">No request: the stored copy of the page.
crawl_verify{ "doc": "url:https://www.rfc-editor.org/rfc/rfc9309.html", "quote": "the crawler MUST assume complete disallow" }{
"found": true,
"start": 14464,
"end": 14505,
"captures": ["fetch.f403dd2770c1"]
}No request: the quote is in the stored text, at characters 14,464 to 14,505.
No. A 503 is a server error, and RFC 9309 (section 2.3.1.4) says that then the crawler MUST assume complete disallow
.
The quote is in capture fetch.f403dd2770c1, characters 14,464 to 14,505.
The same server works in Claude Desktop, Cursor, VS Code and each MCP client. Set up the MCP server.
import { openCrawler } from "polite-crawler";
const crawler = openCrawler({ dir: "./crawl" });const page = await crawler.fetch("https://en.wikipedia.org/wiki/Web_crawler");
crawler.find("robots exclusion"); // ranked passages, with no requestcrawler.verify(page.doc!, "robots.txt protocol"); // the exact span and the capture to citeThese tools start the code of the package in your browser. Nothing goes to a server.