loading…
Search for a command to run...
loading…
Provides AI assistants with semantic search and read access to local files and directories, enabling knowledge retrieval from indexed content.
Provides AI assistants with semantic search and read access to local files and directories, enabling knowledge retrieval from indexed content.
Turn your directories into an AI-powered knowledge base.
Self-hosted semantic search for local files. Give your AI assistant access to search, read, and work with your local files and directories. Ask about topics, patterns, or examples and get meaningful results from your actual knowledge base.
Prerequisites:
Note: For native Qdrant and Ollama installation without Docker, see Setup section.
1. Start Qdrant vector database (skip if already running)
docker run -d --name qdrant -p 127.0.0.1:6333:6333 -v qdrant_storage:/qdrant/storage qdrant/qdrant
2. Start Ollama embedding service (skip if already running)
Note: Docker Ollama won't use GPU acceleration. For better performance, consider native installation.
docker run -d --name ollama -p 127.0.0.1:11434:11434 -v ollama:/root/.ollama ollama/ollama
# Pull the embedding model
docker exec ollama ollama pull nomic-embed-text
Note: Make sure the embedding model is pulled before you start indexing.
You can confirm that Ollama and Qdrant are running by checking:
# qdrant endpoint
curl http://localhost:6333/
# confirm what ollama models are available
curl http://localhost:11434/api/tags
3. Index your directories
npx directory-indexer@latest index ./WorkNotes ./Projects
4. Configure AI assistant (Claude Desktop, Cursor, Cline, Roo Code, Zed etc.)
Add to your MCP configuration:
{
"mcpServers": {
"directory-indexer": {
"command": "npx",
"args": ["directory-indexer@latest", "serve"]
}
}
}
If you experience issues on windows adding this MCP. You can install the package globally using
npm install -g directory-indexer@latest
Then use the following MCP configuration
{
"mcpServers": {
"directory-indexer": {
"command": "directory-indexer",
"args": [ "serve" ]
}
}
}
Your AI assistant will automatically start the MCP server and can now search your indexed files.
Advanced: For organizing content into focused search areas, see Workspace Support. For faster indexing, see Performance Tips.
Directory Indexer runs locally on your machine or server. It uses an embedding provider (such as Ollama) to create vector embeddings of your files and stores them in a Qdrant vector database for fast semantic search. Both services can run remotely if needed.
Setup requires two services:
Choose one option:
Docker (recommended for most users):
docker run -d --name qdrant \
-p 127.0.0.1:6333:6333 \
-v qdrant_storage:/qdrant/storage \
qdrant/qdrant
qdrant_storage for persistent storage.Alternative: Install natively from qdrant.tech
Choose one option:
Option A: Ollama (recommended - free, runs locally)
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh # Linux/macOS
# For Windows: Download from https://ollama.ai
# Pull the embedding model
ollama pull nomic-embed-text
Option B: OpenAI (requires paid API key)
export OPENAI_API_KEY="your-api-key-here"
Test your setup:
# Check Qdrant Health
curl http://localhost:6333/healthz
# View collections
curl http://localhost:6333/collections
# Check Ollama
curl http://localhost:11434/api/tags
If either fails, directory-indexer will show a helpful error with setup guidance.
Configure with AI assistants (Claude Desktop, Cline, etc.) using npx:
{
"mcpServers": {
"directory-indexer": {
"command": "npx",
"args": ["directory-indexer@latest", "serve"]
}
}
}
Index your directories:
# Index your directories first
npx directory-indexer@latest index /home/user/projects/docs /home/user/work/reports
How it works:
Key point: You don't need to wait for indexing to complete before using the MCP server. Index files as needed, and your AI assistant will immediately have access to search them.
Once configured, your AI assistant can search your indexed documents semantically:
Search by concept:
Find similar content:
Troubleshoot issues:
Configure with custom endpoints and data directory:
{
"mcpServers": {
"directory-indexer": {
"command": "npx",
"args": ["directory-indexer@latest", "serve"],
"env": {
"DIRECTORY_INDEXER_DATA_DIR": "/opt/ai-knowledge-base",
"QDRANT_ENDPOINT": "http://localhost:6333",
"OLLAMA_ENDPOINT": "http://localhost:11434"
}
}
}
}
Organize content into workspaces for focused searches:
{
"mcpServers": {
"directory-indexer": {
"command": "npx",
"args": ["directory-indexer@latest", "serve"],
"env": {
"WORKSPACE_CUSTOMER_CASES": "C:\\Users\\john\\Documents\\Support\\Cases,C:\\Users\\john\\Documents\\Incidents",
"WORKSPACE_ENGINEERING_DOCS": "C:\\Users\\john\\Code\\API,C:\\Users\\john\\Code\\Web",
"WORKSPACE_COMPANY_POLICIES": "C:\\Users\\john\\Documents\\Policies,C:\\Users\\john\\Documents\\Procedures"
}
}
}
}
How workspaces work:
WORKSPACE_NAME format["path1", "path2"]server_info to see available workspaces and their statisticsFor advanced users who prefer command-line usage, see CLI Documentation.
Environment variables (all optional):
# Data directory (default: ~/.directory-indexer)
export DIRECTORY_INDEXER_DATA_DIR="/opt/ai-knowledge-base"
# Service endpoints (defaults shown)
export QDRANT_ENDPOINT="http://localhost:6333"
export OLLAMA_ENDPOINT="http://localhost:11434"
# Optional API keys
export OPENAI_API_KEY="your-key-here"
export QDRANT_API_KEY="your-key-here"
For all configuration options, see Environment Variables.
Speed up embedding generation:
Smart indexing:
Time management:
Text: .md, .txt
Code: .rs, .py, .js, .ts, .go, .java, etc.
Data: .json, .yaml, .csv, .toml
Config: .env, .conf, .ini
Upcoming: Support for more file types like PDFs, docx, etc, see #11
MIT
Выполни в терминале:
claude mcp add directory-indexer -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.