Logo: Directory Indexer

Directory Indexer

Communautéit
peteretelej

MCP Server for indexing your local directories into a knowledgebase for your AI Assistants.

Editeurpeteretelej
Repositorydirectory-indexer
SproochTypeScript
Forks
5
Stären
17
Disponibel Tools
6
Transporttypstdio
Kategorien
Linken
  • Tools mat KI-Workflows verbannen

    Directory Indexer bitt MCP-Funktiounen un, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • Disponibel Tools: 6

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an deem MCP-Client ze konfiguréieren, deen Dir am léifste benotzt.

  • Interessi vun der Communautéit um Open-Source-Projet

    Zuele vum verlinkte Repository – Stären: 17, Forks: 5.

Directory Indexer

Turn your directories into an AI-powered knowledge base.

npm codecov License: MIT CI

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.

Quick Start

Prerequisites:

  • Docker - For running Qdrant and Ollama (skip if you already have them running natively)
  • Node.js 18+ - Required for running directory-indexer (the v1.x line targets Node 18 LTS compatibility)

Note: For native Qdrant and Ollama installation without Docker, see Setup section.

1. Start Qdrant vector database (skip if already running)

bash
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.

bash
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:

bash
# qdrant endpoint
curl http://localhost:6333/

# confirm what ollama models are available
curl http://localhost:11434/api/tags

3. Index your directories

bash
npx directory-indexer@latest index ./WorkNotes ./Projects

4. Configure AI assistant (Claude Desktop, Cursor, Cline, Roo Code, Zed etc.)

Add to your MCP configuration:

json
{
  "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.

Setup

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:

1. Qdrant Vector Database

Choose one option:

Docker (recommended for most users):

bash
docker run -d --name qdrant \
    -p 127.0.0.1:6333:6333 \
    -v qdrant_storage:/qdrant/storage \
    qdrant/qdrant
  • This option requires Docker
  • Runs Qdrant on docker container, uses a named volume qdrant_storage for persistent storage.

Alternative: Install natively from qdrant.tech

2. Embedding Provider

Choose one option:

Option A: Ollama (recommended - free, runs locally)

bash
# 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)

bash
export OPENAI_API_KEY="your-api-key-here"

Quick Verification

Test your setup:

bash
# 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.

Usage

MCP Integration

Configure with AI assistants (Claude Desktop, Cline, etc.) using npx:

json
{
  "mcpServers": {
    "directory-indexer": {
      "command": "npx",
      "args": ["directory-indexer@latest", "serve"]
    }
  }
}

Index your directories:

bash
# Index your directories first
npx directory-indexer@latest index /home/user/projects/docs /home/user/work/reports

How it works:

  1. MCP server starts automatically - When your AI assistant connects, it launches the MCP server in the background
  2. Indexing runs independently - You can index files before, during, or after MCP setup
  3. Search immediately available - Your AI assistant can search files as soon as they're indexed

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.

Using with AI Assistant

Once configured, your AI assistant can search your indexed documents semantically:

Search by concept:

  • "Find API authentication examples"
  • "Show me error handling patterns"
  • "Find configuration for Redis"

Find similar content:

  • "Show me incidents similar to this outage report" (when you have an incident file open)
  • "Find documentation like this API guide" (when viewing an API doc)
  • "What files are similar to my deployment script?"

Troubleshoot issues:

  • "Find troubleshooting guides on SQL deadlocks"
  • "Show me solutions for timeout errors"
  • "Find debugging tips for performance issues"

Custom Configuration

Configure with custom endpoints and data directory:

json
{
  "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"
      }
    }
  }
}

Workspace Support

Organize content into workspaces for focused searches:

json
{
  "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:

  • Define workspace environments with WORKSPACE_NAME format
  • Use comma-separated paths or JSON arrays: ["path1", "path2"]
  • Search within specific workspaces: "Find issues about authentication in customer cases workspace"
  • Your AI assistant can filter results to relevant workspace content
  • Use server_info to see available workspaces and their statistics

CLI Usage

For advanced users who prefer command-line usage, see CLI Documentation.

Configuration

Environment variables (all optional):

bash
# 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.

Performance Tips

Speed up embedding generation:

  • Install Ollama natively - Enables automatic GPU acceleration (Docker version uses CPU only)
  • Use OpenAI API - Faster than local embeddings but requires paid API key and sends data to OpenAI servers

Smart indexing:

  • Index parent directories - Avoids duplicates since full file paths are stored
  • Keep folders focused - Only index directories with documents you want searchable
  • Start with key folders - Index your most important documentation first

Time management:

  • Run during off-hours - Let large directories index overnight
  • Continue working - MCP server works immediately while indexing runs in background
  • Re-index efficiently - Only changed files are reprocessed when you re-run indexing

Supported Files

  • 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

Documentation

License

MIT

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "peteretelej-directory-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "directory-indexer"
      ]
    }
  }
}

Disponibel Tools

  • index

    Index directories to make their files searchable. Processes files to create vector embeddings for semantic search.

    When to use this tool:

    • User specifically requests indexing a directory as a knowledge base
    • Adding new documentation, code repositories, or file collections to search
    • Updating index when many files have changed

    How it works:

    • Recursively scans directories for supported file types
    • Extracts text content and splits into chunks
    • Generates vector embeddings for semantic similarity
    • Stores in database for fast retrieval

    Examples:

    • Index documentation: "/home/user/docs/project-wiki"
    • Index codebase: "/home/user/projects/api-server"
    • Index multiple directories: "/home/user/docs,/home/user/configs"

    Indexing can take several minutes for large directories. Most users will already have directories indexed and can directly use search tool. Use server_info to check current indexing status first.

  • search

    Search indexed files using natural language queries. Finds files containing content semantically similar to the query.

    When to use this tool:

    • Find documentation, guides, or explanations about specific topics
    • Locate code files implementing certain functionality or patterns
    • Discover configuration files, scripts, or settings related to a topic
    • Search for files covering specific concepts or technologies

    How it works:

    • Converts query to vector embedding using semantic similarity
    • Searches all indexed file chunks for relevant content
    • Groups results by file and calculates average relevance scores
    • Returns files ranked by relevance score

    Examples:

    • "database configuration and connection pooling setup" - finds config files, documentation about DB setup
    • "comprehensive error handling patterns and exception management" - finds code files with exception handling
    • "JWT authentication implementation and session management" - finds auth-related code and docs
    • "REST API documentati
  • similar_files

    Find files with content similar to a reference file. Uses semantic similarity to find related documents, code files, or any text content.

    When to use this tool:

    • Find documentation similar to a specific guide or README
    • Locate related code files, configuration files, or scripts
    • Discover alternative implementations or approaches
    • Find files covering similar topics or concepts

    How it works:

    • Analyzes the semantic content of the reference file
    • Compares against all indexed files using vector similarity
    • Returns files ranked by content similarity score

    Examples:

    • Given "deployment-guide.md" - finds other deployment docs, CI/CD guides, infrastructure setup
    • Given "troubleshooting.md" - finds other troubleshooting guides, FAQ files, error documentation
    • Given "config.yaml" - finds other configuration files, settings, environment setups
    • Given "auth.py" - finds other authentication modules, security code, middleware

    Returns file paths with similarity scores. Use get_content to

  • get_content

    Retrieve the full content of a file or specific chunks. Reads files directly from the filesystem.

    When to use this tool:

    • Get complete file content after finding files through search
    • Read documentation, code files, or configuration files for analysis
    • Extract specific sections of large files using chunk ranges
    • Access any text-based file content

    How it works:

    • Reads files directly from filesystem (not from search index)
    • Returns entire file by default
    • Can return specific chunk ranges for indexed files
    • Preserves original formatting and content

    Examples:

    • Get full file: file_path="/home/user/docs/api.md"
    • Get specific chunks: file_path="/home/user/code/main.py", chunks="2-5"
    • Get single chunk: file_path="/home/user/config.json", chunks="1"

    Returns file content as text. Use this after search or similar_files to read actual content.

  • get_chunk

    Retrieve content of a specific chunk from an indexed file. Gets exact text segments identified during search.

    When to use this tool:

    • Get specific relevant sections after performing a search
    • Access only the most pertinent parts of large files
    • Retrieve content from high-scoring chunks identified in search results
    • Avoid reading entire files when only specific sections are needed

    How it works:

    • Files are split into overlapping text chunks during indexing
    • Each chunk has a sequential ID ("0", "1", "2", etc.)
    • Search results include chunk IDs for relevant sections
    • Returns the exact content that was semantically matched

    Examples:

    • After search returns chunk "3" from "api-docs.md" with high score
    • Get chunk content: file_path="/docs/api-docs.md", chunk_id="3"
    • Returns the specific text segment that matched your query

    Returns chunk content as text. Use this with chunk IDs from search results to get precise content sections.

  • server_info

    Get information about server status and indexed content. Shows what directories and files are available for search.

    When to use this tool:

    • REQUIRED: Check available workspace names before using workspace parameter in search or similar_files tools
    • Check what content is already indexed before performing searches
    • Verify system is working properly
    • See indexing statistics and status
    • Understand scope of available searchable content

    How it works:

    • Reports total indexed directories, files, and chunks
    • Shows database size and last indexing time
    • Lists all indexed directories with file counts
    • Lists all configured workspaces with their paths and file counts
    • Reports any errors or issues

    Examples:

    • Check workspaces before searching: "What workspaces are available?"
    • Check before searching: "What content is indexed?"
    • Verify after indexing: "Did the indexing complete successfully?"
    • Monitor system: "How many files are searchable?"

    Returns server version, indexing statistics,

Directory Indexer MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Directory Indexer verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung, fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector: D'Optioun „Dësen Apparat“ ass ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Setzt de kopéierte Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Directory Indexer als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a setzt d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Setzt d'MCP-Serverkonfiguratioun fir Directory Indexer an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert d'Säit, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "peteretelej-directory-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "directory-indexer"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vun der Integratioun Directory Indexer. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vun der Integratioun Directory Indexer.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierten MCP-Tools an engem ausgewielte KI-Modell
Kënnt Dir mir mat Directory Indexer bei dëser Aufgab hëllefen?
Directory Indexer
Jo. Ech hunn et gelies.
Dat hunn ech mat Directory Indexer fonnt.

Heefeg gestallte Froen

Fir wat gëtt den MCP-Server Directory Indexer benotzt?

Directory Indexer ass en MCP-Server, deen et kompatibele KI-Clienten erlaabt, op extern Tools a Kontextinformatioune zouzegräifen. An TypingMind kënnt Dir dësen MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Directory Indexer MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Directory Indexer mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni den MCP-Server fir all Modell separat anzeriichten.

Firwat Directory Indexer MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Directory Indexer verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Ären Aarbechtsoflaf beim Chatten an TypingMind organiséieren.

Wéi verbannen ech Directory Indexer MCP mat TypingMind?

Directory Indexer leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann den MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Directory Indexer MCP an TypingMind zur Verfügung?

Directory Indexer stellt 6 MCP-Tools zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agente zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Directory Indexer MCP ze benotzen?

Nee. TypingMind ass nom Local-first-Prinzip opgebaut a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Directory Indexer eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir deen MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇