Skip to main content

Compress local documentation context for coding agents.

Project description

docmancer logo

docmancer

Local docs context for coding agents, plus version-pinned API tool surfaces.

PyPI version License: MIT Python 3.11 | 3.12 | 3.13

Quickstart | API MCP packs | Commands | Supported Agents | Docs


Docmancer is an MIT-licensed CLI on PyPI with two local surfaces:

  • Docs RAG. Fetch documentation with add, normalize it into sections, index with SQLite FTS5, and return compact context packs with source attribution on query. No vector DB, no embedding downloads, no remote query API.
  • API MCP packs. Install version-pinned MCP packs compiled from public OpenAPI / GraphQL / TypeDoc / Sphinx sources, then expose them to your agent through one shared mcp serve process. Two meta-tools regardless of how many packs you install (Tool Search). Auth, destructive-call gating, idempotency-key reuse, and version pinning all run inside the local dispatcher.
CLI demo

Quickstart

pipx install docmancer    # Python 3.11, 3.12, or 3.13
docmancer setup           # config + DB + agent skills + MCP server registration

setup creates ~/.docmancer/, writes the config, initializes the SQLite database, installs detected agent skills, and registers docmancer mcp serve into each agent's MCP config. Use setup --all for non-interactive installation across every supported agent. If pipx picks an unsupported interpreter, pin one explicitly: pipx install docmancer --python python3.13.

Docs RAG flow:

docmancer add https://docs.pytest.org
docmancer query "How do I use fixtures?"

API MCP pack flow (see API MCP packs for the full walkthrough):

docmancer install-pack stripe@2026-02-25.clover
export STRIPE_API_KEY=sk_test_...
docmancer mcp doctor

Agents call docs RAG through installed skills and API packs through the auto-registered MCP server. All agents on the same machine share one local SQLite index and one MCP manifest.


API MCP packs

Runtime support ships in the PyPI build. install-pack resolves artifacts in this order:

  1. Local cache.
  2. The hosted Docmancer artifact API.
  3. Built-in known-source fallback. Stripe packs are compiled locally from Stripe's public OpenAPI spec when precompiled artifacts are not already available.
# 1. Install. Output reports tool-surface size, required credentials, wire-pinned
#    headers, and how many destructive endpoints the pack exposes.
docmancer install-pack stripe@2026-02-25.clover
# Active tool surface: 8 (mode=curated; full=8)
# Required credentials: STRIPE_API_KEY
# Wire-pinned header: Stripe-Version: 2026-02-25.clover
# Destructive endpoints: 2 (gated)
# To enable: docmancer install-pack stripe@2026-02-25.clover --allow-destructive

# 2. Supply credentials. Process env is the second source in the four-source
#    resolution order (per-call override > env > agent-config env > secrets file).
export STRIPE_API_KEY=sk_test_...

# 3. Verify. Doctor checks SHA-256 per artifact, credential resolution, and
#    agent-config registration.
docmancer mcp doctor

# 4. Inspect. List shows mode, tool counts, and destructive gate state.
docmancer mcp list
# stripe@2026-02-25.clover  [enabled] mode=curated curated=8 full=8 destructive=block

# 5. Toggle without reinstalling.
docmancer mcp disable stripe --version 2026-02-25.clover
docmancer mcp enable  stripe --version 2026-02-25.clover

# 6. Opt in to destructive calls. The dispatcher refuses POST/PUT/PATCH/DELETE
#    by default and the error message names this exact reinstall command.
docmancer install-pack stripe@2026-02-25.clover --allow-destructive

# 7. Use the full surface (every operation, not just the curated subset).
docmancer install-pack stripe@2026-02-25.clover --expanded

# 8. Uninstall.
docmancer uninstall stripe@2026-02-25.clover

What the agent sees. tools/list returns exactly two tools regardless of how many packs you install: docmancer_search_tools (token-overlap search across every enabled pack's curated surface, returns the top match's full input schema inlined) and docmancer_call_tool (dispatches the resolved tool by its slug, e.g. stripe__2026_02_25_clover__payment_intents_create). Per-call schema validation, destructive gating, idempotency-key auto-injection (UUID4, reused on retry from a 24-hour SQLite fingerprint cache), version-header injection (Stripe-Version: 2026-02-25.clover), and call-log redaction (arg_keys only, never values) all happen inside the dispatcher.

Source-kind support today.

Source Compiled by pipeline Runtime executor
OpenAPI 3.0 / 3.1 yes http (live wire calls)
GraphQL introspection yes noop_doc (executor not yet wired)
TypeDoc / Sphinx yes noop_doc (documentation only)

Commands

Docs RAG

Command What it does
docmancer add <url-or-path> Fetch or read documentation and index normalized sections
docmancer update [<url>] Re-fetch and re-index existing sources (or one specific source)
docmancer query "<text>" Return a compact markdown context pack within a token budget
docmancer query "<text>" --format json Same context pack as JSON
docmancer query "<text>" --expand [page] Include adjacent sections, or the full matching page
docmancer list [--all] List indexed docsets, or every individual source
docmancer inspect SQLite index stats and extract locations
docmancer remove <source> / --all Remove one source (or everything indexed)
docmancer fetch <url> --output <dir> Download docs to markdown files without indexing

API MCP packs

Command What it does
docmancer install-pack <pkg>@<ver> Install a version-pinned API MCP pack from local cache, hosted registry, or known-source fallback
docmancer install-pack <pkg>@<ver> --allow-destructive Same, with the destructive-call gate open
docmancer install-pack <pkg>@<ver> --expanded Activate the full tool surface, not the curated subset
docmancer install-pack <pkg>@<ver> --allow-execute Permit python_import / shell executors (subprocess execution)
docmancer uninstall <pkg>[@<ver>] Remove an installed pack (all versions if no version given)
docmancer mcp serve Stdio MCP server bridging installed packs to your agent
docmancer mcp list Show installed packs, mode, tool counts, destructive gate state
docmancer mcp doctor Verify pack SHA-256s, credentials, and agent registrations
docmancer mcp enable|disable <pkg> [--version <v>] Toggle per-pack visibility without reinstalling

Setup, install, health

Command What it does
docmancer setup [--all] Create config/DB, install detected agent skills, register MCP server
docmancer install <agent> Manual skill installation for one agent (also registers MCP server)
docmancer init Create a project-local docmancer.yaml for a project-specific index
docmancer doctor Check config, SQLite FTS5, index stats, and agent skill installs

Retrieval shape

query defaults to a 2400-token budget and returns markdown with a per-call savings summary:

Context pack: ~900 tokens vs ~4800 raw docs tokens (81.2% less docs overhead, 5.33x agentic runway)

The numbers are estimates; the point is that the docs portion of the context shrinks so the agent has more room for actual work.


Project-local config

Global config lives under ~/.docmancer/. For a project-specific index:

docmancer init
docmancer add ./docs

docmancer init writes a docmancer.yaml pointing at .docmancer/docmancer.db and .docmancer/extracted/ inside the project. Without a project config, docmancer falls back to the global one.

index:
  db_path: .docmancer/docmancer.db
  extracted_dir: .docmancer/extracted/

Supported agents

setup auto-detects installed agents. Manual install for a single target:

docmancer install claude-code      # ~/.claude/skills + MCP server entry
docmancer install cursor           # ~/.cursor/skills + ~/.cursor/mcp.json
docmancer install claude-desktop   # zip via Claude Desktop's Skills UI
docmancer install codex
docmancer install cline
docmancer install gemini
docmancer install github-copilot
docmancer install opencode

Each agent install drops a skill file under the agent's conventional location and writes an idempotent docmancer entry into its MCP config so installed packs are picked up immediately. See the wiki › Install Targets for the exact paths per agent.


Optional extras

Extra Enables
docmancer[browser] Playwright fetcher for JS-heavy sites (used by add --browser)
docmancer[crawl4ai] Alternative fetcher for hard-to-scrape sites

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docmancer-0.4.8.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docmancer-0.4.8-py3-none-any.whl (173.2 kB view details)

Uploaded Python 3

File details

Details for the file docmancer-0.4.8.tar.gz.

File metadata

  • Download URL: docmancer-0.4.8.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docmancer-0.4.8.tar.gz
Algorithm Hash digest
SHA256 dc67db0a0d542101fae89476aeb4380d874a076f1ea33c92fe180bb19b3210bf
MD5 22a4a4c7da250736e4fd7d7cd038039e
BLAKE2b-256 3de9c2aef6e3c8d06e746752d79d4eb7e5e4f0aba6fe38655e1572f46ae8d2f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for docmancer-0.4.8.tar.gz:

Publisher: publish.yml on docmancer/docmancer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docmancer-0.4.8-py3-none-any.whl.

File metadata

  • Download URL: docmancer-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 173.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docmancer-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3f634665f22de82ea7a6e0c9ea33dcecf1281704414dad7b5d1e7320783a392c
MD5 1ef2d0ace416ab192ecd1ff1de37328c
BLAKE2b-256 575ad06381f80ee8b6d812907a90234dc9bae60134693ced14cf2070ba85d7aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for docmancer-0.4.8-py3-none-any.whl:

Publisher: publish.yml on docmancer/docmancer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page