DocGraph
Documentation knowledge graph MCP server for LLM agents
MCP-native for LLM agents · CJK + Latin FTS5 · Multi-format graph
에이전트 강화
게시자가 제공하는 설치 방식입니다. PlugMCP 엔드포인트가 아닙니다.
원격 URL인가요, 내 컴퓨터에서 실행하는 명령인가요? 두 설치 방식의 차이
PlugMCP에서 실행
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
실행게시자 제공
MCP-native for LLM agents · CJK + Latin FTS5 · Multi-format graph
Govern your documents like code. MCP server that indexes .md/.docx/.html/.pdf into a SQLite knowledge graph and runs drift audits — stale policies, conflicting research claims, superseded docs, undocumented code exports. 12 MCP tools incl. cross-reference graph, governance + provenance metadata, topic similarity. Single binary, zero runtime deps.
Govern your documents like code. DocGraph indexes .md, .docx, .html, and .pdf into a graph and runs drift audits on them — stale policies, conflicting research claims, superseded ADRs, undocumented code exports — so you can review your doc corpus the way you review a codebase. Most doc tools index and search. DocGraph also tells you what's broken.
docgraph_context format=drift_audit
Surfaces 14 finding codes across the corpus. A few:
policy.stale_review — SOPs past their review_due datepolicy.superseded_referenced — docs citing a replaced policypolicy.conflicting — same scope, contradicting rulesresearch.competing_interpretations — claims that contradictresearch.unverified_evidence — assertions with no sourceresearch.superseded_claim — research overruled by a newer claimdoc.stale_by_git — docs with no git commits in a long whilecode.undocumented_export — code surfaces with no doc anchorcode.unanchored_feature — approved features with no code anchorThree packs ship enabled (governance, research_provenance, entity); three are opt-in (policy_process, assessment_drift, code_doc). No code knowledge required for governance and research — they work on any document collection.
Your .docx / .pdf / .html archive has no frontmatter, so it can't be governed. DocGraph fixes that without compromising authority:
agent → docgraph_enrichment(action=pending)
↳ scope (N docs), per-model USD estimate, sensitive paths flagged, token
user → "go"
agent → runs LLM with its own key, then action=process for each doc
↳ stored as source=agent_inferred (advisory, lowest authority)
↳ logged with model_id, agent_id, run_id, content_hash
The confirmation token is batch-bound — one user consent authorizes the docs the user saw, no more. Sensitive paths silently refuse to issue tokens. agent_inferred metadata never overrides human frontmatter or extracted document metadata. Your governance survives the agent. DocGraph itself never calls an LLM. Enable with --enable-enrichment.
docgraph_graph operation=incoming|outgoing|impact|traceformat=context_pack returns indexed text, hashes, citations, impact (not a RAG black box)A RAG black box, an embedding shop, or a Notion replacement. It's the layer that makes your existing docs auditable, navigable, and safe to feed to LLMs.
The LLM-facing fit guide — when DocGraph helps a project and when to use your own tools instead — is in AGENTS.md. Single binary, zero runtime dependencies, indexes hundreds of docs in seconds.
go install github.com/Detective-XH/docgraph@latest
Or build from source with version embedded:
git clone https://github.com/Detective-XH/DocGraph.git
cd DocGraph
go build -ldflags "-X main.version=$(git describe --tags --always)" -o docgraph .
Requires Go 1.25 or later.
go installdoes not support-ldflagsinjection, sodocgraph versionwill outputdevfor binaries installed that way. Use the source build above to get a versioned binary.
docgraph init [--dry-run] [--interactive] [--install-clients auto|all|LIST] [--workspace] [--scope user] [--with-skills] [--update-skills] [path] # Create local config; optionally install MCP clients and bundled skills
docgraph install [--dry-run] [--interactive] [--clients auto|all|LIST] [--workspace] [--scope user] [--update-skills] [path] # Configure MCP clients without re-initializing
docgraph pack list [--workspace] <path> # List domain packs and enabled state
docgraph pack enable [--workspace] [--no-sync] <pack-id> <path> # Enable a domain pack; code_doc syncs by default
docgraph pack disable [--workspace] <pack-id> <path> # Disable a domain pack; code_doc rows are removed
docgraph index [--force] [--threshold N] [--no-gitignore] [--no-history] <path> # Index a project
docgraph sync [--threshold N] [--no-gitignore] [--no-history] <path> # Incremental hash-based update
docgraph heal [--project <path>] [--fix] [--owner <name>] [--git-timeout <dur>] # Infer and patch missing status/owner frontmatter fields in .md files
docgraph status <path> # Print index stats
docgraph serve [--threshold N] [--no-gitignore] [--no-history] [--max-watches N] [--enable-embeddings] [--enable-enrichment] --path <path> # MCP stdio server (single project)
docgraph serve [--threshold N] [--no-gitignore] [--no-history] [--max-watches N] [--enable-embeddings] [--enable-enrichment] --workspace <dir> # MCP stdio server (auto-discover all child dirs)
docgraph version # Print build version
LIST is a comma-separated client list: claude,codex,hermes,opencode.
auto always writes project-local Claude Code config and also writes Codex,
Hermes, and OpenCode config when their config directories already exist.
all creates config files for every supported client.
Use --dry-run to print create/update/unchanged actions without writing files.
Use --interactive to print the same review and confirm before writes.
When installing for Claude Code, DocGraph automatically installs companion skills
into .claude/skills/ alongside the MCP config — no extra flag needed:
docgraph init --install-clients claude /path/to/project # MCP config + skill
docgraph install --clients claude /path/to/project # MCP config + skill
To install skills on a project that was already initialized without --install-clients:
docgraph init --with-skills /path/to/project
Skills are installed with skip-if-exists policy — safe to re-run. To update an existing skill to the latest bundled version:
docgraph init --update-skills /path/to/project
docgraph install --clients claude --update-skills /path/to/project
The docgraph-drift-audit skill audits all indexed .md files for DocGraph
compatibility: missing frontmatter, isolated docs (no outgoing links), broken
wikilinks, headings, and similarity islands. Reports PASS/FAIL per category and
offers auto-fix via docgraph_files and docgraph_similar.
Available skills bundled in the binary:
docgraph_graph supports operation=incoming|outgoing|impact|trace. Use
document for incoming, outgoing, and impact; use from and to for trace.
Start with docgraph_context for any research question. It composes search,
structure, and cross-references into a single result. Use the other tools
to drill into specifics.
For the agent-facing decision of whether to install/use DocGraph at all, see AGENTS.md. Once installed, tool-selection rules are in the MCP serverInstructions (injected each session) and the per-tool descriptions.
The full mechanics of the opt-in workflow summarized at the top of this README. DocGraph never calls an LLM itself — your agent does, with its own key, then writes results back with provenance.
docgraph_enrichment(action=pending, limit, content_mode) returns
frontmatter-less documents without a current inferred summary, including
doc_id, content_hash, and bounded content. The response includes a
CONFIRMATION_TOKEN bound to the batch of doc_ids it lists.docgraph_enrichment(action=process, doc_id, content_hash, summary, metadata, confidence, model_id, provider, agent_id, confirmation_token)
stores the result. model_id is required, content_hash must match the
pending response, and confirmation_token must be the one returned by
action=pending for a doc_id in that batch.Inferred metadata never overrides authored frontmatter or extracted document
metadata. Stored summaries appear in docgraph_node, docgraph_context, and
context packs. docgraph_status reports enrichment coverage and stale results.
Normal retrieval uses one current enrichment per document, while DocGraph keeps
an internal run ledger with model, provider, agent, and content-hash provenance.
Agent-inferred summaries and metadata are advisory context, not source of truth.
Privacy: docgraph_enrichment action=pending returns document content that your
agent may send to an external provider. Get user consent before proceeding.
DocGraph computes topic similarity between documents using three signals:
Documents scoring above the threshold (default 0.25) are connected with
similar_to edges. This finds conceptually related documents even when
they don't explicitly link to each other — the key advantage over
grep-based search.
Similarity is computed automatically during indexing. Query with
docgraph_similar. Tune sensitivity with --threshold N on index, sync,
or serve; lower values create more similar_to edges.
DocGraph never calls an LLM itself. Instead, your agent computes embeddings with any provider and pushes the vectors back — a pull-then-push agentic workflow that enables semantic search far beyond TF-IDF vocabulary matching.
docgraph_embeddings(action=pending, model_id, limit, content_mode) — returns docs without up-to-date embeddings, including content and content_hash. content_mode=full (default) reads the full section from disk; content_mode=excerpt uses the stored body excerpt. Different model_id values are partitioned separately and never compared with each other.docgraph_embeddings(action=store, doc_id, model_id, vector, content_hash) per doc — stores the vector and recomputes neural similar_to edges. Pass content_hash exactly as returned by step 1.docgraph_similar deduplicates TF-IDF and neural results for the same pair, preferring neural when both exist.In workspace mode, both embedding workflows automatically locate the correct per-project store by doc_id.
Privacy: pending embedding actions return document content that your agent will send to an external provider. Get user consent before proceeding.
Use docgraph_embeddings(action=clear, model_id) to delete all vectors for a model and reclaim space. docgraph_status shows a Neural Embeddings table listing stored models, total vectors, and stale count.
Nodes: document, heading, definition, tag; optional code_file
nodes when the code_doc domain pack is enabled.
Edges:
Markdown (.md) — up to 1 MB per file:
**Term:** definition lines produce structural nodes[[wikilinks]], [links](path.md), ![[embeds]], external URLs, and frontmatter tags produce typed edgesWord documents (.docx) — up to 10 MB per file:
heading nodes with containment edgesdocx_hyperlink edges; Dublin Core metadata (core.xml) stored as key/value tuplesHTML (.html, .htm) — up to 5 MB per file:
<h1>–<h6> tags (including id attributes) become heading nodes<meta name=…> and <meta property=…> stored as metadata tuples; <a href=…> become typed link edges<script> and <style> content excluded from body text and section chunksPDF (.pdf) — up to 50 MB / 500 pages per file:
heading node and a section chunkwarning: image-only-pdfUni*-UCS2-* (UniGB/CNS/JIS/KS), 90ms-RKSJ-* (Shift-JIS), GBK-EUC-H/V (Simplified Chinese), ETen-B5-H/V (Traditional Chinese), KSCms-UHC-H/V (Korean). Pages that still cannot be decoded are flagged with warning: extraction-failed:encoding-garbage and skipped rather than indexed with replacement-character garbageCode documentation surfaces (opt-in) — up to 1 MB per file:
code_doc domain pack to index file headers, exported doc comments, test names, and example names:
docgraph pack enable code_doc /path/to/projectdocgraph pack enable --workspace code_doc /path/to/workspacedocgraph pack list /path/to/projectcode_file node per source file; incremental pack enable sync completes in 1–4s for 40–80 code files, up to ~12s for 300+ code filesdocgraph_search still returns documentation only by default — opt code files in with kind=code_file or include_code=true — and format=drift_audit surfaces code.* findings--force re-index resets domain pack state — re-run docgraph pack enable code_doc <path> after a force rebuildCommon rules:
.gitignore and .docgraphignorenode_modules, .git, target, dist, build, vendor, .next, .cache, __pycache__, .codegraph, .docgraph, .obsidian, and .claude/worktrees (agent git worktrees — full repo copies that would index as duplicates). These are pruned unconditionally — --no-gitignore lifts .gitignore rules but does not re-include them. (For Obsidian vaults this means the .obsidian/ app-config dir is skipped while your notes are still fully indexed.)Domain packs extend the metadata schema for specific use cases. Three packs are enabled by default; three are opt-in.
Each pack reads specific keys from your Markdown frontmatter.
governance — lifecycle and access control:
status: active # Governance lifecycle status
owner: alice # Accountable person or role
sensitivity: internal # Sets retrieval boundaries
allowed_audience: [engineering, legal]
review_due: 2026-12-31 # Triggers policy.stale_review when overdue
effective_date: 2026-01-01
canonical_source: true # Marks as the authoritative copy among duplicates
approver: bob
department: Engineering
supersedes: old-policy.md
superseded_by: new-policy.md
research_provenance — evidence and provenance tracking:
claim_id: CLM-001
source_type: primary # primary | secondary | internal
confidence: high
analyst_status: verified
assessment_date: 2026-05-01
event_date: 2026-04-15
last_verified: 2026-05-20
valid_until: 2026-11-01 # Triggers research.stale_assessment when expired
evidence: [doc/evidence-a.md, doc/evidence-b.md]
client: ACME
deliverable_id: RPT-42
entity — canonical entity declaration:
entity_type: organization # person | organization | location | …
canonical_name: Acme Corp
aliases: [ACME, Acme Corporation]
policy_process (opt-in) — SOP and policy enrichment:
sop_category: onboarding
policy_domain: HR # HR | Security | Finance | …
process_owner: People Ops
version: "2.1"
conflict_resolution: supersedes-v2.0
assessment_drift (opt-in) — competing research tracking:
contradicts: assessment-2026-03.md
supersedes_claim: CLM-099
docgraph_context format=drift_audit surfaces advisory findings from enabled packs.
No code knowledge is needed — governance and research packs work on any document collection (.md, .docx, .html, .pdf).
docgraph pack list /path/to/project # Show all packs and enabled state
docgraph pack enable policy_process /path/to/project # Enable an opt-in pack
docgraph pack enable assessment_drift /path/to/project
docgraph pack enable code_doc /path/to/project # Also triggers incremental sync
docgraph pack disable code_doc /path/to/project # Removes code_file rows
docgraph pack enable --workspace policy_process /path/to/workspace # Apply to all child projects
--force re-index resets all pack state — re-run docgraph pack enable <pack-id> <path> after a force rebuild.
Point DocGraph at a parent directory and it auto-discovers all immediate child directories as separate projects:
docgraph serve --workspace /path/to/workspace
.docgraph/docgraph.db (add .docgraph/ to .gitignore)--max-watches, default 8192; 0 = unlimited). Every watched directory/file is one descriptor on macOS, so an unbounded recursive watch of a very large tree can drive the OS file-descriptor table toward exhaustion (worse: one such process per connected client). The cap holds open descriptors to roughly the cap — plus the widest single watched directory, which fsnotify opens eagerly — instead of one per file in the whole tree. Beyond the cap, changes do not auto-reindex; run docgraph sync or restart. Override with the flag or DOCGRAPH_MAX_WATCHES.DocGraph respects .gitignore by default. For additional control, create a
.docgraphignore file (same syntax as .gitignore):
# Project-level .docgraphignore — exclude files within a project
drafts/
archive/
*.draft.md
!archive/INDEX.md # re-include a specific file
Workspace-level .docgraphignore (at the workspace root) excludes entire
projects by directory name:
# Workspace-level .docgraphignore — exclude projects
OSINT-Platform-backup-20260518
csint-private
Editing .docgraphignore while docgraph serve is running applies the change
automatically: newly-excluded files are pruned from the index on save (a guarded
reconcile — an over-broad pattern that would drop more than half the corpus is
refused with a message rather than emptying the index). With no server running, a
newly-excluded file is dropped on the next docgraph index --force <path>.
docgraph_status reports the active ignore sources (.gitignore,
.docgraphignore, --no-gitignore) and how to add an exclusion.
To index files that are gitignored (e.g., .claude/skills/, memory/
directories), use the --no-gitignore flag:
docgraph index --no-gitignore <path>
docgraph sync --no-gitignore <path>
docgraph serve --no-gitignore --workspace <dir>
This ignores .gitignore rules but still respects .docgraphignore.
DocGraph works with any MCP-compatible client via stdio transport.
For automatic setup:
docgraph init --install-clients auto /path/to/project
docgraph install --clients all --workspace /path/to/workspace
The installer writes:
Project-level (this project only) — add to .mcp.json in your project root, or run:
docgraph init --install-clients claude /path/to/project
Manual .mcp.json:
{
"mcpServers": {
"docgraph": {
"command": "docgraph",
"args": ["serve", "--path", "."]
}
}
}
User-level (global) — available across all projects. Writes to ~/.claude.json via the claude CLI:
docgraph install --clients claude --scope user --workspace /path/to/workspace
Or manually with the claude CLI:
claude mcp add --scope user docgraph -- docgraph serve --workspace /path/to/workspace
Verify the connection:
claude mcp list
Important: Claude Code stores user-scope MCP config in
~/.claude.json, not~/.claude/mcp.json. Manually editing~/.claude/mcp.jsonhas no effect — useclaude mcp add --scope useror the project-level.mcp.jsonapproach instead.
PATH note:
docgraphmust be on your PATH. Forgo installbuilds, ensure$GOPATH/binis in your PATH (rungo env GOPATHto find the location). If not, use the absolute path to the binary.
Add to your MCP configuration:
[mcp_servers.docgraph]
command = "docgraph"
args = ["serve", "--workspace", "/path/to/workspace"]
Add to ~/.hermes/config.yaml:
mcp_servers:
docgraph:
command: docgraph
args:
- serve
- --workspace
- /path/to/workspace
Add to your opencode MCP configuration:
{
"mcpServers": {
"docgraph": {
"command": "docgraph",
"args": ["serve", "--workspace", "/path/to/workspace"]
}
}
}
DocGraph uses stdio transport. Launch with:
docgraph serve --workspace /path/to/workspace
# or single project:
docgraph serve --path /path/to/project
The server reads JSON-RPC from stdin and writes to stdout.
scan .md / .docx / .html / .pdf (docformat registry: extensions + per-format size limits)
-> dispatch:
.md → goldmark + inlined YAML frontmatter parser
.docx → stdlib archive/zip + encoding/xml
.html / .htm → golang.org/x/net HTML tokenizer
.pdf → Detective-XH/gopdf (ledongthuc/pdf fork; text layer + CJK CMaps; writes to temp file)
code docs → optional code_doc pack for comments/tests/examples
-> extract nodes, edges, links, metadata tuples, and section chunks
-> store in SQLite (modernc.org/sqlite, pure Go)
-> resolve cross-document references
-> compute topic similarity (TF-IDF + graph Jaccard)
-> serve over MCP stdio (mark3labs/mcp-go)
FTS5 uses the trigram tokenizer for mixed CJK and Latin full-text search.
CI verifies module checksums with go mod verify, runs govulncheck, and
generates a CycloneDX JSON SBOM artifact named docgraph-sbom with
cyclonedx-gomod. The SBOM is generated from go.mod during GitHub Actions
runs; generated SBOM files are not checked into the repository.
DocGraph and CodeGraph are complementary. DocGraph owns documentation context, governance/research metadata, citation paths, document references, context packs, drift audits, and shallow code-documentation surfaces. CodeGraph owns source-code intelligence such as symbols, callers/callees, call traces, route handlers, and code impact.
CodeGraph interoperability currently ships as an advisory handoff layer in the
MCP server instructions. DocGraph does not call CodeGraph, read .codegraph/,
or import CodeGraph symbol anchors. The reserved codegraph_anchor metadata
field stays empty until CodeGraph exposes a stable export/API contract.
For docs-code work, enable DocGraph's code_doc pack — it is the interface
layer between DocGraph and CodeGraph. DocGraph indexes documentation surfaces
(file headers, exported doc comments, test names, example names); CodeGraph
indexes code structure (symbols, callers/callees, call graphs, type resolution).
Together they give a complete picture: format=drift_audit with code_doc
enabled can surface code.missing_symbol, code.undocumented_export, and
code.unanchored_feature findings, then hand symbol-level questions to
codegraph_* tools when the agent environment exposes them.
DocGraph is inspired by CodeGraph, which builds a knowledge graph from source code symbols using tree-sitter and SQLite. DocGraph adopts the same core design:
nodes + edges + files + unresolved_refs + FTS5 + section_chunks + section_chunks_fts + document_metadata + governance_metadata + research_metadata + domain_packs + domain_pack_fields + entities + entity_mentions — the graph model extended with section snapshots, section-level search, normalized governance metadata, research provenance, domain schema pack registration, and entity/source graph primitives. Schema is bootstrapped via idempotent CREATE TABLE/INDEX/TRIGGER IF NOT EXISTS on every open; if the shape needs to change, delete .docgraph/ and reindex.UnresolvedReference → ReferenceResolver pattern.docgraph_graph); 2 additional LLM-callout tools (docgraph_embeddings, docgraph_enrichment) register only when their --enable-* flags are set. Graph traversal, embeddings, and enrichment are facade tools that group fine-grained operations behind a single dispatch parameter, keeping agent-facing instructions compact.Where they diverge: DocGraph is written in Go (single binary, no Node.js runtime), uses the trigram tokenizer for CJK support, and adds workspace mode for multi-project fan-out queries — features that reflect documentation use cases rather than code navigation. DocGraph also adds hybrid topic similarity (TF-IDF + graph Jaccard + tags) to discover conceptual relationships that neither explicit links nor code structure can capture.
Signed by EDB0808F3F248B66F53837B4888293C4BA30EEF6 (Xavier).
docgraph-darwin-arm64.tar.gz
c4dc880d8ed6796f28718c76c99e410c110366fd6c47bd991b518b023b5c28c3
docgraph-darwin-amd64.tar.gz
31dbfa7f8d6748f7147863f1f0b9549f82ca83f0e9847bc45002520c7039a1e6
docgraph-linux-amd64.tar.gz
a8ae2cf4843b47316853ee5177c89599c9893eb6d256731db432ec4565846f71
docgraph-linux-arm64.tar.gz
a9223d01473554063b0bbb584b1e7c205271c6340db3d2826a50fdefff52c3cc
docgraph-windows-amd64.zip
b1cacd26d9d69cc7169f7a6fe73cce565868d7be6131cc1a925a16545ad1a88a
Verify:
gpg --verify SHA256SUMS.asc SHA256SUMS
shasum -a 256 -c SHA256SUMS
MIT
Govern your documents like code. MCP server that indexes .md/.docx/.html/.pdf into a SQLite knowledge graph and runs drift audits — stale policies, conflicting research claims, superseded docs, undocu
개요
Govern your documents like code. MCP server that indexes .md/.docx/.html/.pdf into a SQLite knowledge graph and runs drift audits — stale policies, conflicting research claims, superseded docs, undocumented code exports. 12 MCP tools incl. cross-reference graph, governance + provenance metadata, topic similarity. Single binary, zero runtime deps.
도구
아직 도구 목록이 없습니다. 원격 서버는 첫 상태 확인 후에 도구 목록이 생깁니다.
FAQ
이 페이지에서 Cursor, Claude Desktop, Claude Code 또는 VS Code용 stdio 설정을 복사합니다. PlugMCP 프록시가 아니라 게시자의 설치 방식을 사용합니다.
이 레코드에는 필수 환경 변수가 등록되어 있지 않습니다.
DocGraph은(는) stdio를 통해 로컬에서 실행됩니다.
마지막 확인: 2026-10-28. Govern your documents like code. MCP server that indexes .md/.docx/.html/.pdf into a SQLite knowledge graph and runs drift audits — stale policies, conflicting research claims, superseded docs, undocumented code exports. 12 MCP tools incl. cross-reference graph, governance + provenance metadata, topic similarity. Single binary, zero runtime deps.