- AiDex - Persistent Code Indexing MCP Server
AiDex - Persistent Code Indexing MCP Server
Stop wasting 80% of your AI's context window on code searches.
AiDex indexes your codebase once using Tree-sitter and gives AI assistants instant access to every function, class, and method signature.
The Problem
Every time your AI assistant searches for code, it:
- Greps through thousands of files → hundreds of results flood the context
- Reads file after file to understand the structure → more context consumed
- Forgets everything when the session ends → repeat from scratch
A single "Where is X defined?" question can eat 2,000+ tokens. Do that 10 times and you've burned half your context on navigation alone.
The Solution
Index once, query forever:
Before (grep): grep "PlayerHealth" → 200 hits in 40 files → 2000+ tokens consumed, 5+ tool calls
After (AiDex): aidex_query({ term: "PlayerHealth" }) → Engine.cs:45, Player.cs:23, UI.cs:156 → ~50 tokens, 1 tool call
Why Not Just Grep?
| Grep/Ripgrep | AiDex | |
|---|---|---|
| Context usage | 2000+ tokens per search | ~50 tokens |
| Results | All text matches | Only identifiers |
| Precision | log matches catalog, logarithm | log finds only log |
| Persistence | Starts fresh every time | Index survives sessions |
| Structure | Flat text search | Knows methods, classes, types |
Features
- Smart Extraction: Uses Tree-sitter to parse code properly — indexes identifiers, not keywords
- Method Signatures: Get function prototypes without reading implementations
- Project Summary: Auto-detected entry points, main classes, language breakdown
- Incremental Updates: Re-index single files after changes
- Cross-Project Links: Query across multiple related projects
- Time-based Filtering: Find what changed in the last hour, day, or week
- Session Notes: Leave reminders for the next session — persists in the database
- Interactive Viewer: Browser-based project explorer with live reload
Supported Languages
C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby
Quick Start
npm install -g aidex-mcp
aidex setup
aidex setup automatically detects and registers AiDex with your installed AI clients (Claude Code, Claude Desktop, Cursor, Windsurf, Gemini CLI, VS Code Copilot).
Technology
- Parser: Tree-sitter — Real parsing, not regex
- Database: SQLite with WAL mode — Fast, single file, zero config
- Protocol: MCP — Works with any compatible AI assistant
Server Config
{
"mcpServers": {
"aidex": {
"command": "npx",
"args": [
"-y",
"aidex-mcp"
]
}
}
}