doc-scraper

module
v2.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: Apache-2.0

README

LLM Documentation Scraper (doc-scraper)

CI Go Version Go Reference License Glama score

A configurable, concurrent, and resumable web crawler written in Go. Specifically designed to scrape technical documentation websites, extract core content, convert it cleanly to Markdown format suitable for ingestion by Large Language Models (LLMs), and save the results locally.

doc-scraper crawling a docs site and answering search queries offline

doc-scraper crawls documentation sites into clean Markdown and serves them to coding agents over MCP. Your agent searches and reads the docs you chose, offline, instead of guessing from training data or a live web search. Point doc-scraper add at any docs page and it detects the framework (30+ docs generators, including Docusaurus, Starlight, Sphinx, VitePress, Material for MkDocs, and mdBook), validates the content selector, and drafts the config for you.

Documentation: https://sriram-pr.github.io/doc-scraper/

Features

  • Offline search for agents: BM25 full-text search (search_docs) and page reads (read_page) over the stored corpus, with no network access
  • Framework detection: 30+ docs generators recognized, each selector validated on the page, Readability fallback, JavaScript-only shells reported instead of crawled empty
  • Clean output: GitHub-Flavored Markdown per page with frontmatter, plus pages.jsonl, llms.txt, and llms-full.txt
  • Polite and resumable: robots.txt and sitemaps, per-host rate limits, retries with backoff, resumable crawls, and staged output that never clobbers the last good copy
  • Stays fresh: incremental re-crawls, watch mode, and crawl history (get_freshness, diff_crawl)
  • Many sites at once: parallel crawls with shared limits

Install

Download a release binary (Linux, macOS, Windows; amd64 and arm64) from the Releases page, or:

go install github.com/Sriram-PR/doc-scraper/v2/cmd/doc-scraper@latest
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD":/data ghcr.io/sriram-pr/doc-scraper:latest crawl -site rust_cli_book

Claude Desktop users can install doc-scraper.mcpb from the latest release instead. Details: Install.

Quick start

doc-scraper add -site rust_cli_book https://rust-cli.github.io/book/index.html   # detect, preview, confirm
doc-scraper crawl -site rust_cli_book             # Markdown lands in ./crawled_docs/rust_cli_book/
doc-scraper search -site rust_cli_book "error handling"

Then give it to Claude Code:

claude mcp add --transport stdio doc-scraper -- /path/to/doc-scraper mcp-server -config /path/to/config.yaml

See Claude Code setup for scopes and a first prompt.

Docs

Contributing

Contributions are welcome. Read CONTRIBUTING.md before starting: it covers setup, the testing rules CI enforces, how to claim an issue, and the policy on AI-assisted contributions. Issues labeled good first issue are a good place to begin.

Report security problems privately as described in SECURITY.md. Everyone taking part follows the Code of Conduct.

Privacy Policy

doc-scraper collects nothing: no telemetry, no analytics, no accounts. All output and state stays on your machine, and the only network requests it makes are the crawls and fetches you explicitly ask for. Full policy: PRIVACY.md.

License

This project is licensed under the Apache-2.0 License.

Acknowledgements

Directories

Path Synopsis
cmd
doc-scraper command
pkg
chunk
Package chunk splits a page's markdown into heading-anchored sections for full-text indexing.
Package chunk splits a page's markdown into heading-anchored sections for full-text indexing.
discover
Package discover probes a documentation site with a handful of polite HTTP requests and derives a draft crawl configuration: framework and content selector, crawl scope, corpus size, and version/locale duplication warnings.
Package discover probes a documentation site with a handful of polite HTTP requests and derives a draft crawl configuration: framework and content selector, crawl scope, corpus size, and version/locale duplication warnings.
log
mcp
storage/index
Package index is the SQLite-backed crawl history store.
Package index is the SQLite-backed crawl history store.
taskspec
Package taskspec parses a JSON task description used by the `doc-scraper run` subcommand.
Package taskspec parses a JSON task description used by the `doc-scraper run` subcommand.
version
Package version holds the single release version shared by the CLI and the MCP server.
Package version holds the single release version shared by the CLI and the MCP server.
tools
detect-bench command
Command detect-bench measures pkg/detect against a battery of live documentation sites with labeled ground truth.
Command detect-bench measures pkg/detect against a battery of live documentation sites with labeled ground truth.
search-bench command
Command search-bench scores the full-text search ranking (index.SearchChunks, behind both the search CLI and the search_docs MCP tool) against labeled queries over frozen crawls of real documentation sites:
Command search-bench scores the full-text search ranking (index.SearchChunks, behind both the search CLI and the search_docs MCP tool) against labeled queries over frozen crawls of real documentation sites:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL