RAG Kit - Model Context Protocol (MCP) Server

March 13, 2026 · View on GitHub

The Model Context Protocol (MCP) implementation in RAG Kit enables AI models to interact with vector databases for Retrieval-Augmented Generation (RAG) through a standardized interface.

Prerequisites

  • Go 1.23.2 or higher
  • Qdrant vector database
  • OpenAI API access

Installation

Installing via Go

  1. Install the server:
go install github.com/nguyenvanduocit/rag-kit@latest
  1. Create a .env file with your configuration:
# Required for Qdrant
QDRANT_HOST=     # Required: Qdrant server host
QDRANT_PORT=     # Required: Qdrant server port
QDRANT_API_KEY=  # Required: Qdrant API key

# Required for OpenAI
OPENAI_API_KEY=  # Required: OpenAI API key

# Optional configurations
ENABLE_TOOLS=    # Optional: Comma-separated list of tool groups to enable (empty = all enabled)
PROXY_URL=       # Optional: HTTP/HTTPS proxy URL if needed
  1. Configure your Claude's config:
{
  "mcpServers": {
    "rag_kit": {
      "command": "rag-kit",
      "args": ["-env", "/path/to/.env"]
    }
  }
}

Enable Tools

The ENABLE_TOOLS environment variable is a comma-separated list of tool groups to enable. Available groups are:

  • rag - RAG (Retrieval-Augmented Generation) tools

Leave it empty to enable all tools.

Available Tools

Group: rag

RAG_memory_index_content

Index a content into memory, can be inserted or updated

RAG_memory_index_file

Index a local file into memory

RAG_memory_create_collection

Create a new vector collection in memory

RAG_memory_delete_collection

Delete a vector collection in memory

RAG_memory_list_collections

List all vector collections in memory

Search for memory in a collection based on a query

RAG_memory_delete_index_by_filepath

Delete a vector index by filePath

CLI Usage

In addition to the MCP server, rag-kit ships a standalone CLI binary (rag-cli) for direct terminal use — no MCP client needed.

Installation

just install-cli
# or
go install github.com/nguyenvanduocit/rag-kit/cmd/rag-cli@latest

Quick Start

export OPENAI_API_KEY=your-openai-key
export QDRANT_HOST=localhost
export QDRANT_PORT=6334
# or
rag-cli --env .env <command> [flags]

Commands

CommandDescription
create-collectionCreate a Qdrant vector collection
delete-collectionDelete a collection
list-collectionsList all collections
index-contentIndex content into a collection
delete-indexDelete indexed content
searchSemantic search in a collection

Examples

# Create a collection
rag-cli create-collection --name my-docs --size 1536

# Index content
rag-cli index-content --collection my-docs --content "Hello world" --source "doc-1"

# Search
rag-cli search --collection my-docs --query "greeting" --limit 5

# JSON output
rag-cli search --collection my-docs --query "hello" --output json | jq '.[].content'

Flags

Every command accepts:

  • --env string — Path to .env file
  • --output string — Output format: text (default) or json