Skip to content

Commit 6242e99

Browse files
feat: enhances qdrant integration and setup
Adds support for Qdrant API key authentication, allowing secure access to remote Qdrant instances. Updates documentation to include instructions for setting up Qdrant with API key authentication and security recommendations. Also updates the `.gitignore` to include the `.mcp.json` and provides an example file for configuration. Simplifies the quick start instructions in the README.
1 parent 5071d32 commit 6242e99

File tree

4 files changed

+112
-9
lines changed

4 files changed

+112
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ urls.txt
3939
all_docs_urls.txt
4040
html_urls.txt
4141
markdown_urls.txt
42+
.mcp.json

.mcp.json renamed to .mcp.json.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"command": "uvx",
55
"args": ["ragify-mcp"],
66
"env": {
7-
"QDRANT_URL": "http://127.0.0.1:6333",
7+
"QDRANT_URL": "http://localhost:6333",
8+
"QDRANT_API_KEY": "",
89
"OLLAMA_URL": "http://localhost:11434"
910
}
1011
}

README.md

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ A complete RAG (Retrieval-Augmented Generation) platform for indexing and search
99

1010
## Quick Start
1111

12-
### 1. Check Prerequisites
12+
### 1. Install Dependencies
13+
14+
```bash
15+
python3 -m venv .venv
16+
source .venv/bin/activate
17+
pip install -r requirements.txt
18+
```
19+
20+
### 2. Check Prerequisites
1321

1422
```bash
1523
python3 ragify.py doctor
@@ -24,7 +32,7 @@ This verifies:
2432

2533
Use `--fix` to auto-install missing Python packages.
2634

27-
### 2. Index Your Documentation
35+
### 3. Index Your Documentation
2836

2937
```bash
3038
python3 ragify.py index ./docs # → collection "docs"
@@ -44,7 +52,7 @@ python3 ragify.py index ./math # → collection "math"
4452
python3 ragify.py index ./docs --collection custom # → explicit name
4553
```
4654

47-
### 3. Query Your Docs
55+
### 4. Query Your Docs
4856

4957
```bash
5058
python3 ragify.py query "how does authentication work?"
@@ -85,10 +93,28 @@ Local Documents
8593

8694
### Prerequisites
8795

88-
1. **Docker** - For Qdrant vector database
96+
1. **Docker + Qdrant** - Vector database
97+
```bash
98+
# Install Docker: https://docs.docker.com/engine/install/
99+
docker run -d --name qdrant --restart unless-stopped \
100+
-p 6333:6333 -v qdrant_storage:/qdrant/storage qdrant/qdrant
101+
```
89102
2. **Ollama** - For embeddings ([ollama.ai](https://ollama.ai/))
103+
```bash
104+
curl -fsSL https://ollama.ai/install.sh | sh
105+
ollama pull nomic-embed-text
106+
# Ollama runs as systemd service, starts automatically on boot
107+
sudo systemctl enable ollama && sudo systemctl start ollama
108+
```
90109
3. **Python 3.10+** - With pip
91-
4. **Java 8+** - For Apache Tika (optional but recommended)
110+
4. **Java 21** - For Apache Tika (optional but recommended)
111+
```bash
112+
# Install via sdkman (https://sdkman.io)
113+
sudo apt install zip unzip -y # Ubuntu/Debian
114+
curl -s "https://get.sdkman.io" | bash
115+
source "$HOME/.sdkman/bin/sdkman-init.sh"
116+
sdk install java 21-zulu
117+
```
92118

93119
### Setup
94120

@@ -164,10 +190,35 @@ Add to your MCP config:
164190

165191
## Environment Variables
166192

193+
| Variable | Default | Description |
194+
|----------|---------|-------------|
195+
| `QDRANT_URL` | http://localhost:6333 | Qdrant server URL |
196+
| `QDRANT_API_KEY` | - | API key for Qdrant authentication |
197+
| `OLLAMA_URL` | http://localhost:11434 | Ollama server URL |
198+
167199
```bash
168-
export OLLAMA_URL=http://localhost:11434
169-
export QDRANT_URL=http://localhost:6333
170-
export QDRANT_API_KEY=your-key # Optional, for Qdrant Cloud
200+
# Example: connect to remote Qdrant with API key
201+
export QDRANT_URL=http://your-server:6333
202+
export QDRANT_API_KEY=your-secret-key
203+
python3 ragify.py index ./docs
204+
```
205+
206+
---
207+
208+
## Running Long Indexing Jobs (SSH)
209+
210+
Use tmux to keep indexing running after disconnecting from SSH:
211+
212+
```bash
213+
# Start tmux session
214+
tmux new -s ragify
215+
216+
# Run indexing
217+
source .venv/bin/activate
218+
python3 ragify.py index ./docs
219+
220+
# Detach: Ctrl+B, then D
221+
# Reconnect later: tmux attach -t ragify
171222
```
172223

173224
---

docs/MCP_SETUP.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ Add to your MCP config:
3636
- **Claude Code**: `.mcp.json` in project root
3737
- **Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
3838

39+
> **Note**: `.mcp.json` is gitignored to protect secrets. Copy from template:
40+
> ```bash
41+
> cp .mcp.json.example .mcp.json
42+
> # Edit .mcp.json with your API keys
43+
> ```
44+
3945
#### Option A: From PyPI (recommended)
4046
```json
4147
{
@@ -133,6 +139,50 @@ npm install -g @qpd-v/mcp-server-ragdocs
133139

134140
---
135141

142+
## Remote Qdrant with API Key
143+
144+
You can run Qdrant on a remote server and query it from your local MCP client.
145+
146+
### 1. Server Setup (Ubuntu/Remote)
147+
148+
```bash
149+
# Run Qdrant with API key authentication
150+
docker run -d --name qdrant --restart unless-stopped \
151+
-p 6333:6333 \
152+
-e QDRANT__SERVICE__API_KEY=your-secret-api-key \
153+
-v qdrant_storage:/qdrant/storage qdrant/qdrant
154+
```
155+
156+
### 2. Local MCP Configuration
157+
158+
```json
159+
{
160+
"mcpServers": {
161+
"ragify": {
162+
"command": "uvx",
163+
"args": ["ragify-mcp"],
164+
"env": {
165+
"QDRANT_URL": "http://your-server-ip:6333",
166+
"QDRANT_API_KEY": "your-secret-api-key",
167+
"OLLAMA_URL": "http://localhost:11434"
168+
}
169+
}
170+
}
171+
}
172+
```
173+
174+
### 3. Security Recommendations
175+
176+
- **HTTPS**: Use a reverse proxy (nginx/Caddy) with SSL in front of Qdrant
177+
- **Firewall**: Restrict port 6333 to known IPs
178+
- **VPN/Tunnel**: Consider SSH tunnel or VPN for added security
179+
```bash
180+
# SSH tunnel example (run locally)
181+
ssh -L 6333:localhost:6333 user@your-server
182+
```
183+
184+
---
185+
136186
## Environment Variables
137187

138188
| Variable | Default | Description |

0 commit comments

Comments
 (0)