Skip to main content
Glama

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

Related MCP server: go-docs-mcp

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

Available Tools

13 tools
cancel_crawlA
Idempotent

Cancel a running or pending crawl job by job ID. The previously stored corpus and crawl history are left untouched. Has no effect on jobs already in a terminal state.

Inputs: job_id (required). Returns: job_id, status, message, site_key, +1 more

crawl_siteA

Start a background crawl for a configured site. Returns immediately with a job ID. The crawl builds in a staging area and replaces the stored corpus only when it completes, so a cancelled or failed crawl leaves the previous corpus intact. A crawl that lost a large share of its pages is kept back instead (the job fails with refused set), and the stored corpus is kept.

Inputs: site_key (required), incremental, allow_shrink. Returns: job_id, status, message, site_key, +1 more

describe_serverA
Read-onlyIdempotent

Returns server identity, configured sites, and recent crawl jobs in one call. Call this first to orient yourself: it consolidates what would otherwise require list_sites plus several get_job_status calls. The MCP tool list is already advertised by the protocol so it is not duplicated here.

Inputs: no named parameters. Returns: sites, server, total_jobs, jobs_capped, +4 more

diff_crawlA
Read-onlyIdempotent

Return added/removed/changed pages between the latest crawl and a baseline crawl: the crawl before it by default, or with since, the most recent crawl whose crawl_ended_at <= since. Hash-based verdicts from the SQLite history index. To see what a crawl changed, run crawl_site, wait for it to finish, then call diff_crawl without since.

Inputs: site_key (required), since, offset, max_results. Returns: note, added, since, total, +9 more

draft_siteA
Read-onlyIdempotent

Draft a site entry and preview one page extracted with it. Never writes the config. With url, probes a new docs site the way doc-scraper add does (robots.txt, llms.txt, sitemap, framework detection). With only site_key, starts from that configured site's entry without probing. overrides sets entry fields by their config names (content_selector, allowed_path_prefix, disallowed_path_patterns, max_depth, ...); durations are strings such as "1s". Judge the preview (code blocks kept, nav_leak, chars), draft again with overrides until it looks right, then pass entry to save_site. max_depth is an exclusive bound: 1 crawls only the start pages.

Inputs: url, site_key, overrides, preview_url. Returns: entry, exists, preview, evidence, +10 more

get_freshnessA
Read-onlyIdempotent

Return the most recent crawl summary for a site (last_crawl with its start and end times, total_pages and mode, plus age_seconds), output/state dir presence and any running job. Use this to decide whether to query the existing crawl or run crawl_site first.

Inputs: site_key (required). Returns: site_key, last_crawl, output_dir, age_seconds, +4 more

get_job_statusA
Read-onlyIdempotent

Get the status and page counts of a crawl job. Set wait_seconds to wait for the job to finish instead of polling: the call returns as soon as the job completes, fails or is cancelled, or when the wait runs out, with the status at that moment.

Inputs: job_id (required), wait_seconds. Returns: job_id, status, refused, failures, +12 more

get_pageA
Read-onlyIdempotent

Fetch an HTML page live over the network and return its content as markdown. This is an on-demand fetch independent of any crawl: it does not read the stored crawl output, and it ignores the site's configured content_selector and scope. The result is text: header lines (url, title, content, fetch_time_ms), an empty line, then the markdown. Large pages are truncated at max_bytes, and the content line then gives next_offset; pass it as offset to read the rest (each call fetches the page again).

Inputs: url (required), offset, max_bytes, content_selector.

list_pagesA
Read-onlyIdempotent

List crawled pages for a site, paginated and sorted by URL. Returns metadata only (URL, title, depth, crawled_at, content_length). Pass any URL returned here to read_page to get its stored markdown; get_page re-fetches a URL live rather than returning the crawled copy.

Inputs: site_key (required), offset, max_results. Returns: pages, total, offset, message, +3 more

list_sitesA
Read-onlyIdempotent

List all configured sites available for crawling

Inputs: no named parameters. Returns: sites, config_path, total_sites

read_pageA
Read-onlyIdempotent

Return a page's markdown from the stored crawl output, without any network access. This is the counterpart to get_page: read_page serves the crawled copy that already had the site's content_selector applied, while get_page re-fetches the URL live. Use list_pages to discover URLs, then read_page to read them. Pass a search_docs result's anchor to read only that section. The result is text: header lines (site_key, url, title, content, section_end with an anchor, depth, crawled_at, content_hash, source, headings), an empty line, then the markdown. Large pages are truncated at max_bytes, and the content line then gives next_offset; pass it as offset to read the rest.

Inputs: url (required), site_key (required), anchor, offset, +1 more.

save_siteA
DestructiveIdempotent

Write a site entry to the config file and load it into the running server, so crawl_site, search_docs and read_page can use it at once. entry is a full entry by config field name, normally draft_site's entry with changes; fields left out are unset. Overwriting a configured site needs replace: true. Only the entry's lines change in the file. Refused while the site is crawling, and on servers started without -allow-config-writes. max_depth is an exclusive bound: 1 crawls only the start pages.

Inputs: entry (required), site_key (required), replace. Returns: written, replaced, site_key, next_actions

search_docsA
Read-onlyIdempotent

Full-text search across all crawled documentation, ranked by relevance (BM25 with stemming), with zero network access. Results carry the page URL, its section heading path, and a snippet with match terms marked [like this]; follow up with read_page for the full page. Supports FTS5 syntax: quoted phrases, OR, and trailing * for prefix matching. Searches the stored index only; run crawl_site first for uncrawled sites.

Inputs: query (required), limit, site_key. Returns: count, limit, query, results, +2 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools target distinct resource+action pairs, and the descriptions explicitly contrast the risky pairs (get_page live fetch vs read_page stored copy, describe_server vs list_sites/get_job_status). A few tools still cluster around crawl/job state introspection (get_freshness, get_job_status, describe_server), which could cause mild misselection, but the guidance mitigates it.

    Naming Consistency5/5

    Every tool follows a consistent snake_case verb_noun pattern: list_sites, crawl_site, cancel_crawl, diff_crawl, get_job_status, read_page, search_docs. No mixed conventions or vague single-word names.

    Tool Count5/5

    13 tools is well within the ideal 3-15 range and each tool maps to a distinct step in the site-config and crawl-to-read lifecycle. No filler tools are present.

    Completeness4/5

    The surface covers site configuration (draft_site/save_site), crawl lifecycle (crawl_site, cancel_crawl, get_job_status), retrieval (list_pages, read_page, get_page, search_docs), and change tracking (diff_crawl, get_freshness). The main gap is no delete/remove operation for a configured site or its stored corpus, which would require manual config edits.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Local-first MCP server providing semantic search over library docs, fully offline. Single Go binary speaks MCP over stdio against a vector index pinned to the binary version. Like Context7 with the internet turned off. Apache 2.0. Linux + macOS, also available as a container image.
      2
      4
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Go MCP server that lets your AI read documents: PDF, DOCX, XLSX, PPTX, ODT, EPUB, HTML, RTF, Markdown, CSV, Jupyter and images, with OCR, search, tables and paging. 13 read-only tools, one binary, Homebrew and Claude Code marketplace.
      13
      12
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Documentation crawler MCP server that crawls and indexes documentation sites so that any MCP-compatible AI can search, read, and expand on the content.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A documentation MCP server that crawls websites and Git repositories, stores them as Markdown, and provides tools to search and retrieve documentation for local LLMs and AI agents.
      Apache 2.0