jDocMunch-MCP

by jgravelle

Not rated
GitHub

About

jDocMunch-MCP lets AI agents navigate documentation by section instead of reading files by brute force.

Details

Author
jgravelle
Categories
Developer Tools, Knowledge Base, Other

Setup

Install jDocMunch-MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/jgravelle/jdocmunch-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

jDocMunch is an MCP server for coding agents that retrieves the exact documentation section a task needs, without loading whole files into the context window.

Index a documentation set once by heading hierarchy, then fetch a single section, a heading subtree, or a ranked search result — extracted byte-precisely from the original file.

Install·Quickstart·Benchmarks·Commercial licensing

Free for personal use.Commercial use requires a paid license —terms below.

The problem.An agent asked "how do I configure authentication?" opens a documentation file, skims hundreds of paragraphs it does not need, opens another, and repeats. Large context windows do not fix this. They just make the waste affordable enough to ignore until the bill arrives, and they crowd out the context the model actually needed.

The mechanism.jDocMunch parses a documentation set into a section tree keyed by heading hierarchy, stores each section's byte offsets into the original file, and exposes retrieval over MCP. Sections keep durable identities across re-indexing as long as path, heading text, and heading level are unchanged.

The outcome.The unit of access changes fromfiletosection. An agent retrieves the installation section, one configuration block, or a specific heading subtree — and nothing else.

Search and retrieve documentation by section, not just file path or keyword match.

Full content is pulled on demand from exact byte offsets into the original file.

Sections retain durable identities across re-indexing when path, heading text, and heading level remain unchanged.

Four benchmarks against public documentation corpora, each with the corpus, date, and per-query results recorded inbenchmarks/.

Read these as per-corpus results, not as a single headline multiple.Savings depend on how large the containing file is relative to the section you needed: a small file with one heading saves almost nothing, and the Kubernetes corpus saves a great deal. The benchmark files record the queries that did poorly alongside the ones that did well.

A separate, measured result from thev1.121.0projection work, on this repository's own docs atmax_results=10: a search row went1,989 chars → 319 withcompact=true(−84%), or 431 withsnippet_bytes=200(−78%) while removing the follow-upget_sectioncall entirely.

Retrieval quality is gated, not assumed.Every release runs a replay fixture over a frozen golden set and fails belownDCG 0.95. That gate has failed builds and blocked releases; it is not decorative.

Requirements:Python 3.10+, any MCP-compatible client.

uv tool install jdocmunch-mcp jdocmunch-mcp init

No virtualenv to manage, nothing written into system Python, and it works as-is on PEP 668 distros (Ubuntu 24.04+, Debian 12+) where barepip installis refused.Don't haveuvyet?

initdetects your MCP clients, writes their config entries, installs the doc-exploration prompt policy so your agent actually reaches for the tools, and optionally installs hooks and indexes your docs.

claude mcp add -s user jdocmunch -- uvx jdocmunch-mcp

No install step —uvxfetches and runs the server on demand. Prefer it on your PATH (and required for hooks)?uv tool install jdocmunch-mcp, thenclaude mcp add -s user jdocmunch jdocmunch-mcp.

Installing the server makes the tools available; it does not break an agent's habit of brute-reading files. One line in yourCLAUDE.mddoes that:

Call the jdocmunch_guide tool and strictly follow its instructions.

Assumes:jDocMunch installed and registered with your client, and a folder of documentation.

It prints JSON naming the corpus and what it found:

{ "success": true, "repo": "local/docs", "file_count": 1, "section_count": 4, "doc_types": { ".md": 1 }, "semantic_search": false }

section_countgreater thanfile_countis the whole point: the index addresses headings, not files.

Using jdocmunch, search the docs for "authentication configuration" and show me that section.

The agent should callsearch_sections, thenget_sectionon the top hit — returning one section rather than a file._meta.tokens_savedon the response reports what that cost versus reading the containing document.

Next step:get_toc_treefor a structural view of the whole corpus, orindex_repoto index documentation straight from a GitHub repository.

- Retrieve one section instead of a document.get_sectionandget_sectionspull byte-precise content from the original file;get_section_excerptnarrows further.
- Search by meaning, not just keywords.search_sectionsfuses BM25 with semantic cosine when an embedding provider is configured.compact=true,fields=
[...], andsnippet_bytes=Ncut the response further.
- Navigate structure.get_toc,get_toc_tree,get_section_path,get_section_descendants, andsection_neighborstraverse the heading tree without reading content.
- Find what documentation is missing or rotting.get_doc_coverage,get_undocumented_symbols,get_stale_pages,get_orphan_sections,get_broken_links, anddoc_health_radar.
- Work across API specs.find_endpoint,list_endpoints_by_tag,find_operations_using_schema, andget_schema_graphtreat OpenAPI documents as first-class.
- Preflight documentation changes.check_section_delete_safeandget_section_blast_radiusbefore you remove or restructure.
- Know when an answer is stale.Content reads disclose_meta.freshness,_meta.verdict, and which source layer answered.

64 tools in total. The full reference is inUSER_GUIDE.md.

Everything runs locally. Indexes live under your home directory; no hosted service is required for indexing or retrieval.

docs/ ──► parser (per format) ──► section tree ──► local index │ MCP client ◄── retrieval ◄──┘

- Parsingis per format, one module each: Markdown/MDX, reStructuredText, AsciiDoc, Jupyter notebooks, HTML, plain text, OpenAPI (YAML), JSON/JSONC, XML/SVG/XHTML, Godot scenes, and — via the optional[office]extra — PDF, DOCX, PPTX, and EPUB.
- Storageis a versioned local index (INDEX_VERSION = 3) that auto-migrates on first load. A 1.x release never forces a reindex.
- Retrievalis lexical BM25 by default, hybrid when embeddings are available.
- Embeddings are optional and provider-agnostic— Gemini, OpenAI, an OpenAI-compatible endpoint, or local sentence-transformers. Without one, search stays lexical and entirely offline.

Deeper detail:ARCHITECTURE.mdand[SPEC.md.

Local-first by design. Your documentation is parsed and stored on your machine, and the base package's only default network behavior is an anonymous savings counter — a random ID plus aggregate token counts, no content, no paths, no PII.

Embedding and summarizer providers call their configured APIonly when you enable them, and never by default.watch-installregisters a login serviceonlywhen you run it yourself.

A child process, when local embeddings are in use.When thesentence-transformersprovider is active, jDocMunch runs the embedding model in achild process(python -m jdocmunch_mcp.embeddings.worker) instead of inside the server. It:

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.