Skip to content

v2.26.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 13:34
· 81 commits to main since this release
Immutable release. Only release title and notes can be modified.

Behavior changes

  • With default_user_agent unset, crawls send github.com/Sriram-PR/doc-scraper/<version> as the User-Agent on pages, images, robots.txt and sitemaps, like add, get_page and draft_site already did. Before, they sent no User-Agent header at all, which some sites and CDNs block, and which left site owners no way to tell what was crawling them. A site's user_agent and default_user_agent still override it (#64).
  • MCP tools reject a negative number for any count, size or offset (max_results, limit, max_bytes, wait_seconds, offset) with an error naming the argument, instead of quietly using the default. 0 still means the default, values above the maximum are still capped, and the input schemas now declare minimum: 0 (#114).
  • In list_pages and diff_crawl, an offset past the end is echoed as given instead of as the end; total and returned: 0 show there is nothing there (#114).
  • Over stdio, the MCP server refuses a request that comes before any initialize with JSON-RPC error -32600, unless it is ping or server/discover or carries protocol 2026-07-28 _meta. Protocol 2026-07-28 notes that a server answering tools/call without a handshake misleads clients that probe for the protocol version. Piping initialize and the first call together still works: the order on stdin is what counts (#114).
  • The MCP server reads at most 4 MiB per JSON-RPC line on stdin. A longer line is discarded without being read into memory and answered with error -32600 ("request too large") when its id comes in the first 4 MiB; otherwise it's dropped with a warning in the log. A 200 MB line used to take the server to about 1 GB of memory (#52).

Tables

In tables that fall back to one paragraph per cell, a header row that is one cell spanning every column (Python's built-in functions index, Android's "Nested classes") is written once as a title instead of labeling every cell. Key/value tables with a header cell in each row (nginx directives, MDN's element summaries) label each value with its key: **Syntax:** `charset_types mime-type ...;`. A header that already ends in a colon no longer gets a second one (#135).

The Markdown format version changed, so the first incremental crawl after upgrading re-saves every page.

New

  • Progress notifications: when a call's _meta carries a progressToken, get_job_status reports pages crawled so far while it waits (at most once a second), and draft_site reports each network stage (probing the site, fetching the preview page) (#114).

Fixes

Crawling:

  • A dead link (403, 404, 410) no longer holds its connection open until the client timeout. Each one used to open a new connection; a crawl with 30 dead links opened 30, and now opens 1 (#69).
  • A response that's thrown away (a 5xx before a retry, an image over max_image_size_bytes) is read for at most 64 KiB before the connection is dropped. Before, it was read to the end, so a server sending an endless error body could tie up a page for the whole client timeout on every retry, and an oversized image was downloaded in full anyway (#107).
  • When several pages link to the same URL at the same moment, it's fetched once. A retried database write could report it as new to more than one worker, which fetched it twice and inflated the page counts (#105).
  • A page whose JSONL record is over 10 MiB no longer stops the readers at that line. Search indexing, llms.txt, list_pages, read_page, the last-crawled time and the crawl history used to skip every page after it, and list_pages failed with "token too long" (#109).
  • Crawls no longer turn on block and mutex profiling, which slowed every lock a little; a -tags pprof build turns it on when -pprof is given (#110).

Watch and saved state:

  • The watch state file is written to a temp file and renamed into place, so a crash or power loss in the middle of a save can't leave it truncated and make every site look never crawled. The MCP jobs file and save_site config edits use the same write, now with an fsync, and on Windows the final rename is retried briefly when another program holds the file open (#110).

MCP server:

  • The server no longer keeps a goroutine, and the whole crawler it references, for every cancelled crawl_site job. Pages still queued at the cancel are now released (#106).
  • A crawl job's status stays put once it ends: a cancel_crawl that lands just as the job starts can't be turned back into running, and a late error can't turn cancelled into failed (#106).
  • draft_site adds a warning when the preview page can't be extracted, instead of leaving the reason only in the preview's error field (#114).
  • "Available sites" in errors is a plain list (blog, docs), and get_page reports an HTTP error as HTTP 404 Not Found instead of 404 404 Not Found (#114).
  • list_pages and read_page word the never-crawled case the same way (#114).

Search:

  • search_docs points at an unmatched " when a query finds nothing (#114).
  • search prints each snippet on one line instead of carrying the page's line breaks into the output. Before anything is crawled, it says so instead of creating state_dir and an empty index.db, and like search_docs it points at an unmatched " when a query finds nothing (#103).
  • Deleting a site's pages.jsonl removes its pages from search at the next crawl or MCP server start, instead of leaving them searchable until the next successful crawl (#102).

add and draft_site:

  • They refuse a URL that isn't an HTML page, with <url> is image/png, not an HTML page, instead of drafting a site from the file's bytes (#74).
  • Drafted disallowed_path_patterns for version and locale trees end in (?:/|$), so they also exclude each tree's root page (/docs/2.x, /docs/next, /de). Sitemaps list those without the trailing slash, and on docusaurus.io 12 old "Introduction" pages slipped into the crawl (#76).

For contributors

  • The page queue now holds the crawl's task count: queue.NewThreadSafePriorityQueue(log, tasks) takes the WaitGroup, Add counts an accepted item, and Drain releases what was never popped. Callers no longer call wg.Add before pq.Add, and ExtractAndQueueLinks lost its WaitGroup argument.
  • fetch.DefaultUserAgent is gone; use config.GetEffectiveUserAgent (per site) or config.GetEffectiveDefaultUserAgent (per host), which fall back to config.BuiltinUserAgent.
  • JSONL is read with crawler.NewJSONLScanner, which has no line length cap, and files that must not be left half-written go through utils.WriteFileAtomic.
  • Bodies that are thrown away go through fetch.Drain or fetch.DrainAndClose, which stop at 64 KiB.

Dependencies

  • github.com/mark3labs/mcp-go 1.5.0, modernc.org/sqlite 1.61.1.