Logo di Directory Indexer

Directory Indexer

Community
peteretelej

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

Pubblicato dapeteretelej
Repositorydirectory-indexer
LinguaTypeScript
Fork
5
Stelle
17
Strumenti disponibili
6
Tipo di trasportostdio
Categorie
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Directory Indexer mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • Strumenti disponibili: 6

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni se il server li fornisce.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse della comunità open source

    Stelle: 17; fork: 5 (repository collegato).

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

Installazione

TypingMind
Prerequisiti:

Node.js 18+

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

Strumenti disponibili

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

Usa Directory Indexer MCP con più modelli AI

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Directory Indexer, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura connettore.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura connettore e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con l’opzione «Questo dispositivo» selezionata
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Directory Indexer come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Directory Indexer.
  4. Salva l'elenco dei server.
  5. Se vuoi verificare che il connettore sia ancora pronto, aggiorna la pagina.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "peteretelej-directory-indexer": {
      "command": "npx",
      "args": [
        "-y",
        "directory-indexer"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Directory Indexer, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Directory Indexer.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Directory Indexer per aiutarmi con questa attività?
Directory Indexer
Certo. L’ho letto.
Ecco cosa ho trovato con Directory Indexer.

Domande frequenti

A cosa serve il server MCP Directory Indexer?

Directory Indexer è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare il server MCP Directory Indexer con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Directory Indexer con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Directory Indexer con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Directory Indexer, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego il server MCP Directory Indexer a TypingMind?

Directory Indexer funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre il server MCP Directory Indexer in TypingMind?

Strumenti MCP disponibili per Directory Indexer: 6. Puoi attivarli dalla pagina Plugin di TypingMind e usarli in chat o assegnarli agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare il server MCP Directory Indexer?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Directory Indexer richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇