DocPull
Active open-source project · MIT License
Web context for AI agents. DocPull fetches any public web source, locks exactly what it fetched, serves agents cited passages from that locked copy, and tells you when a change upstream breaks something an agent already cited.
A source can be a docs site, a pricing or product page, a changelog, a policy, a feed, a GitHub repo, an npm or PyPI package, a paper, a standard, a dataset, or a local PDF. Use DocPull when an agent's answers depend on the live web and you need to know which pages it used, whether they changed, and how to rebuild the same context later.
Install and sync your first source
Five commands cover the daily loop:
pip install docpull
docpull init payments-context # 1. declare sources
docpull add docs.stripe.com stripe.com/pricing npm:stripe github.com/stripe/stripe-node
docpull sync # 2. fetch and lock
docpull query "retry policy" --max-tokens 4000 > answer.json # 3. cited passages
docpull impact answer.json # 4. did a change break them?
docpull ci # 5. gate freshness and quality
docpull add works out what each input is: a site, a page, a package, a repo, a
paper (doi: or arXiv), a feed, an OpenAPI spec, or a PDF.
| Command | What it does |
|---|---|
init / add |
Create docpull.yaml and declare web pages, sites, packages, repos, papers, feeds, or files. |
sync |
Fetch sources into a new run and pin .docpull/context.lock.json. |
query |
Return deduplicated passages from locked archives with a token budget and exact source spans. |
impact |
Report saved citations that a later source change made stale, contradicted, or broken. |
ci |
Check freshness, citation coverage, pack quality, and rights; exit non-zero on a hard gate. |
docpull --help lists the core and pack commands. docpull help --all lists every
command, and docpull help <command> shows its options. No account or paid API is
required: fetching, discovery, extraction, indexing, diffs, and queries run locally.
See Query locked context for
budget semantics and queries across projects.
MCP setup
Install the MCP extra and register the stdio server with the core toolset, which exposes the query, impact, read, and fetch tools an agent needs day to day:
pip install 'docpull[mcp]'
claude mcp add --transport stdio docpull -- docpull mcp --toolset core
Add --toolset project or --toolset packs (repeat or comma-separate) for more
tools; the default is all. Project writes stay off unless you pass
--allow-project-writes. See MCP server for HTTP and the full list.
Ready-made packs
Popular sources are prebuilt in the signed public registry. A pack is a recipe: source URLs, pinned pages, and content hashes, never content. DocPull fetches the pages on your machine and reports which still match:
export DOCPULL_REGISTRY_PUBLIC_KEY=k2wv0zPUlj88D66zXXQD86Knnt66MoJN2ztFitdDg00=
docpull add stripe@latest
Packs rebuild daily from registry/catalog.yaml; a new
version appears only when the pages changed.
GitHub Action
Check saved citations on every pull request. The action runs docpull ci, keeps
one comment on the PR ("2 cited claims changed upstream"), and fails on a hard gate:
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: raintree-technology/docpull@v6.11.0
with:
args: --citations evidence/answers.json
See Context CI for inputs and outputs.
Why use DocPull
- Reproduce agent context. Stable IDs, hashes, manifests, and lockfiles show which source versions produced an answer or artifact.
- Detect web drift. Sync and diff docs, product and pricing pages, changelogs, policies, feeds, repositories, packages, standards, and local documents.
- Catch stale citations.
docpull impactmarks each saved citation valid, stale, contradicted, or broken; on a controlled benchmark it caught every changed fact that a cache-only agent would have kept serving. - Keep web text from steering agents. Query results withhold passages that match prompt-injection patterns and say how many were withheld.
- Keep evidence inspectable. Markdown, NDJSON, SQLite, citations, and provenance sidecars remain readable without a hosted service.
- Choose the downstream surface. Export context for agent clients, vector import, data workflows, or a versioned context-pack release.
- Keep expensive routes explicit. Browser and cloud rendering require an explicit choice and can be blocked with a zero-dollar budget.
How it works
declared sources → local acquisition → versioned evidence → diff and validation → export
docpull diff compares runs with hash-based change reports, and
docpull export context-pack --target cursor writes context for an agent client.
Source URLs, content hashes, run IDs, and citations travel with every artifact.
DocPull's v3 pack contract separates raw extraction, agent-ready context, and eval-grade evidence. Validate the level a downstream system requires:
docpull pack prepare packs/docs --eval-grade
docpull pack validate packs/docs --level eval
docpull ci --prepare
docpull ci checks freshness, citation coverage, pack quality, rights metadata, and
other configured gates. It writes context-ci.report.json and CONTEXT_CI.md, then
exits non-zero when a hard gate fails.
Supported surfaces
| Surface | Use it for | Start here |
|---|---|---|
| CLI | Fetch, sync, diff, validate, and export | docs/cli-recipes.md |
| Python SDK | Embed acquisition in Python applications | docs/surface-contract.md |
| MCP server | Give local agent clients source tools | MCP server |
| TypeScript SDK | Read local packs and invoke the CLI from Node or Bun | sdk/js/README.md |
| Agent plugin | Install the supported MCP workflow in an agent client | plugin/README.md |
Common source shapes include static and server-rendered websites, OpenAPI documents, feeds, papers, public GitHub repositories, npm and PyPI packages, standards, datasets, transcripts, Wikimedia pages, product and policy pages, and local PDF or office files. See context-pack workflows for the complete surface.
MCP server
pip install 'docpull[mcp]'
docpull mcp # stdio, every tool
docpull mcp --toolset core,project # fewer tools for a smaller agent context
| Toolset | Tools |
|---|---|
core |
context_query, context_impact, read_doc, grep_docs, list_indexed, ensure_docs, list_sources, fetch_url, project_status |
project |
project_status, project_outdated, project_install, project_sync, project_update |
packs |
Pack builders, pack_*, graph_*, export_pack, audit_pack, refresh_pack, intelligence_bundle, workflow_run |
all |
Everything above plus render_url, explain_routes, validate_policy, serve_pack_status, add_source, remove_source |
DOCPULL_MCP_TOOLSET=core sets the same choice from the environment. Calling a tool
outside the enabled toolsets returns an error that names the toolset to add.
For clients that speak Streamable HTTP, run the same server locally:
pip install 'docpull[mcp,serve]'
docpull mcp --transport http --toolset core # http://127.0.0.1:8765/mcp
The HTTP server has no authentication. It binds 127.0.0.1 by default, rejects
requests whose Host or Origin header is not a loopback address (DNS rebinding
protection), and refuses a non-loopback --host unless you also pass --allow-remote.
Limits and security boundary
DocPull is an evidence-acquisition engine, not a hosted competitive-intelligence product. It owns fetching, explicit rendering adapters, versioning, citations, hashing, validation, replay, and export. Downstream products own scheduling, human review, approved claims, legal conclusions, accounts, and notifications.
The default path does not handle complex interactive browser workflows, CAPTCHAs, stealth scraping, or private dashboards. JavaScript rendering is explicit. Authenticated sources require environment-variable references; DocPull does not persist credential values in project artifacts.
Security defaults include HTTPS-only fetching, robots.txt compliance, SSRF and DNS rebinding protections, redirect guards, XXE protection, and path-traversal checks. Read the web-source boundary, security posture, and evidence-engine decision before extending acquisition behavior.
Documentation and evidence
- CLI recipes — Common commands and advanced workflows.
- Context dependencies — Project and lockfile model.
- Context Pack Contract v3 — Artifact levels and compatibility.
- Public contracts — Schemas and versioning rules.
- Alternatives — Browser automation and hosted extraction tradeoffs.
- JavaScript SDK and loaders — TypeScript client and LangChain/LlamaIndex loaders.
- Dependency security — Locked dependency sets and optional parser support.
- Evaluation lab — Reproducible methods, results, and claim boundaries.
- Changelog — Release history.
Raintree open-source system
DocPull owns evidence acquisition and reproducible agent context. It can be used independently; the sibling projects do not imply a required integration or shared release cycle.
| Project | Responsibility |
|---|---|
| Raintree Standards | Defines governed requirements and evidence. |
| Trellis | Enforces shared JavaScript and TypeScript code policy. |
| HIG Doctor | Audits interface source and provides HIG guidance. |
| PolicyStrata | Tests cross-layer policy behavior. |
See the Raintree open-source portfolio for current lifecycle and distribution links.
Raintree also builds BetterOff, which keeps a household's spending, investments, assets, debts, and net worth in one current record.
Project policies
Contributing · Code of Conduct · Security · Metrics and evidence limits · Source repository · MIT License
Metadata
Release files for docpull 6.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docpull-6.11.0.tar.gz | 885.5 kB | With provenance | Details for docpull-6.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| docpull-6.11.0-py3-none-any.whl | Python 3 | none | any | Details for docpull-6.11.0-py3-none-any.whl |
Total release size: 1.6 MB
Release files / docpull-6.11.0.tar.gz
| Download URL | docpull-6.11.0.tar.gz |
|---|---|
| Size | 885.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7af5d48076ebcc04f2a78813df5883dce27eedf1bc1a6fcfe0934c02e4cb6a30
|
|
BLAKE2b-256 checksum How to use checksums |
48efc45f747e8583b1d30cacc7b3466730f89243b5789a52bbc77d49133c9bc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / docpull-6.11.0-py3-none-any.whl
| Download URL | docpull-6.11.0-py3-none-any.whl |
|---|---|
| Size | 731.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
beba02729df36909cebe9f07fb289ab731c138c1307d33abdd68432e092c3cad
|
|
BLAKE2b-256 checksum How to use checksums |
3a41d8239bcaf53d41d5c7acf02a3ab51f0e5e2b8e8c8db5aa12179407ca5884
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for docpull 6.11.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for docpull-6.11.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.