directory-indexer 0.0.6

AI-powered directory indexing with semantic search for MCP servers
Documentation

Directory Indexer

Turn your directories into an AI-powered knowledge base.

npm Crates.io License: MIT CI

Give AI assistants semantic search across your local files. Find relevant documents based on meaning, not just filenames.

Quick Start

# Install via npm
npm install -g directory-indexer

# Index your directories
directory-indexer index ~/Documents ~/work/docs

# Start MCP server for AI assistants
directory-indexer serve

Configure with Claude Desktop:

{
  "mcpServers": {
    "directory-indexer": {
      "command": "directory-indexer",
      "args": ["serve"]
    }
  }
}

Now ask Claude: "Find files similar to my Redis incident reports" and it will search your indexed documents semantically.

Setup

Before using directory-indexer, you need to set up two services:

1. Qdrant Vector Database

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

Alternative: Install natively from qdrant.tech

2. Embedding Provider

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"

Quick Verification

Test your setup:

# Check Qdrant
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.

Configuration

Directory Indexer uses environment variables for configuration. Set these if your services run on different ports or require API keys:

# Service endpoints (defaults shown)
export QDRANT_ENDPOINT="http://localhost:6333"
export OLLAMA_ENDPOINT="http://localhost:11434"

# Optional data directory (default: ~/.directory-indexer)
export DIRECTORY_INDEXER_DATA_DIR="/path/to/data"

# Optional Qdrant collection name (default: directory-indexer)
# Note: Setting to "test" enables auto-cleanup for testing
export DIRECTORY_INDEXER_QDRANT_COLLECTION="my-custom-collection"

# Optional API keys
export QDRANT_API_KEY="your-qdrant-key"
export OLLAMA_API_KEY="your-ollama-key"  # if using hosted Ollama

For MCP clients (like Claude Desktop), configure with environment variables:

{
  "mcpServers": {
    "directory-indexer": {
      "command": "directory-indexer",
      "args": ["serve"],
      "env": {
        "QDRANT_ENDPOINT": "http://localhost:6333",
        "OLLAMA_ENDPOINT": "http://localhost:11434",
        "DIRECTORY_INDEXER_DATA_DIR": "/path/to/data"
      }
    }
  }
}

CLI Usage

# Index your directories
directory-indexer index ~/Documents ~/work/docs

# Search semantically
directory-indexer search "database timeout errors"

# Find similar files
directory-indexer similar ~/incidents/redis-outage.md

# Get file content
directory-indexer get ~/docs/api-guide.md

# Show status
directory-indexer status

Supported Files

  • Text: .md, .txt
  • Code: .rs, .py, .js, .ts, .go, .java, etc.
  • Data: .json, .yaml, .csv, .toml
  • Config: .env, .conf, .ini

Documentation

License

MIT