KiroGraph-Doc indexes project documentation by heading hierarchy and section structure. Instead of reading entire doc files — which can be thousands of tokens each — agents retrieve exactly the section they need via a stable section ID. This produces 92–97% token savings compared to full-file reads, tracked cumulatively inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/davide-desio-eleva/kirograph/llms.txt
Use this file to discover all available pages before exploring further.
kirograph_gain.
The module is inspired by jDocMunch-MCP by J. Gravelle.
Enabling Docs
AddenableDocs to .kirograph/config.json:
kirograph index or kirograph sync, KiroGraph scans for documentation files matching docsInclude patterns and indexes them section by section.
Supported Formats
KiroGraph-Doc ships nine format parsers:| Format | Extensions |
|---|---|
| Markdown | .md, .cheatmd |
| MDX | .mdx |
| reStructuredText | .rst |
| AsciiDoc | .adoc, .asciidoc |
| RDoc | .rdoc |
| Org-mode | .org |
| HTML | .html (in docs/) |
| Plain text | .txt (in docs/) |
| OpenAPI / Swagger | .yaml, .json (schema detection) |
How It Works
File scanning
KiroGraph walks the project tree, matching files against
docsInclude and docsExclude globs. Files larger than docsMaxFileSize are skipped.Parsing
Each file is parsed by its format handler into a section tree. Sections are split at heading boundaries — the heading text becomes the section
title, and the content below (up to the next heading) becomes the body. Children are nested headings.Stable section IDs
Each section receives a stable ID derived from the file path, the ancestor heading chain, the section title slug, and the heading level:IDs are stable across re-indexing as long as the heading structure does not change.
Incremental indexing
A SHA-256 hash of the full file is stored on the first root-level section. Re-indexing skips files whose hash has not changed.
Code ↔ docs cross-references
When
docsLinkCode: true, KiroGraph scans section content for backtick references, CamelCase identifiers, and snake_case patterns and resolves them against the code graph. Links are stored in doc_code_refs and exposed via kirograph_docs_refs.MCP Tools
Documentation tools requireenableDocs: true. The 5 tools add approximately ~241 tokens of tool descriptions to the model context.
kirograph_docs_toc — table of contents
kirograph_docs_toc — table of contents
Returns the table of contents for a specific file or for all indexed documentation.
Returns section IDs, titles, levels, and summaries — the starting point for targeted section retrieval.
| Parameter | Type | Default | Description |
|---|---|---|---|
file | string | — | Filter to a specific doc file. Omit for project-wide TOC. |
tree | boolean | false | Return a nested tree structure instead of a flat list |
projectPath | string | cwd | Project root path |
kirograph_docs_search — search doc sections
kirograph_docs_search — search doc sections
Search documentation sections by query text.
Searches are independent from code symbol search — FTS5 over section titles and summaries.
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | required | Search query (natural language or keywords) |
file | string | — | Narrow search to a specific doc file |
limit | number | 10 | Max results |
projectPath | string | cwd | Project root path |
kirograph_docs_section — retrieve a section
kirograph_docs_section — retrieve a section
Fetches the full content of a single documentation section by its stable ID.
Returns only the bytes for that section — not the entire file.
| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | required | Section ID from kirograph_docs_toc or kirograph_docs_search |
context | boolean | false | Include ancestor heading chain and child section summaries |
projectPath | string | cwd | Project root path |
kirograph_docs_outline — file heading hierarchy
kirograph_docs_outline — file heading hierarchy
Returns the complete heading hierarchy for a single documentation file.
| Parameter | Type | Default | Description |
|---|---|---|---|
file | string | required | Relative path to the doc file |
projectPath | string | cwd | Project root path |
kirograph_docs_refs — code ↔ docs cross-references
kirograph_docs_refs — code ↔ docs cross-references
Finds code symbols referenced by a doc section, or doc sections that reference a code symbol.
Requires
| Parameter | Type | Default | Description |
|---|---|---|---|
sectionId | string | — | Doc section ID (find code symbols it references) |
nodeId | string | — | Code symbol qualified name (find doc sections that reference it) |
projectPath | string | cwd | Project root path |
docsLinkCode: true for cross-references to be populated.Context Enrichment
SetdocsContextLimit to a positive number to have relevant doc sections automatically injected into kirograph_context results. Sections are included when their relevance score exceeds docsContextThreshold.
Config Reference
| Field | Type | Default | Description |
|---|---|---|---|
enableDocs | boolean | false | Enable documentation indexing |
docsInclude | string[] | ["**/*.md", "**/*.mdx", ...] | Glob patterns for doc files to include |
docsExclude | string[] | ["node_modules/**", ...] | Glob patterns to exclude |
docsLinkCode | boolean | true | Auto-link doc sections to code symbols |
docsContextLimit | number | 0 | Max doc sections in kirograph_context (0 = disabled) |
docsContextThreshold | number | 0.5 | Min relevance score to include a section in context |
docsMaxFileSize | number | 1048576 | Max doc file size in bytes (1 MB) |
docsSummarization | string | first-sentence | Summary strategy: embedding, first-sentence, or off |
