CLI Reference
The document-rag-mcp CLI exposes subcommands to run the RAG server, test searches, and trigger manual index scanning.
Global Options
--config,-c: Path to the YAML configuration file. Can also be set via theDOCRAG_CONFIGenvironment variable.--chunking-model: Override the local model name for semantic boundary splits. Can also be set via theDOCRAG_CHUNKING_MODELenvironment variable.--debug: Enable debug logging and request timings/timings trace.--help: Show the help message and exit.
Subcommands
serve
Starts the Model Context Protocol (MCP) server.
--transport: Choosestdio(default) orhttp(SSE).--host: Bind host for SSE transport (default127.0.0.1).--port: Bind port for SSE transport (default8000).
Example:
document-rag-mcp serve --transport stdio
ingest
Trigger a one-shot synchronous recursive scan and index of files in all collections (or a specific collection). This command prunes entries for deleted files.
--collection,-c: Limit the scan to a specific collection by name.
Example:
document-rag-mcp ingest --collection "project-docs"
search
Executes a hybrid search (semantic vector + BM25 keyword search merged via Reciprocal Rank Fusion) against the indexed collections and prints formatted results to the terminal.
QUERY(Argument, Required): The search query text.--collection,-c: Filter search results to a specific collection by name.--top-k,-k: The number of matches to display (default 5).
Example:
document-rag-mcp search "how to configure the pipeline" -k 3
collections
Lists all collections specified in the configuration file, showing their configured directories, search file glob patterns, and the total count of indexed chunks.
Example:
document-rag-mcp collections