Skip to content

MCP tools

rag-hub-mcp exposes 9 tools over the Model Context Protocol. Any MCP-compatible agent (opencode, Claude Code, Cline…) can call them.

ToolDescription
rag_list_kbsList knowledge bases with stats
rag_list_documentsList documents in a KB
rag_searchSearch KBs (kb optional — omitting searches all)
rag_add_documentAdd a text document (creates folder if needed)
rag_readRetrieve the full extracted content of a document (KB + path)
rag_delete_documentDelete a document
rag_delete_kbDelete an entire KB
rag_reindexTrigger an immediate scan
rag_statusIndex overview (KBs, documents, chunks)

Example calls

json
{
  "name": "rag_list_kbs",
  "arguments": {}
}
// → 3 KBs, 42 documents, 128 chunks
json
{
  "name": "rag_search",
  "arguments": { "query": "how to set up SSO", "kb": "infra", "top_k": 10 }
}
// → ranked chunks with source citations
json
{
  "name": "rag_add_document",
  "arguments": { "kb": "dev", "path": "notes/setup.md", "content": "# Setup\n…" }
}
// → added + indexed
  • query (required): natural-language search query.
  • kb (optional): restrict to one knowledge base.
  • top_k (optional, default 10): number of results.

rag_add_document

  • kb (required): knowledge base name; the folder is created if needed.
  • path (required): relative path in the KB (e.g. notes/architecture.md).
  • content (required): text or Markdown content.

The document is extracted, chunked, embedded and indexed immediately.

Released under the MIT License.