AiDex is a persistent code indexing MCP server for AI programming assistants, developed by CSCSoftware. Its core goal is to enable AI assistants (such as Claude Code, Claude Desktop, Cursor, Windsurf, Gemini CLI, VS Code Copilot, and other MCP-compatible clients) to quickly and precisely query a codebase without repeatedly grepping and reading entire files. It is officially claimed to reduce context consumption for code navigation by 50-80%, with a single search consuming about 50 tokens, whereas grep often requires 2000+ tokens.
[Purpose] To provide AI programming agents with "memory" and instant access to the codebase. After indexing once, the AI can query identifiers, function signatures, and file structures without reading files one by one. The index is stored as a SQLite file in .aidex/index.db within the project, local-first and model-agnostic.
[Main Capabilities]
- Persistent indexing: Uses Tree-sitter to genuinely parse code, indexing identifiers while ignoring keywords and noise; the index persists across sessions, supports incremental updates (only re-indexing changed files), and automatically cleans up excluded files.
- Three search modes: exact (identifiers), semantic (concepts), and hybrid (RRF fusion). Semantic mode uses local embeddings to uniformly rank code, documentation, and workspace entries; an optional LLM layer can, after configuring Anthropic / OpenAI / OpenRouter / Ollama / HuggingFace API keys, translate non-English queries, expand fuzzy queries, and rerank candidate results. The privacy switch llm_send_code is disabled by default and sends only queries and metadata.
- Time filtering: Supports modified_since and modified_before, in formats such as 30m, 2h, 1d, 1w, or ISO dates, making it easy to find "changes in the last hour."
- Memory and tasks: Notes, tasks, and session notes persist across sessions; tasks support priority, status, tags, history logs, due dates, and recurrence intervals; each aidex_session call checks overdue tasks across all projects.
- Cross-project querying: After global initialization, it can search across all indexed projects, automatically skipping parent projects that contain subprojects, with results cached in memory for 5 minutes.
- Log Hub: Any program can send logs via HTTP POST, AI queries through MCP, and the Viewer displays them in real time via WebSocket; supports level filtering, a ring buffer (10,000 entries by default), optional SQLite persistence, and automatic cleanup after 7 days.
- Screenshot and window tools: Supports full-screen, active window, and specified-title window screenshots, can scale and reduce color count to fit LLMs.
- Global guidelines: Stores cross-project coding conventions, review checklists, release checklists, and AI instructions in ~/.aidex/global.db.
[Usage] Requires Node.js ≥ 20. Global installation: npm install -g aidex-mcp. After installation, setup runs automatically, detects installed AI clients and registers the MCP server, and also writes usage instructions to ~/.claude/CLAUDE.md, ~/.gemini/GEMINI.md, etc. You can manually run aidex setup / aidex unsetup, or set AIDEX_NO_SETUP=1 to skip. You can also manually configure the MCP server in clients such as Claude Code, Claude Desktop, Gemini CLI, and VS Code Copilot; it is recommended to use "aidex" as the server name to get tool prefixes such as aidex_query, aidex_signature, etc. Then have the AI run aidex_init to index the project, and then use aidex_query, aidex_signature, etc. to query. Officially provides 33 tools.
[Applicable scenarios] Quickly locate definitions and usages in large codebases; reduce wasted AI context; retain tasks and notes across sessions; search uniformly across multiple repositories; let AI observe program runtime logs; provide AI with team conventions and review checklists.
[Limitations] Semantic search and the LLM layer require local embeddings or an optional API key (the latter is optional; pure embeddings can work offline). Log Hub is fire-and-forget; if the server is not running, POST will fail silently. Cross-project queries are limited by the SQLite ATTACH count (processed in batches of 8). Currently supports 14 languages: C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby, HCL/Terraform, Kotlin, Swift, plus Astro frontmatter.