A code indexing service using MCP, Ollama, and Qdrant.
npm install code-indexernode --version)
nomic-embed-text model
docker run -p 6333:6333 qdrant/qdrant)
bash
1. Clone and install
git clone https://github.com/CoderDayton/code-indexer
cd code-indexer
npm install
2. Copy the example config (we made this super easy!)
cp .env.example .env
3. Start your engines
npm run build && npm start
`
$3
Your .env file is pre-configured with sensible defaults:
`env
Already set up for local development!
QDRANT_URL=http://localhost:6333
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=nomic-embed-text:latest
COLLECTION_NAME=code_index
BASE_DIRECTORY=auto-detected!
Smart file exclusions (NEW!)
USE_ADVANCED_EXCLUSIONS=true
EXCLUSION_CONFIG_PATH=indexer-exclusions.json
`
š® Available Commands
Once running, your AI can use these tools:
| Tool | What it does | Example |
|------|-------------|---------|
| index_files | Index specific files/folders | "Index my src/ directory" |
| search_code | Find code semantically | "Find JWT validation logic" |
| reindex_all | Refresh everything | "Reindex after big refactor" |
| start_watching | Auto-update on changes | "Watch for file changes" |
| get_status | Check what's indexed | "Show indexing status" |
š« Smart File Exclusions (NEW!)
> No more indexing junk! Our advanced exclusion system automatically filters out build artifacts, dependencies, and temporary files.
$3
- Build Artifacts: dist/, build/, target/, bin/, obj/
- Dependencies: node_modules/, vendor/, Pods/, .gradle/
- Version Control: .git/, .svn/, .hg/
- Temporary Files: .log, .tmp, .cache, .pid
- System Files: .DS_Store, Thumbs.db, desktop.ini
- Lock Files: package-lock.json, yarn.lock, Cargo.lock
- Large Files: Files over 50MB (configurable)
- Binary Files: Executables, images, compiled code
- Minified Code: .min.js, .bundle.js
$3
The system automatically detects your project type and applies smart exclusions:
`json
{
"javascript": ["node_modules/", "*.min.js", ".next/"],
"python": ["__pycache__/", "*.pyc", ".venv/"],
"java": ["target/*", ".class", "*.jar"],
"rust": ["target/**", "Cargo.lock"],
"csharp": ["bin/", "obj/", "*.dll"]
}
`
$3
Create your own indexer-exclusions.json:
`json
{
"exclusions": {
"folders": {
"patterns": ["my-custom-folder/", "temp/"]
},
"files": {
"patterns": [".secret", ".private"]
},
"size_limits": {
"max_file_size_mb": 25
}
},
"inclusion_overrides": {
"patterns": ["README.", "LICENSE", "*.md"]
}
}
`
$3
Prefer the old way? No problem:
`env
USE_ADVANCED_EXCLUSIONS=false
IGNORE_PATTERNS=node_modules/,dist/,*.log
`
šļø What We Fixed For You
> Fresh & Clean! This version has been completely reorganized for maximum clarity.
ā
Unified Config System - No more scattered config files
ā
Rock-Solid Validation - Zod schemas catch config errors early
ā
Clean Architecture - Easy to understand and extend
ā
Comprehensive Tests - Everything is tested and verified
$3
Control whether indexing kicks off automatically when the server starts using an environment flag.
- Variable: IMMEDIATE_INDEXING_ENABLED
- Type: boolean
- Accepted values: true, false, 1, 0, yes, no, on, off (case-insensitive)
- Default: false if unset or invalid
- Legacy aliases (deprecated, still honored): IMMEDIATE_INDEXING, START_INDEXING_ON_STARTUP
- Precedence: IMMEDIATE_INDEXING_ENABLED takes priority if both are set
Example:
`env
IMMEDIATE_INDEXING_ENABLED=true
`
Logs show whether the initial indexing was started or skipped.
ā
Zero Legacy Cruft - Removed all the old, confusing files
ā
Better Error Messages - Actually helpful when things go wrong
ā
Smart File Exclusions - Advanced filtering system ignores irrelevant files
ā
Language Intelligence - Automatically detects and excludes language-specific artifacts
š ļø Development Mode
`bash
npm run dev # Hot reload during development
npm test # Run the test suite
npm run build # Create production build
`
šļø Architecture Overview
`text
šÆ MCP Server ā Talks to AI models
š§ Code Indexer ā Processes your files
š Vector Store ā Qdrant similarity search
šļø File Watcher ā Keeps everything fresh
āļø Config System ā Zod-validated settings
`
š Troubleshooting
"Connection refused" ā Check if Qdrant/Ollama are running
"Model not found" ā Run ollama pull nomic-embed-text
"Permission denied" ā Make sure BASE_DIRECTORY is readable
"No files found" ā Check your exclusion patterns in indexer-exclusions.json
"Config file error" ā Validate your JSON syntax or set USE_ADVANCED_EXCLUSIONS=false
"Too many files excluded" ā Review inclusion overrides or adjust exclusion patterns
Still stuck? ā Check the logs in ./logs/ directory
š Configuration Files
| File | Purpose | Documentation |
|------|---------|---------------|
| .env | Environment variables | Copy from .env.example |
| indexer-exclusions.json | Advanced file exclusions | See EXCLUSION_SYSTEM.md |
| tsconfig.json | TypeScript configuration | Standard TS config |
| package.json` | Dependencies and scripts | Standard Node.js config |