CLI
The docgraph-mcp command-line tool turns your knowledge graph into a Unix citizen:
ingest files and folders from the terminal, run searches, and pipe structured JSON
results into scripts or other tools.
Installing
Download the docgraph-mcp binary from your Document Analyser account settings and
place it somewhere on your $PATH. Verify it is available:
docgraph-mcp --help
The persistent --db flag sets the SQLite database path (default ~/.docgraph/knowledge.db).
You can omit it to use the default location across all commands.
Ingesting files
docgraph-mcp ingest <path> indexes a file into your knowledge graph. It chunks the
document, embeds the chunks, and extracts entities and connections:
$ docgraph-mcp ingest ~/Documents/research/acme-msa-2026.pdf
Run the command once per file (or directory member). Supported file types: Markdown, plain text, HTML, and PDF.
To index every file in a folder, pass each path in a shell loop:
for f in ~/Documents/research/*; do
docgraph-mcp ingest "$f"
done
Searching from the terminal
docgraph-mcp query "<search>" runs a keyword search over your indexed corpus and
prints ranked results as JSON:
$ docgraph-mcp query "rate limits we promised acme"
Because results are JSON, they compose naturally with jq:
docgraph-mcp query "Acme SLA" | jq '.[].content'
Inspecting the graph
Several read-only commands let you explore what has been ingested:
# List all ingested sources (id, title, type, chunk count)
docgraph-mcp sources
# List extracted entities (optionally filter by type or source)
docgraph-mcp entities --type concept
docgraph-mcp entities --source <source_id>
# Export the full knowledge graph as JSON
docgraph-mcp graph
# Export the graph in Graphviz DOT format
docgraph-mcp graph --format dot | dot -Tsvg > graph.svg
# Show database statistics (source, chunk, entity, and relation counts)
docgraph-mcp stats
Managing data
# Delete a single source and all its chunks, entities, and relations
docgraph-mcp delete-source <source_id>
# Delete ALL data (prompts for confirmation; use --force to skip)
docgraph-mcp reset --force
Using a custom database path
# Use a project-specific database instead of the default ~/.docgraph/knowledge.db
docgraph-mcp --db ./project.db ingest ./notes.md
docgraph-mcp --db ./project.db query "key decisions"
Note
The CLI and the Document Analyser web app share the same underlying knowledge graph. Documents ingested via the CLI appear in your graph view, and files uploaded through the web app are searchable from the terminal.