Logo van Directory Indexer

Directory Indexer

Community
peteretelej

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

Uitgeverpeteretelej
Repositorydirectory-indexer
TaalTypeScript
Forks
5
Sterren
17
Beschikbare tools
6
Transporttypestdio
Categorieën
Links
  • Koppel tools aan AI-workflows

    Directory Indexer biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • Beschikbare tools: 6

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Belangstelling voor het opensourceproject

    Statistieken van de gekoppelde repository (sterren: 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

Installatie

TypingMind
Vereisten:

Node.js 18+

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

Beschikbare 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,

Gebruik Directory Indexer MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Directory Indexer is verbonden, kun je de verbinding dus met verschillende AI-modellen in TypingMind gebruiken, zonder die voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Directory Indexer toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus op ‘Gereed’ staat.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Directory Indexer.
  4. Sla de serverlijst op.
  5. Vernieuw de pagina als je wilt controleren of de connectorstatus nog op ‘Gereed’ staat.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "peteretelej-directory-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "directory-indexer"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Directory Indexer in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Directory Indexer in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Directory Indexer gebruiken om me hiermee te helpen?
Directory Indexer
Zeker. Ik heb het gelezen.
Dit vond ik met Directory Indexer.

Veelgestelde vragen

Waarvoor wordt de MCP-server Directory Indexer gebruikt?

Directory Indexer is een MCP-server waarmee compatibele AI-clients toegang krijgen tot externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Directory Indexer MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Directory Indexer gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Directory Indexer MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Directory Indexer verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Directory Indexer MCP met TypingMind?

Directory Indexer werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt Directory Indexer MCP in TypingMind?

Aantal MCP-tools van Directory Indexer: 6. Je kunt elke tool inschakelen via de pagina Plug-ins in TypingMind en vervolgens gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Directory Indexer MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Directory Indexer authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇