Repository navigation
v2.26.0
·
81 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Behavior changes
- With
default_user_agentunset, crawls sendgithub.com/Sriram-PR/doc-scraper/<version>as the User-Agent on pages, images, robots.txt and sitemaps, likeadd,get_pageanddraft_sitealready 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'suser_agentanddefault_user_agentstill 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 declareminimum: 0(#114). - In
list_pagesanddiff_crawl, an offset past the end is echoed as given instead of as the end;totalandreturned: 0show there is nothing there (#114). - Over stdio, the MCP server refuses a request that comes before any
initializewith JSON-RPC error-32600, unless it ispingorserver/discoveror carries protocol 2026-07-28_meta. Protocol 2026-07-28 notes that a server answeringtools/callwithout a handshake misleads clients that probe for the protocol version. Pipinginitializeand 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 itsidcomes 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
_metacarries aprogressToken,get_job_statusreports pages crawled so far while it waits (at most once a second), anddraft_sitereports 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, andlist_pagesfailed with "token too long" (#109). - Crawls no longer turn on block and mutex profiling, which slowed every lock a little; a
-tags pprofbuild turns it on when-pprofis 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_siteconfig 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_sitejob. Pages still queued at the cancel are now released (#106). - A crawl job's status stays put once it ends: a
cancel_crawlthat lands just as the job starts can't be turned back intorunning, and a late error can't turncancelledintofailed(#106). draft_siteadds a warning when the preview page can't be extracted, instead of leaving the reason only in the preview'serrorfield (#114).- "Available sites" in errors is a plain list (
blog, docs), andget_pagereports an HTTP error asHTTP 404 Not Foundinstead of404 404 Not Found(#114). list_pagesandread_pageword the never-crawled case the same way (#114).
Search:
search_docspoints at an unmatched"when a query finds nothing (#114).searchprints 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 creatingstate_dirand an emptyindex.db, and likesearch_docsit points at an unmatched"when a query finds nothing (#103).- Deleting a site's
pages.jsonlremoves 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_patternsfor 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,Addcounts an accepted item, andDrainreleases what was never popped. Callers no longer callwg.Addbeforepq.Add, andExtractAndQueueLinkslost its WaitGroup argument. fetch.DefaultUserAgentis gone; useconfig.GetEffectiveUserAgent(per site) orconfig.GetEffectiveDefaultUserAgent(per host), which fall back toconfig.BuiltinUserAgent.- JSONL is read with
crawler.NewJSONLScanner, which has no line length cap, and files that must not be left half-written go throughutils.WriteFileAtomic. - Bodies that are thrown away go through
fetch.Drainorfetch.DrainAndClose, which stop at 64 KiB.
Dependencies
- github.com/mark3labs/mcp-go 1.5.0, modernc.org/sqlite 1.61.1.