viberag 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +213 -83
- package/dist/cli/components/CleanWizard.js +3 -1
- package/dist/cli/components/McpSetupWizard.js +6 -7
- package/dist/mcp/index.js +14 -3
- package/dist/mcp/server.d.ts +6 -2
- package/dist/mcp/server.js +191 -170
- package/dist/mcp/warmup.d.ts +87 -0
- package/dist/mcp/warmup.js +196 -0
- package/dist/rag/embeddings/local.js +1 -0
- package/dist/rag/gitignore/index.js +3 -3
- package/dist/rag/search/index.d.ts +6 -0
- package/dist/rag/search/index.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
# VIBERAG
|
|
3
|
+
# VIBERAG MCP Server
|
|
4
4
|
|
|
5
5
|
**Free, Open Source, Local / Offline Capable, Container-Free Semantic Search For Your Codebase**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
VibeRAG is fully local, offline capable MCP server for local codebase search.
|
|
8
8
|
|
|
9
9
|
- Semantic codebase search
|
|
10
10
|
- Keyword codebase search (BM25)
|
|
@@ -28,7 +28,7 @@ viberag
|
|
|
28
28
|
# Run the initialization wizard to configure embeddings, run initial indexing, and automatically configure MCP server integration.
|
|
29
29
|
/init
|
|
30
30
|
|
|
31
|
-
# In addition to allowing Agents to search via the MCP server,
|
|
31
|
+
# In addition to allowing Agents to search via the MCP server,
|
|
32
32
|
# you can search yourself via the CLI.
|
|
33
33
|
/search authentication handler
|
|
34
34
|
```
|
|
@@ -45,18 +45,18 @@ When using a coding agent like [Claude Code](https://claude.ai/code), add `use v
|
|
|
45
45
|
|
|
46
46
|
> **Tip:** include "`use viberag`" in your prompt to ensure your agent will use viberag's codebase search features. Most agents will select MCP tools as appropriate, but sometimes they need a little help with explicit prompting.
|
|
47
47
|
|
|
48
|
-
|
|
49
48
|
## Features
|
|
50
49
|
|
|
51
50
|
- **CLI based setup** - CLI commands and wizards for setup, editor integration, and configuration
|
|
52
51
|
- **Semantic code search** - Find code by meaning, not just keywords
|
|
53
52
|
- **Flexible embeddings** - Local model (offline, free) or cloud providers (Gemini, Mistral, OpenAI)
|
|
54
53
|
- **MCP server** - Works with Claude Code, Cursor, VS Code Copilot, and more
|
|
55
|
-
- **Incremental indexing** -
|
|
54
|
+
- **Automatic Incremental indexing** - Watches for file changes and reindexes only what has changed in real time
|
|
56
55
|
- **Multi-language support** - TypeScript, JavaScript, Python, Go, Rust, and more
|
|
57
56
|
|
|
58
57
|
### How It Works:
|
|
59
|
-
|
|
58
|
+
|
|
59
|
+
Your coding agent would normally use Search / Grep / Find and guess search terms that are relevant. VibeRAG indexes the codebase into a local vector database (based on [lancedb](https://lancedb.com/)) and can use semantic search to find all relevant code snippets even if the search terms are not exact.
|
|
60
60
|
|
|
61
61
|
When searching for "authentication", VibeRAG will find all code snippets that are relevant to authentication, such as "login", "logout", "register", and names of functions and classes like `AuthDependency`, `APIKeyCache`, etc.
|
|
62
62
|
|
|
@@ -67,16 +67,16 @@ This ensures a more exhaustive search of your codebase so you don't miss importa
|
|
|
67
67
|
Semantic search is especially useful in monorepos, where you may be trying to understand how different parts of the codebase interact with each other. Viberag can find all the pieces with fewer searches, fewer tokens used, and a shorter amount of time spent searching.
|
|
68
68
|
|
|
69
69
|
### Embedding Models
|
|
70
|
-
- You can use a locally run embedding model ([Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B)) so that nothing leaves your machine.
|
|
71
70
|
|
|
72
|
-
-
|
|
71
|
+
- You can use a locally run embedding model ([Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B)) so that nothing leaves your machine.
|
|
73
72
|
|
|
73
|
+
- SOTA API based embeddings from [Gemini](https://ai.google.dev/gemini-api/docs/embeddings), [OpenAI](https://platform.openai.com/docs/guides/embeddings), and [Mistral](https://docs.mistral.ai/capabilities/embeddings) are also supported.
|
|
74
74
|
|
|
75
|
-
## MCP Server
|
|
75
|
+
## MCP Server
|
|
76
76
|
|
|
77
77
|
VibeRAG includes an MCP server that integrates with AI coding tools.
|
|
78
78
|
|
|
79
|
-
### Setup Wizard
|
|
79
|
+
### IDE / Agent Setup Wizard
|
|
80
80
|
|
|
81
81
|
Run `/mcp-setup` in the VibeRAG CLI for interactive setup. This wizard will attempt to automatically configure your coding agents / editors with viberags MCP server settings.
|
|
82
82
|
|
|
@@ -125,19 +125,21 @@ These editors use per-project config files that VibeRAG can auto-create.
|
|
|
125
125
|
<summary><strong>Claude Code</strong> — <code>.mcp.json</code></summary>
|
|
126
126
|
|
|
127
127
|
**CLI Command:**
|
|
128
|
+
|
|
128
129
|
```bash
|
|
129
130
|
claude mcp add viberag -- npx viberag-mcp
|
|
130
131
|
```
|
|
131
132
|
|
|
132
133
|
**Manual Setup:**
|
|
134
|
+
|
|
133
135
|
```json
|
|
134
136
|
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
"mcpServers": {
|
|
138
|
+
"viberag": {
|
|
139
|
+
"command": "npx",
|
|
140
|
+
"args": ["viberag-mcp"]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
141
143
|
}
|
|
142
144
|
```
|
|
143
145
|
|
|
@@ -151,14 +153,15 @@ claude mcp add viberag -- npx viberag-mcp
|
|
|
151
153
|
<summary><strong>Cursor</strong> — <code>.cursor/mcp.json</code></summary>
|
|
152
154
|
|
|
153
155
|
**Manual Setup:**
|
|
156
|
+
|
|
154
157
|
```json
|
|
155
158
|
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
"mcpServers": {
|
|
160
|
+
"viberag": {
|
|
161
|
+
"command": "npx",
|
|
162
|
+
"args": ["viberag-mcp"]
|
|
163
|
+
}
|
|
164
|
+
}
|
|
162
165
|
}
|
|
163
166
|
```
|
|
164
167
|
|
|
@@ -172,14 +175,15 @@ claude mcp add viberag -- npx viberag-mcp
|
|
|
172
175
|
<summary><strong>Roo Code</strong> — <code>.roo/mcp.json</code></summary>
|
|
173
176
|
|
|
174
177
|
**Manual Setup:**
|
|
178
|
+
|
|
175
179
|
```json
|
|
176
180
|
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
"mcpServers": {
|
|
182
|
+
"viberag": {
|
|
183
|
+
"command": "npx",
|
|
184
|
+
"args": ["viberag-mcp"]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
183
187
|
}
|
|
184
188
|
```
|
|
185
189
|
|
|
@@ -193,14 +197,15 @@ claude mcp add viberag -- npx viberag-mcp
|
|
|
193
197
|
<summary><strong>VS Code Copilot</strong> — <code>.vscode/mcp.json</code></summary>
|
|
194
198
|
|
|
195
199
|
**Manual Setup:**
|
|
200
|
+
|
|
196
201
|
```json
|
|
197
202
|
{
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
"servers": {
|
|
204
|
+
"viberag": {
|
|
205
|
+
"command": "npx",
|
|
206
|
+
"args": ["viberag-mcp"]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
204
209
|
}
|
|
205
210
|
```
|
|
206
211
|
|
|
@@ -222,19 +227,21 @@ These editors use global config files. VibeRAG can merge into existing configs.
|
|
|
222
227
|
<summary><strong>Gemini CLI</strong> — <code>~/.gemini/settings.json</code></summary>
|
|
223
228
|
|
|
224
229
|
**CLI Command:**
|
|
230
|
+
|
|
225
231
|
```bash
|
|
226
232
|
gemini mcp add viberag -- npx viberag-mcp
|
|
227
233
|
```
|
|
228
234
|
|
|
229
235
|
**Manual Setup:** Add to your existing settings.json:
|
|
236
|
+
|
|
230
237
|
```json
|
|
231
238
|
{
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
239
|
+
"mcpServers": {
|
|
240
|
+
"viberag": {
|
|
241
|
+
"command": "npx",
|
|
242
|
+
"args": ["viberag-mcp"]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
238
245
|
}
|
|
239
246
|
```
|
|
240
247
|
|
|
@@ -248,11 +255,13 @@ gemini mcp add viberag -- npx viberag-mcp
|
|
|
248
255
|
<summary><strong>OpenAI Codex</strong> — <code>~/.codex/config.toml</code></summary>
|
|
249
256
|
|
|
250
257
|
**CLI Command:**
|
|
258
|
+
|
|
251
259
|
```bash
|
|
252
260
|
codex mcp add viberag -- npx viberag-mcp
|
|
253
261
|
```
|
|
254
262
|
|
|
255
263
|
**Manual Setup:** Add to your config.toml:
|
|
264
|
+
|
|
256
265
|
```toml
|
|
257
266
|
[mcp_servers.viberag]
|
|
258
267
|
command = "npx"
|
|
@@ -271,14 +280,15 @@ args = ["viberag-mcp"]
|
|
|
271
280
|
**Config:** `~/.config/opencode/opencode.json` (Linux/macOS) or `%APPDATA%/opencode/opencode.json` (Windows)
|
|
272
281
|
|
|
273
282
|
**Manual Setup:** Add to your existing opencode.json:
|
|
283
|
+
|
|
274
284
|
```json
|
|
275
285
|
{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
"mcp": {
|
|
287
|
+
"viberag": {
|
|
288
|
+
"type": "local",
|
|
289
|
+
"command": ["npx", "-y", "viberag-mcp"]
|
|
290
|
+
}
|
|
291
|
+
}
|
|
282
292
|
}
|
|
283
293
|
```
|
|
284
294
|
|
|
@@ -294,14 +304,15 @@ args = ["viberag-mcp"]
|
|
|
294
304
|
<summary><strong>Windsurf</strong> — <code>~/.codeium/windsurf/mcp_config.json</code></summary>
|
|
295
305
|
|
|
296
306
|
**Manual Setup:** Merge into your existing mcp_config.json:
|
|
307
|
+
|
|
297
308
|
```json
|
|
298
309
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
310
|
+
"mcpServers": {
|
|
311
|
+
"viberag": {
|
|
312
|
+
"command": "npx",
|
|
313
|
+
"args": ["viberag-mcp"]
|
|
314
|
+
}
|
|
315
|
+
}
|
|
305
316
|
}
|
|
306
317
|
```
|
|
307
318
|
|
|
@@ -317,14 +328,15 @@ args = ["viberag-mcp"]
|
|
|
317
328
|
**Config:** `~/Library/Application Support/Zed/settings.json` (macOS) or `~/.config/zed/settings.json` (Linux)
|
|
318
329
|
|
|
319
330
|
**Manual Setup:** Merge into your existing settings.json:
|
|
331
|
+
|
|
320
332
|
```json
|
|
321
333
|
{
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
334
|
+
"context_servers": {
|
|
335
|
+
"viberag": {
|
|
336
|
+
"command": "npx",
|
|
337
|
+
"args": ["viberag-mcp"]
|
|
338
|
+
}
|
|
339
|
+
}
|
|
328
340
|
}
|
|
329
341
|
```
|
|
330
342
|
|
|
@@ -344,6 +356,7 @@ args = ["viberag-mcp"]
|
|
|
344
356
|
<summary><strong>JetBrains IDEs</strong> — Settings UI</summary>
|
|
345
357
|
|
|
346
358
|
**Manual Setup:**
|
|
359
|
+
|
|
347
360
|
1. Open Settings → Tools → AI Assistant → MCP
|
|
348
361
|
2. Click "Add Server"
|
|
349
362
|
3. Set name: `viberag`
|
|
@@ -356,8 +369,114 @@ args = ["viberag-mcp"]
|
|
|
356
369
|
|
|
357
370
|
</details>
|
|
358
371
|
|
|
372
|
+
|
|
373
|
+
### Exposed MCP Tools
|
|
374
|
+
|
|
375
|
+
| Tool | Description |
|
|
376
|
+
| -------------------------- | ---------------------------------------------------- |
|
|
377
|
+
| `codebase_search` | Semantic, keyword, or hybrid search for code |
|
|
378
|
+
| `codebase_parallel_search` | Run multiple search strategies in parallel |
|
|
379
|
+
| `viberag_index` | Index the codebase (incremental by default) |
|
|
380
|
+
| `viberag_status` | Get index status, file count, and embedding provider |
|
|
381
|
+
| `viberag_watch_status` | Get file watcher status for auto-indexing |
|
|
382
|
+
|
|
383
|
+
#### `codebase_search`
|
|
384
|
+
|
|
385
|
+
The primary search tool. Finds code by meaning, not just keywords.
|
|
386
|
+
|
|
387
|
+
**Search Modes:**
|
|
388
|
+
|
|
389
|
+
| Mode | Best For |
|
|
390
|
+
| ------------ | -------------------------------------------- |
|
|
391
|
+
| `hybrid` | Most queries (default) - combines both |
|
|
392
|
+
| `semantic` | Conceptual queries ("how does auth work?") |
|
|
393
|
+
| `exact` | Symbol names, specific strings |
|
|
394
|
+
| `definition` | Direct symbol lookup ("where is X defined?") |
|
|
395
|
+
| `similar` | Find code similar to a snippet |
|
|
396
|
+
|
|
397
|
+
**Key Parameters:**
|
|
398
|
+
|
|
399
|
+
- `query` - Natural language search query
|
|
400
|
+
- `mode` - Search mode (default: `hybrid`)
|
|
401
|
+
- `limit` - Max results (default: 10, max: 100)
|
|
402
|
+
- `bm25_weight` - Balance keyword vs semantic (0-1, default: 0.3)
|
|
403
|
+
- `filters` - Path, type, and metadata filters
|
|
404
|
+
|
|
405
|
+
**Example:**
|
|
406
|
+
|
|
407
|
+
```json
|
|
408
|
+
{
|
|
409
|
+
"query": "authentication middleware",
|
|
410
|
+
"mode": "hybrid",
|
|
411
|
+
"limit": 15,
|
|
412
|
+
"filters": {
|
|
413
|
+
"path_not_contains": ["test", "mock"],
|
|
414
|
+
"is_exported": true
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
#### `codebase_parallel_search`
|
|
420
|
+
|
|
421
|
+
Run multiple search strategies simultaneously and merge results. Best for comprehensive exploration.
|
|
422
|
+
|
|
423
|
+
**Use Cases:**
|
|
424
|
+
|
|
425
|
+
- Compare semantic vs keyword results
|
|
426
|
+
- Search related concepts together
|
|
427
|
+
- Test different weight settings
|
|
428
|
+
|
|
429
|
+
**Example:**
|
|
430
|
+
|
|
431
|
+
```json
|
|
432
|
+
{
|
|
433
|
+
"searches": [
|
|
434
|
+
{"query": "authentication", "mode": "semantic", "limit": 10},
|
|
435
|
+
{"query": "auth login JWT", "mode": "exact", "limit": 10},
|
|
436
|
+
{"query": "user session", "mode": "hybrid", "bm25_weight": 0.5, "limit": 10}
|
|
437
|
+
],
|
|
438
|
+
"merge_results": true,
|
|
439
|
+
"merge_strategy": "rrf",
|
|
440
|
+
"merged_limit": 20
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
#### `viberag_index`
|
|
445
|
+
|
|
446
|
+
Manually trigger indexing. Normally not needed as file watching handles updates automatically.
|
|
447
|
+
|
|
448
|
+
**Parameters:**
|
|
449
|
+
|
|
450
|
+
- `force` - Full reindex ignoring cache (default: `false`)
|
|
451
|
+
|
|
452
|
+
#### `viberag_status`
|
|
453
|
+
|
|
454
|
+
Check index health and configuration.
|
|
455
|
+
|
|
456
|
+
**Returns:**
|
|
457
|
+
|
|
458
|
+
- File count, chunk count
|
|
459
|
+
- Embedding provider and dimensions
|
|
460
|
+
- Schema version
|
|
461
|
+
- Last update timestamp
|
|
462
|
+
- Warmup status (ready, initializing, etc.)
|
|
463
|
+
|
|
464
|
+
#### `viberag_watch_status`
|
|
465
|
+
|
|
466
|
+
Check the file watcher for auto-indexing.
|
|
467
|
+
|
|
468
|
+
**Returns:**
|
|
469
|
+
|
|
470
|
+
- Whether watching is active
|
|
471
|
+
- Number of files being watched
|
|
472
|
+
- Pending changes count
|
|
473
|
+
- Last update timestamp
|
|
474
|
+
|
|
475
|
+
|
|
359
476
|
## CLI Commands
|
|
360
477
|
|
|
478
|
+
VibeRAG includes a CLI for easy execution of initialization, indexing, setup, and other things you may want to manually control outside of agent use.
|
|
479
|
+
|
|
361
480
|
| Command | Description |
|
|
362
481
|
| ----------------- | --------------------------------------------------------- |
|
|
363
482
|
| `/init` | Initialize VibeRAG (configure embeddings, index codebase) |
|
|
@@ -375,20 +494,21 @@ Choose your embedding provider during `/init`:
|
|
|
375
494
|
|
|
376
495
|
### Local Model - Offline, Free
|
|
377
496
|
|
|
378
|
-
| Model | Quant | Download | RAM
|
|
379
|
-
| ---------- | ----- | -------- |
|
|
497
|
+
| Model | Quant | Download | RAM |
|
|
498
|
+
| ---------- | ----- | -------- | ------ |
|
|
380
499
|
| Qwen3-0.6B | Q8 | ~700MB | ~1.5GB |
|
|
381
500
|
|
|
382
501
|
- Works completely offline, no API key required
|
|
383
502
|
- Initial indexing may take time; future updates are incremental
|
|
503
|
+
- Works great for code and natural language (docs, docstrings, code comments, etc.)
|
|
384
504
|
|
|
385
505
|
### Cloud Providers - Fastest, Best Quality
|
|
386
506
|
|
|
387
|
-
| Provider | Model | Dims | Cost | Get API Key
|
|
388
|
-
| -------- | ---------------------- | ---- | --------- |
|
|
389
|
-
| Gemini | gemini-embedding-001 | 1536 | Free tier | [Google AI Studio](https://aistudio.google.com)
|
|
390
|
-
| Mistral | codestral-embed | 1024 | $0.10/1M | [Mistral Console](https://console.mistral.ai/api-keys/)
|
|
391
|
-
| OpenAI | text-embedding-3-small | 1536 | $0.02/1M | [OpenAI Platform](https://platform.openai.com/api-keys)
|
|
507
|
+
| Provider | Model | Dims | Cost | Get API Key |
|
|
508
|
+
| -------- | ---------------------- | ---- | --------- | ------------------------------------------------------- |
|
|
509
|
+
| Gemini | gemini-embedding-001 | 1536 | Free tier | [Google AI Studio](https://aistudio.google.com) |
|
|
510
|
+
| Mistral | codestral-embed | 1024 | $0.10/1M | [Mistral Console](https://console.mistral.ai/api-keys/) |
|
|
511
|
+
| OpenAI | text-embedding-3-small | 1536 | $0.02/1M | [OpenAI Platform](https://platform.openai.com/api-keys) |
|
|
392
512
|
|
|
393
513
|
- **Gemini** - Free tier available, great for getting started
|
|
394
514
|
- **Mistral** - Code-optimized embeddings for technical content
|
|
@@ -412,14 +532,15 @@ VibeRAG works best when AI agents use **sub-agents for exploration tasks**. This
|
|
|
412
532
|
|
|
413
533
|
When an AI calls viberag directly, all search results expand the main context. Sub-agents run searches in isolated context windows and return only concise summaries.
|
|
414
534
|
|
|
415
|
-
| Approach
|
|
416
|
-
|
|
417
|
-
| Direct viberag calls | 24k tokens
|
|
418
|
-
| Sub-agent delegation | 3k tokens
|
|
535
|
+
| Approach | Context Usage | Token Efficiency |
|
|
536
|
+
| -------------------- | ------------- | ---------------- |
|
|
537
|
+
| Direct viberag calls | 24k tokens | Baseline |
|
|
538
|
+
| Sub-agent delegation | 3k tokens | **8x better** |
|
|
419
539
|
|
|
420
540
|
### Platform-Specific Guidance
|
|
421
541
|
|
|
422
542
|
#### Claude Code
|
|
543
|
+
|
|
423
544
|
```
|
|
424
545
|
# For exploration tasks, use the Task tool:
|
|
425
546
|
Task(subagent_type='Explore', prompt='Use viberag to find how authentication works')
|
|
@@ -430,60 +551,69 @@ Task(subagent_type='Explore', prompt='Search login flows') # with this one
|
|
|
430
551
|
```
|
|
431
552
|
|
|
432
553
|
Add to your `CLAUDE.md`:
|
|
554
|
+
|
|
433
555
|
```markdown
|
|
434
556
|
When exploring the codebase, use Task(subagent_type='Explore') and instruct it
|
|
435
557
|
to use codebase_search or codebase_parallel_search. This keeps the main context clean.
|
|
436
558
|
```
|
|
437
559
|
|
|
438
560
|
#### VS Code Copilot
|
|
561
|
+
|
|
439
562
|
- Use **Agent HQ** to delegate exploration to background agents
|
|
440
563
|
- Background agents can iterate with viberag without blocking your session
|
|
441
564
|
- Use `/delegate` to hand off exploration tasks to Copilot coding agent
|
|
442
565
|
|
|
443
566
|
#### Cursor
|
|
567
|
+
|
|
444
568
|
- Enable **Agent mode** for multi-step exploration
|
|
445
569
|
- Agent mode can orchestrate multiple viberag searches autonomously
|
|
446
570
|
- Consider the [Sub-Agents MCP server](https://playbooks.com/mcp/shinpr-sub-agents) for Claude Code-style delegation
|
|
447
571
|
|
|
448
572
|
#### Windsurf
|
|
573
|
+
|
|
449
574
|
- **Cascade** automatically plans multi-step tasks
|
|
450
575
|
- Enable **Turbo Mode** for autonomous exploration
|
|
451
576
|
- Cascade's planning agent will orchestrate viberag calls efficiently
|
|
452
577
|
|
|
453
578
|
#### Roo Code
|
|
579
|
+
|
|
454
580
|
- Use **Architect mode** for exploration and understanding
|
|
455
581
|
- **Boomerang tasks** coordinate complex multi-mode workflows
|
|
456
582
|
- Each mode (Architect, Code, Debug) can use viberag with focused context
|
|
457
583
|
|
|
458
584
|
#### Gemini CLI
|
|
585
|
+
|
|
459
586
|
- Create **extensions** that scope viberag tools for specific tasks
|
|
460
587
|
- Extensions can bundle viberag with custom prompts for specialized exploration
|
|
461
588
|
- Use `gemini mcp add viberag` then reference in extension configs
|
|
462
589
|
|
|
463
590
|
#### OpenAI Codex
|
|
591
|
+
|
|
464
592
|
- Use **Agents SDK** to orchestrate viberag as an MCP tool
|
|
465
593
|
- Codex can run as an MCP server itself for multi-agent setups
|
|
466
594
|
- Approval modes control how autonomously Codex explores
|
|
467
595
|
|
|
468
596
|
#### JetBrains IDEs
|
|
597
|
+
|
|
469
598
|
- **Junie** agent handles multi-step exploration autonomously
|
|
470
599
|
- **Claude Agent** integration provides sub-agent-like capabilities
|
|
471
600
|
- Access viberag through AI Chat with multi-agent support
|
|
472
601
|
|
|
473
602
|
#### Zed
|
|
603
|
+
|
|
474
604
|
- Use **External Agents** (Claude Code, Codex, Gemini CLI) for exploration
|
|
475
605
|
- Set `auto_approve` in settings for autonomous agent operation
|
|
476
606
|
- ACP (Agent Client Protocol) enables BYO agent integration
|
|
477
607
|
|
|
478
608
|
### Quick Lookup vs Exploration
|
|
479
609
|
|
|
480
|
-
| Task Type
|
|
481
|
-
|
|
482
|
-
| "Where is function X defined?"
|
|
483
|
-
| "What file handles Y?"
|
|
484
|
-
| "How does authentication work?" | **Sub-agent** - needs multiple searches
|
|
485
|
-
| "Find all API endpoints"
|
|
486
|
-
| "Understand the data flow"
|
|
610
|
+
| Task Type | Recommended Approach |
|
|
611
|
+
| ------------------------------- | ----------------------------------------------- |
|
|
612
|
+
| "Where is function X defined?" | Direct `codebase_search` with mode='definition' |
|
|
613
|
+
| "What file handles Y?" | Direct `codebase_search` - single query |
|
|
614
|
+
| "How does authentication work?" | **Sub-agent** - needs multiple searches |
|
|
615
|
+
| "Find all API endpoints" | **Sub-agent** or `codebase_parallel_search` |
|
|
616
|
+
| "Understand the data flow" | **Sub-agent** - iterative exploration |
|
|
487
617
|
|
|
488
618
|
### For Platforms Without Sub-Agents
|
|
489
619
|
|
|
@@ -491,13 +621,13 @@ Use `codebase_parallel_search` to run multiple search strategies in a single cal
|
|
|
491
621
|
|
|
492
622
|
```json
|
|
493
623
|
{
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
624
|
+
"searches": [
|
|
625
|
+
{"query": "authentication", "mode": "semantic"},
|
|
626
|
+
{"query": "auth login", "mode": "exact"},
|
|
627
|
+
{"query": "user session", "mode": "hybrid", "bm25_weight": 0.5}
|
|
628
|
+
],
|
|
629
|
+
"merge_results": true,
|
|
630
|
+
"merge_strategy": "rrf"
|
|
501
631
|
}
|
|
502
632
|
```
|
|
503
633
|
|
|
@@ -51,7 +51,9 @@ export function CleanWizard({ projectRoot, viberagDir, onComplete, onCancel, add
|
|
|
51
51
|
setStep('processing');
|
|
52
52
|
performCleanup(false);
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
},
|
|
55
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- performCleanup is stable
|
|
56
|
+
[projectScopeEditors, onCancel]);
|
|
55
57
|
// Perform the actual cleanup
|
|
56
58
|
const performCleanup = useCallback(async (cleanMcp) => {
|
|
57
59
|
const fs = await import('node:fs/promises');
|
|
@@ -50,7 +50,7 @@ function MultiSelect({ items, selected, onToggle, onSubmit, highlightIndex, onHi
|
|
|
50
50
|
onToggle(item.id);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
else if (key.return) {
|
|
53
|
+
else if (key.return && selected.size > 0) {
|
|
54
54
|
onSubmit();
|
|
55
55
|
}
|
|
56
56
|
});
|
|
@@ -122,13 +122,9 @@ export function McpSetupWizard({ step, config, projectRoot, showPrompt, onStepCh
|
|
|
122
122
|
}, []);
|
|
123
123
|
// Submit selection
|
|
124
124
|
const handleSubmitSelection = useCallback(() => {
|
|
125
|
-
if (selected.size === 0) {
|
|
126
|
-
onCancel();
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
125
|
onStepChange('configure', { selectedEditors: Array.from(selected) });
|
|
130
126
|
setCurrentEditorIndex(0);
|
|
131
|
-
}, [selected, onStepChange
|
|
127
|
+
}, [selected, onStepChange]);
|
|
132
128
|
// Get current editor being configured
|
|
133
129
|
const selectedEditorIds = config.selectedEditors ?? [];
|
|
134
130
|
const currentEditorId = selectedEditorIds[currentEditorIndex];
|
|
@@ -244,7 +240,10 @@ export function McpSetupWizard({ step, config, projectRoot, showPrompt, onStepCh
|
|
|
244
240
|
React.createElement(Box, { marginTop: 1 },
|
|
245
241
|
React.createElement(Text, { dimColor: true },
|
|
246
242
|
selected.size,
|
|
247
|
-
" selected | \u2191/\u2193 move, Space toggle,
|
|
243
|
+
" selected | \u2191/\u2193 move, Space toggle,",
|
|
244
|
+
' ',
|
|
245
|
+
selected.size > 0 ? 'Enter confirm, ' : '',
|
|
246
|
+
"Esc cancel"))));
|
|
248
247
|
}
|
|
249
248
|
// Step: Configure each editor
|
|
250
249
|
if (step === 'configure' && currentEditor) {
|
package/dist/mcp/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { createMcpServer } from './server.js';
|
|
|
13
13
|
import { configExists, Indexer } from '../rag/index.js';
|
|
14
14
|
// Use current working directory as project root (same behavior as CLI)
|
|
15
15
|
const projectRoot = process.cwd();
|
|
16
|
-
const { server, startWatcher, stopWatcher } = createMcpServer(projectRoot);
|
|
16
|
+
const { server, startWatcher, stopWatcher, startWarmup } = createMcpServer(projectRoot);
|
|
17
17
|
// Handle shutdown signals
|
|
18
18
|
async function shutdown(signal) {
|
|
19
19
|
console.error(`[viberag-mcp] Received ${signal}, shutting down...`);
|
|
@@ -26,11 +26,22 @@ process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
|
26
26
|
server.start({
|
|
27
27
|
transportType: 'stdio',
|
|
28
28
|
});
|
|
29
|
-
// Start watcher and sync index after server is running
|
|
29
|
+
// Start warmup, watcher, and sync index after server is running
|
|
30
30
|
// Use setImmediate to ensure server.start() completes first
|
|
31
31
|
setImmediate(async () => {
|
|
32
|
+
// Start warmup FIRST (most important for tool responsiveness)
|
|
33
|
+
// This runs in background - tools will wait for it to complete
|
|
34
|
+
try {
|
|
35
|
+
if (await configExists(projectRoot)) {
|
|
36
|
+
startWarmup();
|
|
37
|
+
console.error('[viberag-mcp] Warmup started');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.error('[viberag-mcp] Failed to start warmup:', error instanceof Error ? error.message : error);
|
|
42
|
+
}
|
|
43
|
+
// Start watcher (will queue any changes during sync)
|
|
32
44
|
try {
|
|
33
|
-
// Start watcher first (will queue any changes during sync)
|
|
34
45
|
await startWatcher();
|
|
35
46
|
}
|
|
36
47
|
catch (error) {
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -8,18 +8,22 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { FastMCP } from 'fastmcp';
|
|
10
10
|
import { FileWatcher } from './watcher.js';
|
|
11
|
+
import { WarmupManager } from './warmup.js';
|
|
11
12
|
/**
|
|
12
|
-
* MCP server with file watcher.
|
|
13
|
+
* MCP server with file watcher and warmup manager.
|
|
13
14
|
*/
|
|
14
15
|
export interface McpServerWithWatcher {
|
|
15
16
|
server: FastMCP;
|
|
16
17
|
watcher: FileWatcher;
|
|
18
|
+
warmupManager: WarmupManager;
|
|
17
19
|
/** Start the watcher (call after server.start) */
|
|
18
20
|
startWatcher: () => Promise<void>;
|
|
19
21
|
/** Stop the watcher (call before exit) */
|
|
20
22
|
stopWatcher: () => Promise<void>;
|
|
23
|
+
/** Start warmup (call after server.start) */
|
|
24
|
+
startWarmup: () => void;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
|
-
* Create and configure the MCP server with file watcher.
|
|
27
|
+
* Create and configure the MCP server with file watcher and warmup manager.
|
|
24
28
|
*/
|
|
25
29
|
export declare function createMcpServer(projectRoot: string): McpServerWithWatcher;
|