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
- Install the server:
go install github.com/nguyenvanduocit/rag-kit@latest
- Create a
.envfile 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
- 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
RAG_memory_search
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
| Command | Description |
|---|---|
create-collection | Create a Qdrant vector collection |
delete-collection | Delete a collection |
list-collections | List all collections |
index-content | Index content into a collection |
delete-index | Delete indexed content |
search | Semantic 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.envfile--output string— Output format:text(default) orjson