Intelligent codebase search & indexing for Zed. Async MCP server featuring LanceDB/BM25 hybrid search, multi-bucket RAG, and autonomous self-healing workflows. High-performance, memory-safe, and ready for your production code.
🇬🇧 English • 🇷🇺 Русский • 🇨🇳 中文
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
MSCodebase Intelligence
**AI-powered semantic code search for Zed IDE — deep code analysis MCP server**
Features • Quick Start • Tools • Documentation • Installation • Architecture • Contributing • Security
*Last updated: 2026-09-23*
---
🎯 Positioning
**MSCodeBase Intelligence** is an MCP server for **Zed IDE** that gives AI assistants **deep understanding of the entire codebase**: semantic search, call graph, project memory, diagnostics.
This is **not** an LSP server or a replacement for the editor's built-in autocomplete. It's a "code intelligence" layer on top of the editor:
What you get
| Feature | MSCodeBase | Standard LSP (pyright/pylsp) |
|---------|:----------:|:---------------------------:|
| 🔍 **Semantic search** (BM25 + Vector + Reranker) | ✅ | ❌ |
| 🧠 **Call graph + impact analysis** | ✅ | ❌ |
| 🗃️ **Project memory** (ADR, known issues) | ✅ | ❌ |
| 🏥 **Self-diagnosis + self-healing** | ✅ | ❌ |
| 🔎 **Cross-repo search** | ✅ | ❌ |
| 🤖 **RAG answer generation** (mode=ask) | ✅ | ❌ |
| 🔬 **Search explainability** (per-stage score trace) | ✅ | ❌ |
| 🏛️ **Architecture drift detection** (chain/circular/hub) | ✅ | ❌ |
| ✅ **Claim verification** (agent fact-checking vs code) | ✅ | ❌ |
| ✏️ **Inline autocomplete** | ❌ | ✅ |
| 🏷️ **Inlay hints** | ❌ | ✅ |
LSP: Hybrid Rename Only
MSCodeBase **uses LSP only for codebase(action="rename")** — the LSP client (src/core/lsp_client.py) spawns **pyright-langserver** for precise cross-file rename, with graceful fallback to SymbolIndex (Tree-sitter) on timeout. All other functionality is implemented through **65 MCP tools**.
The standalone LSP server (src/lsp_main.py) was **removed** — see LSP_WONTFIX.md.
Platforms
Designed and tested on **Windows**. macOS and Linux should work but have not been validated officially.
Languages
| Language | Parsing | Call Graph | Data Flow (ASSIGNED_FROM) |
|---|---|---|---|
| **Python** | ✅ | ✅ | ✅ |
| **TypeScript** | ✅ | ✅ | ✅ |
| **TSX** | ✅ | ✅ | ✅ |
| **Rust** | ✅ | ✅ | ✅ |
| **Go** | ✅ | ✅ | ✅ |
| **JavaScript** | ✅ | ✅ | ✅ |
| **Java** | ✅ | ✅ | ✅ |
| **C#** | ✅ | ✅ | ✅ |
| **Ruby** | ✅ | ✅ | ✅ |
| **PHP** | ✅ | ✅ | ✅ |
| **Kotlin** | ✅ | ✅ | ✅ |
| **Swift** | ✅ | ✅ | ✅ |
| **C** | ✅ | ✅ | ✅ |
| **C++** | ✅ | ✅ | ✅ |
| **Scala** | ✅ | ✅ | ✅ |
| **Dart** | ✅ | ✅ | ✅ |
| **Shell / Bash** | ✅ | ✅ | ❌ (grammar without RHS-field) |
| **SQL** | ✅ (context) | ❌ | ❌ |
| **YAML** | ✅ (context) | ❌ | ❌ |
| **TOML** | ✅ (context) | ❌ | ❌ |
| **HTML** | ✅ (context) | ❌ | ❌ |
| **CSS** | ✅ (context) | ❌ | ❌ |
| **HCL / Terraform** | ✅ (context) | ❌ | ❌ |
✨ Features
| Feature | Description |
|---------|-------------|
| 🔍 **Unified Search** | search_code(query, mode, intent_hint) — single tool: fast/quality/deep/context/ask/auto |
| 🧠 **Intelligence Layer** | 16 high-level intel_* tools: self-diagnostics, topology, memory, error prediction |
| 🌐 **Cross-repo Search** | Search across multiple projects with @mention syntax |
| 🌳 **Call Graph** | Full call graph: definition + callers + callees + impact analysis |
| 🏗 **Structural Search** | 13 AST patterns (class_inheritance, async_function, decorator, etc.) |
| 🔎 **Context Search** | Find similar code — paste a fragment, get semantic duplicates |
| 🪣 **Multi-Bucket RAG** | Code/docs buckets, soft weighting, intent_hint (code/docs/auto) |
| 🤖 **mode=ask** | RAG answer generation via phi-4 (server profile) |
| 💾 **LanceDB v2** | Vector DB with per-project isolation (incremental BM25 reindex) |
| 🛡 **Rate Limiting** | DebounceBatch + CircuitBreaker — protection against VFS loops |
| 🏥 **Self-Diagnosis** | get_health_report + index_health — full check and recovery |
| 🧪 **Clean Architecture** | DI Container (14 services), 65 tools (32 core + 16 intel + 13 inline + 4 dev), 2007 tests |
| 🪟 **Multi-Window** | ProjectIndexerRegistry — isolated Indexer per project, LRU 5, ResourceMonitor throttle |
| ✏️ **Write Tools** | codebase(action=...) — unified hub: rename, move, delete, replace, insert, ack |
| ⚡ **Meta-Patching** | LanceDB move_chunks_metadata — file_path rename without re-embedding (50ms vs 5s) |
| 🔗 **Data Flow Graph** | ASSIGNED_FROM edges track variable assignments. Unified Walker + Conditional Flow (if/for/while/try). 29 edge types in PropertyGraph. |