directory-indexer 0.0.1
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 +200 -0
- package/bin/cli.js +17 -0
- package/index.js +13 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Directory Indexer
|
|
2
|
+
|
|
3
|
+
**Turn your directories into an AI-powered knowledge base for your team.**
|
|
4
|
+
|
|
5
|
+
Directory Indexer is an MCP server that indexes local directories with semantic search. Give AI assistants the ability to find and read relevant files based on content similarity, not just filenames.
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
You have thousands of files across directories:
|
|
10
|
+
|
|
11
|
+
- Incident response docs and runbooks
|
|
12
|
+
- Code examples and architecture decisions
|
|
13
|
+
- Meeting notes and project documentation
|
|
14
|
+
- Configuration files and deployment guides
|
|
15
|
+
|
|
16
|
+
Finding relevant files requires knowing exactly what to search for:
|
|
17
|
+
|
|
18
|
+
- Filename search needs exact words from the filename
|
|
19
|
+
- Text search needs specific terms that appear in the content
|
|
20
|
+
- No way to find conceptually related files or similar solutions to problems
|
|
21
|
+
|
|
22
|
+
## Solution
|
|
23
|
+
|
|
24
|
+
[directory-indexer](https://github.com/peteretelej/directory-indexer) creates vector embeddings of your files and provides semantic search through MCP tools. AI assistants can find relevant documents based on meaning and context.
|
|
25
|
+
|
|
26
|
+
**Example workflow:**
|
|
27
|
+
|
|
28
|
+
1. Index your directories: `directory-indexer index ~/work/docs ~/incidents`
|
|
29
|
+
2. Configure with Claude Desktop or any MCP client
|
|
30
|
+
3. Ask: _"Find incidents similar to this Redis timeout error"_
|
|
31
|
+
4. AI searches embeddings, finds relevant files, reads content, provides context
|
|
32
|
+
|
|
33
|
+
## Architecture
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
|
|
37
|
+
│ AI Assistant │◄──►│ MCP Server │◄──►│ Vector Store │
|
|
38
|
+
│ (Claude, etc) │ │ (Rust) │ │ (Qdrant) │
|
|
39
|
+
└─────────────────┘ └──────────────────┘ └─────────────────┘
|
|
40
|
+
│
|
|
41
|
+
▼
|
|
42
|
+
┌──────────────────┐
|
|
43
|
+
│ File System │
|
|
44
|
+
│ Monitor │
|
|
45
|
+
└──────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Core components:**
|
|
49
|
+
|
|
50
|
+
- **MCP Server**: Implements Model Context Protocol, provides search tools
|
|
51
|
+
- **File Processor**: Converts various formats (PDF, DOCX, etc.) to text (initially unimplemented)
|
|
52
|
+
- **Indexing Engine**: Extracts content, creates embeddings, handles updates
|
|
53
|
+
- **Vector Storage**: Qdrant for fast similarity search
|
|
54
|
+
- **File Monitor**: Watches for changes, incremental updates
|
|
55
|
+
|
|
56
|
+
## MCP Tools
|
|
57
|
+
|
|
58
|
+
- `index(directory_path)` - Index all files in directory
|
|
59
|
+
- `search(query, directory_path)` - Semantic search across indexed files
|
|
60
|
+
- `similar_files(file_path, limit)` - Find files similar to given file
|
|
61
|
+
- `get_content(file_path, chunks?)` - Read file with optional chunk selection
|
|
62
|
+
- `server_info()` - Show indexed directories and stats
|
|
63
|
+
|
|
64
|
+
## CLI Commands
|
|
65
|
+
|
|
66
|
+
- `directory-indexer index <paths...>` - Index directories
|
|
67
|
+
- `directory-indexer search <query> [path]` - Search indexed content
|
|
68
|
+
- `directory-indexer similar <file> [--limit N]` - Find similar files
|
|
69
|
+
- `directory-indexer get <file> [--chunks N-M]` - Get file content
|
|
70
|
+
- `directory-indexer serve` - Start MCP server
|
|
71
|
+
- `directory-indexer status` - Show indexing status
|
|
72
|
+
|
|
73
|
+
## Installation
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Install via npm
|
|
77
|
+
npm install -g directory-indexer
|
|
78
|
+
|
|
79
|
+
# Or run directly
|
|
80
|
+
npx directory-indexer@latest
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Requirements:**
|
|
84
|
+
|
|
85
|
+
- Qdrant (local or remote)
|
|
86
|
+
- Embedding provider:
|
|
87
|
+
- Local: Ollama (free)
|
|
88
|
+
- Remote: OpenAI, Voyage AI, OpenRouter, or compatible API (requires API key)
|
|
89
|
+
|
|
90
|
+
## Usage
|
|
91
|
+
|
|
92
|
+
### 1. Index directories
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
directory-indexer index ~/work/incidents ~/docs/runbooks
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 2. Search from CLI
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Semantic search
|
|
102
|
+
directory-indexer search "Redis connection timeout" ~/work/incidents
|
|
103
|
+
|
|
104
|
+
# Find similar files
|
|
105
|
+
directory-indexer similar ~/work/incidents/icm-2024-0123.md
|
|
106
|
+
|
|
107
|
+
# Get file content with chunks
|
|
108
|
+
directory-indexer get ~/work/runbooks/deployment.md --chunks 2-5
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 3. Use with MCP clients
|
|
112
|
+
|
|
113
|
+
Add to Cline, Claude Desktop, or Cursor config:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"directory-indexer": {
|
|
119
|
+
"command": "directory-indexer",
|
|
120
|
+
"args": ["serve"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 4. Interactive with AI
|
|
127
|
+
|
|
128
|
+
- _"Find documentation about our Redis setup"_
|
|
129
|
+
- _"What incidents have we had with database timeouts?"_
|
|
130
|
+
- _"Show me examples of error handling in our Go services"_
|
|
131
|
+
|
|
132
|
+
## Configuration
|
|
133
|
+
|
|
134
|
+
Default config at `~/.directory-indexer/config.json`:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"embedding": {
|
|
139
|
+
"provider": "ollama",
|
|
140
|
+
"model": "nomic-embed-text",
|
|
141
|
+
"endpoint": "http://localhost:11434"
|
|
142
|
+
},
|
|
143
|
+
"storage": {
|
|
144
|
+
"type": "qdrant",
|
|
145
|
+
"endpoint": "http://localhost:6333",
|
|
146
|
+
"collection": "documents"
|
|
147
|
+
},
|
|
148
|
+
"indexing": {
|
|
149
|
+
"chunk_size": 512,
|
|
150
|
+
"overlap": 50,
|
|
151
|
+
"max_file_size": 10485760,
|
|
152
|
+
"ignore_patterns": [".git", "node_modules", "target"]
|
|
153
|
+
},
|
|
154
|
+
"monitoring": {
|
|
155
|
+
"enabled": true,
|
|
156
|
+
"batch_size": 100
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**API Key handling:**
|
|
162
|
+
|
|
163
|
+
- Only include `api_key` field when using remote providers (OpenAI, Voyage AI, OpenRouter)
|
|
164
|
+
- Omit the field entirely for local Ollama
|
|
165
|
+
- Store API keys securely with proper file permissions (`600`)
|
|
166
|
+
|
|
167
|
+
## Supported File Types
|
|
168
|
+
|
|
169
|
+
- **Text**: `.md`, `.txt`, `.rst`, `.org`
|
|
170
|
+
- **Code**: Most programming languages with syntax awareness
|
|
171
|
+
- **Data**: `.json`, `.yaml`, `.csv`, `.toml`
|
|
172
|
+
- **Config**: `.env`, `.conf`, `.ini`
|
|
173
|
+
- **Web**: `.html`, `.xml`
|
|
174
|
+
|
|
175
|
+
## Planned Support
|
|
176
|
+
|
|
177
|
+
- **Documents**: `.pdf`, `.docx`, `.pptx` (requires file conversion preprocessing)
|
|
178
|
+
- **Spreadsheets**: `.xlsx`, `.ods`
|
|
179
|
+
- **Archives**: Extract and index contents of `.zip`, `.tar.gz`
|
|
180
|
+
|
|
181
|
+
## Development
|
|
182
|
+
|
|
183
|
+
**Tech stack:**
|
|
184
|
+
|
|
185
|
+
- Rust (tokio async runtime)
|
|
186
|
+
- Qdrant (vector database)
|
|
187
|
+
- Ollama or OpenAI-compatible embedding API
|
|
188
|
+
- Model Context Protocol
|
|
189
|
+
- Platform-native file watching
|
|
190
|
+
|
|
191
|
+
**Architecture decisions:**
|
|
192
|
+
|
|
193
|
+
- Rust for performance and memory safety
|
|
194
|
+
- Qdrant for production-ready vector search
|
|
195
|
+
- MCP for standardized AI assistant integration
|
|
196
|
+
- Local-first with optional remote embedding APIs
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const packageJson = require('../package.json');
|
|
4
|
+
|
|
5
|
+
console.log(`${packageJson.name} v${packageJson.version}`);
|
|
6
|
+
console.log('This is a placeholder package. Full implementation coming soon!');
|
|
7
|
+
console.log('');
|
|
8
|
+
console.log('Planned commands:');
|
|
9
|
+
console.log(' directory-indexer index <paths...> - Index directories');
|
|
10
|
+
console.log(' directory-indexer search <query> - Search indexed content');
|
|
11
|
+
console.log(' directory-indexer similar <file> - Find similar files');
|
|
12
|
+
console.log(' directory-indexer serve - Start MCP server');
|
|
13
|
+
console.log(' directory-indexer status - Show indexing status');
|
|
14
|
+
console.log('');
|
|
15
|
+
console.log('GitHub: https://github.com/peteretelej/directory-indexer');
|
|
16
|
+
|
|
17
|
+
process.exit(0);
|
package/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
console.log('Directory Indexer v0.0.1');
|
|
4
|
+
console.log('This is a placeholder package. Full implementation coming soon!');
|
|
5
|
+
console.log('');
|
|
6
|
+
console.log('Stay tuned for:');
|
|
7
|
+
console.log('- MCP server for semantic directory indexing');
|
|
8
|
+
console.log('- Vector-based file search with AI assistants');
|
|
9
|
+
console.log('- Support for multiple file formats');
|
|
10
|
+
console.log('');
|
|
11
|
+
console.log('GitHub: https://github.com/peteretelej/directory-indexer');
|
|
12
|
+
|
|
13
|
+
process.exit(0);
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "directory-indexer",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Turn your directories into an AI-powered knowledge base for your team. MCP server that indexes local directories with semantic search.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"directory-indexer": "./bin/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"directories": {
|
|
10
|
+
"doc": "docs"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"start": "node index.js",
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mcp",
|
|
18
|
+
"semantic-search",
|
|
19
|
+
"vector-database",
|
|
20
|
+
"ai",
|
|
21
|
+
"indexing",
|
|
22
|
+
"knowledge-base",
|
|
23
|
+
"claude",
|
|
24
|
+
"directory",
|
|
25
|
+
"search"
|
|
26
|
+
],
|
|
27
|
+
"author": "Peter Etelej <peter@etelej.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/peteretelej/directory-indexer.git"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/peteretelej/directory-indexer#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/peteretelej/directory-indexer/issues"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"index.js",
|
|
42
|
+
"bin/",
|
|
43
|
+
"README.md",
|
|
44
|
+
"LICENSE"
|
|
45
|
+
]
|
|
46
|
+
}
|