Skip to content

Fetch once. Read many times.

polite-crawler is a web crawler for research and for AI agents. It obeys robots.txt, sends one request at a time to each site, and keeps each page on your disk. The next question about a page costs no request.
Librarynpm install polite-crawler
Claude Codeclaude mcp add polite-crawler -- npx -y polite-crawler-mcp
Who lets AI agents in?The crawler read the robots.txt of the top 1,000 domains on 2 November 2026. One square is one domain. The robots.txt study runs again on day 2 of each month. A check stops a new deploy of this site when the data is more than 33 days old.
GPTBot
22%
Claude-User
14%
Googlebot
4%

The shares count the 557 sites that answered with a file or with no file.

Read the study, with each site and its rules
A crawl of eight sitesThe real scheduler of the package, on a simulated clock at 2× speed.
en.wikipedia.org0 of 5 pages
docs.example.org0 of 4 pages
museum.example0 of 2 pages
api.busy.example0 of 3 pages
news.example0 of 3 pages
shop.example0 of 3 pages
members.examplerobots.txt refuses: no request
blog.example0 of 3 pages

Each site gets one request at a time, and the sites run in parallel.

Requests sent
0
Answered from the store
0
Most requests at once to one site
0
Time on the clock
0.0 s
  • A request
  • A rest
  • A 429
  • A refusal
  • From the store

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.

Terminal window
claude mcp add polite-crawler -- npx -y polite-crawler-mcp
An assistant cites what it readA real session with four of the nine MCP tools.
2 requests to the site3 answers from the store
  1. Person

    A site gives status 503 for its robots.txt. Can a crawler fetch the pages of the site? Cite the standard.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. Assistant

    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 request
crawler.verify(page.doc!, "robots.txt protocol"); // the exact span and the capture to cite

These tools start the code of the package in your browser. Nothing goes to a server.