BM25 search + tree navigation over markdown docs for AI agents. No embeddings, no LLM calls.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Agentic document retrieval over markdown, CSV, and JSONL. BM25 + tree navigation via MCP β no vector DB, no embeddings, no LLM calls at index time.
The pitch: MCP provides the structural primitives (a navigable tree, BM25, glossary, row lookup). The bundled skills provide the procedural knowledge (how to walk that tree). Together the agent behaves like a trained research librarian β not a one-shot searcher. See The Skill + MCP Pattern.
Have docs already? Point a client at them:
Restart the tool β ask "search the docs for X" or invoke the doc-read prompt.
Starting fresh? Scaffold a Karpathy-style LLM wiki:
Creates docs/wiki/ (LLM-maintained) + docs/raw-sources/ (your inputs), writes the MCP config, installs a post-write lint hook, appends wiki conventions to CLAUDE.md / AGENTS.md / .cursor/rules/.
| Mode | Use when | Guide |
|---|---|---|
| stdio (default) | Local dev, agent on your machine | Client setup |
| HTTP (Streamable HTTP) | Teams, CI, hosted agents | Deployment β Railway Β· Fly Β· Render Β· Cloudflare Containers Β· Docker |
| CLI | init, lint, debug-index | Operation modes |
Full decision tree: Operation Modes.
Core read tools (always on):
| Tool | Purpose |
|---|---|
search_documents | BM25 keyword search + facet filters + glossary expansion (markdown Β· CSV Β· JSONL) |
get_tree | Table of contents β headings, word counts, summaries |
get_node_content | Full text of a specific section by node ID |
navigate_tree | A section plus all descendants in one call |
lookup_row | O(1) exact-key lookup for structured data rows (e.g. PROJ-44) |
Wiki write tools (opt-in with WIKI_WRITE=1):
| Tool | Purpose |
|---|---|
find_similar | Duplicate detection with overlap ratios |
draft_wiki_entry | Scaffold: suggested path, inferred frontmatter, glossary hits |
write_wiki_entry | Validated write: path containment, schema, duplicate guards, dry-run |
Safety: path containment Β· frontmatter validation Β· duplicate detection Β· dry-run Β· overwrite protection.
Deprecated aliases (list_documents, find_files, find_symbol) are superseded by search_documents β still functional, no longer recommended.
Most retrieval tools hand the agent a search box and hope for the best. doctree-mcp hands it a tree, and the bundled skills teach it how to walk one.
search_documents, get_tree, navigate_tree, get_node_content, lookup_row return tree positions the agent reasons over β not finished answers./doc-read, /doc-write, /doc-lint encode breadcrumb drill-down: search β outline β navigate β retrieve. The agent learns the policy, not just the API.That pairing doesn't exist cleanly elsewhere:
| Approach | Primitive | Skill teaches | Gap |
|---|---|---|---|
| Managed hybrid RAG (Cloudflare AI Search, Nia) | Flat chunks + similarity | β | Black-box score, no audit trail |
| Tool-returns-answer (Context7) | 2 tools returning answers | Query shape | Agent can't reason about skipped content |
| Skill-over-CLI (QMD) | CLI over flat search | Query expansion | No tree to navigate |
doctree-mcp + /doc-read | Navigable tree | Breadcrumbs, multi-instance routing, wiki compilation | β |
Why iterative retrieval wins:
search_documents β get_tree β navigate_tree β get_node_content is a replayable trail. A cosine score is not. Regulated domains can ship the former.Multi-instance = client-side federation. Register several doctree servers under different names; the /doc-read skill encodes the routing policy. Add or remove instances without touching the skill. See Client setup β Multi-instance routing.
Inspired by Karpathy's LLM Wiki. Full walkthrough: docs/LLM-WIKI-GUIDE.md.
All non-reserved frontmatter fields become filter facets:
Common env vars:
| Variable | Default | Description |
|---|---|---|
DOCS_ROOT | ./docs | Docs folder |
DOCS_GLOB | **/*.md | Comma-separated globs (**/*.md,**/*.csv,**/*.jsonl) |
DOCS_ROOTS | β | Weighted multi-collection (./wiki:1.0,./rfcs:0.5) |
PORT | 3100 | HTTP mode port |
WIKI_WRITE | (unset) | 1 enables write tools |
GLOSSARY_PATH | $DOCS_ROOT/glossary.json | Query-expansion glossary |
Full reference: docs/CONFIGURATION.md.
Glossary β place glossary.json in docs root for bidirectional query expansion:
Acronym definitions like "TLS (Transport Layer Security)" are also auto-extracted.
Structured data β CSV/JSONL files become documents where each row is a tree node. Column roles (id, title, description, facets, URL) are auto-detected from headers. See docs/STRUCTURED-DATA.md.
| Operation | Time | Token cost |
|---|---|---|
| Full index (900 docs) | 2β5s | 0 |
| Incremental re-index | ~50ms | 0 |
| Search | 5β30ms | ~300β1K tokens |
| Tree outline | <1ms | ~200β800 tokens |
Setup & operation
Patterns & concepts
Source
/doc-read Β· /doc-write Β· /doc-lintMIT
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/doctree-mcp)<a href="https://allmcps.com/mcp/doctree-mcp"><img src="https://allmcps.com/api/badge/doctree-mcp?style=directory" alt="Doctree MCP on AllMCPs" /></a>