Logo von Directory Indexer

Directory Indexer

Community
peteretelej

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

Herausgeberpeteretelej
Repositorydirectory-indexer
SpracheTypeScript
Forks
5
Sterne
17
Verfügbare Tools
6
Transporttypstdio
Kategorien
Links
  • Tools mit KI-Workflows verbinden

    Directory Indexer stellt MCP-Funktionen bereit, die kompatible KI-Clients und Agenten nutzen können.

  • Verfügbare Tools: 6

    Unten finden Sie die aufrufbaren Aktionen. Namen und Beschreibungen werden angezeigt, sofern der Server sie bereitstellt.

  • Konfiguration zum Kopieren

    Nutzen Sie die Installationsbeispiele, um diesen Server in Ihrem bevorzugten MCP-Client zu konfigurieren.

  • Open-Source-Kennzahlen

    Kennzahlen des verlinkten Repositorys: Sterne (17) und 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

Installation

TypingMind
Voraussetzungen:

Node.js 18+

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

Verfügbare 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 mit mehreren KI-Modellen nutzen

TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. Sobald Directory Indexer verbunden ist, können Sie die Integration mit verschiedenen KI-Modellen in TypingMind verwenden, statt sie für jedes Modell separat einzurichten. Diese MCP-Integration läuft lokal über den TypingMind-MCP-Konnektor auf Ihrem Gerät.

Einrichtungsanleitung für den lokalen Konnektor

Nutzen Sie diese Option, wenn der MCP-Server Zugriff auf lokale Dateien, Apps oder private Ressourcen auf Ihrem Computer benötigt.

1

MCP-Einstellungen öffnen

Gehen Sie in TypingMind zu „Einstellungen“, „Erweiterte Einstellungen“ und dann „Model Context Protocol“ und wählen Sie „Konnektor einrichten“.

  1. Öffnen Sie TypingMind in Ihrem Browser.
  2. Klicken Sie auf das Symbol „Einstellungen“.
  3. Gehen Sie zu „Erweiterte Einstellungen“.
  4. Öffnen Sie den Abschnitt „Model Context Protocol“.
  5. Klicken Sie auf „Konnektor einrichten“ und wählen Sie „Dieses Gerät“.
Einrichtungsbildschirm des TypingMind-MCP-Konnektors mit ausgewählter Option „Dieses Gerät“
2

Konnektor-Befehl ausführen

Wählen Sie „Dieses Gerät“, kopieren Sie den Befehl aus TypingMind und führen Sie ihn im Terminal aus. Lassen Sie den Prozess laufen, solange Sie MCP verwenden.

  1. Kopieren Sie den in TypingMind angezeigten Einrichtungsbefehl.
  2. Öffnen Sie „Terminal“ (macOS) bzw. „Windows Terminal“ (Windows).
  3. Fügen Sie den Befehl ein und führen Sie ihn aus.
  4. Bestätigen Sie die Paketinstallation, wenn Sie im Terminal zum Fortfahren aufgefordert werden.
  5. Lassen Sie das Terminalfenster geöffnet und den Prozess darin laufen, solange Sie MCP-Tools verwenden.
3

Directory Indexer als Server hinzufügen

Wenn der Konnektorstatus „Bereit“ anzeigt, klicken Sie auf „Server bearbeiten“ und fügen Sie die MCP-Server-Konfiguration ein.

  1. Warten Sie, bis der Konnektorstatus „Bereit“ anzeigt.
  2. Klicken Sie auf „Server bearbeiten“.
  3. Fügen Sie die MCP-Server-Konfiguration für Directory Indexer ein.
  4. Speichern Sie die Serverliste.
  5. Aktualisieren Sie die Ansicht, um bei Bedarf zu prüfen, ob der Konnektor weiterhin bereit ist.
MCP-Einstellungen in TypingMind mit aktivem Server und der Schaltfläche „Server bearbeiten“
{
  "mcpServers": {
    "peteretelej-directory-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "directory-indexer"
      ]
    }
  }
}
4

Verbindung modellübergreifend nutzen

Speichern Sie die Serverliste, öffnen Sie „Plugins“ und aktivieren Sie die MCP-Tools von Directory Indexer. Wählen Sie dann ein beliebiges unterstütztes KI-Modell in TypingMind und verwenden Sie die Tools im Chat oder weisen Sie sie einem KI-Agenten zu.

  1. Öffnen Sie die Seite „Plugins“ in TypingMind.
  2. Aktivieren Sie die MCP-Tools von Directory Indexer.
  3. Starten Sie einen Chat und wählen Sie das KI-Modell, das Sie verwenden möchten.
  4. Nutzen Sie die MCP-Tools im Chat oder weisen Sie sie einem KI-Agenten zu.
  5. Wechseln Sie bei Bedarf zu einem anderen KI-Modell, ohne die MCP-Verbindung erneut herzustellen.
TypingMind-Chat mit aktivierten MCP-Tools und einem ausgewählten KI-Modell
Können Sie mir mit Directory Indexer bei dieser Aufgabe helfen?
Directory Indexer
Gerne. Ich habe es gelesen.
Das habe ich mit Directory Indexer gefunden.

Häufig gestellte Fragen

Wofür wird der MCP-Server Directory Indexer verwendet?

Directory Indexer ist ein MCP-Server, über den kompatible KI-Clients auf externe Tools und Kontext zugreifen können. In TypingMind können Sie diesen MCP-Server einmal hinzufügen und seine Tools in Ihrem KI-Arbeitsbereich verfügbar machen.

Kann ich den MCP-Server Directory Indexer mit mehreren KI-Modellen in TypingMind verwenden?

Ja. TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. So können Sie Directory Indexer mit verschiedenen KI-Modellen wie Claude, ChatGPT, Gemini oder anderen in TypingMind konfigurierten Modellen verwenden, ohne den MCP-Server für jedes Modell separat einzurichten.

Warum den MCP-Server Directory Indexer mit TypingMind nutzen?

TypingMind ist eine der besten Oberflächen für LLM-Chats, da es mehrere KI-Modelle, Prompts, Plugins, KI-Agenten, API-Schlüssel und MCP-Tools in einem Arbeitsbereich vereint. Sobald Directory Indexer verbunden ist, können Sie die zugehörigen MCP-Tools mit Ihren bevorzugten Modellen nutzen und Ihre Chat-Abläufe in TypingMind übersichtlich organisieren.

Wie verbinde ich den MCP-Server Directory Indexer mit TypingMind?

Directory Indexer wird über den lokalen MCP-Konnektor von TypingMind angebunden. Das ist die beste Wahl, wenn der MCP-Server auf lokale Dateien, Desktop-Apps, Befehlszeilentools oder private Ressourcen auf Ihrem Computer zugreifen muss.

Welche Tools stellt der MCP-Server Directory Indexer in TypingMind bereit?

Die MCP-Tools von Directory Indexer (Anzahl: 6) können Sie auf der Plugins-Seite in TypingMind aktivieren und im Chat verwenden oder KI-Agenten zuweisen.

Muss ich meine API-Schlüssel mit TypingMind teilen, um den MCP-Server Directory Indexer zu verwenden?

Nein. TypingMind arbeitet vorrangig lokal. Sie wählen Ihre Modellanbieter selbst und behalten die Kontrolle über Ihre API-Schlüssel, Prompts und MCP-Konfiguration. Falls Directory Indexer eine Authentifizierung erfordert, fügen Sie beim Erstellen der Verbindung die erforderlichen Header, OAuth-Einstellungen oder die lokale Konfiguration für diesen MCP-Server hinzu.

Ähnliche MCP-Server

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇