Skip to content

ManSio/mscodebase-intelligence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

463 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MSCodeBase Banner

πŸ‡¬πŸ‡§ English β€’ πŸ‡·πŸ‡Ί Русский β€’ πŸ‡¨πŸ‡³ δΈ­ζ–‡

MSCodebase Intelligence

AI-powered semantic code search for Zed IDE β€” deep code analysis MCP server

Python 3.10+ License: MIT MCP Zed Tests

Features β€’ Quick Start β€’ Tools β€’ Documentation β€’ Installation β€’ Architecture β€’ Contributing β€’ Security

Last updated: 2026-07-12


🎯 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:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Zed IDE                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚        LSP (built-in autocomplete,           β”‚  β”‚
β”‚  β”‚        inline hints, diagnostics)            β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                        β”‚                              β”‚
β”‚                        β–Ό                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  MSCodeBase (MCP server)                     β”‚  β”‚
β”‚  β”‚  Β· Semantic search across the codebase       β”‚  β”‚
β”‚  β”‚  Β· Call graph & impact analysis              β”‚  β”‚
β”‚  β”‚  Β· Project memory (ADR, tech debt)           β”‚  β”‚
β”‚  β”‚  Β· Self-diagnostics and self-healing         β”‚  β”‚
β”‚  β”‚  Β· 59 tools for AI assistant                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

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) βœ… ❌
✏️ Inline autocomplete ❌ βœ…
🏷️ Inlay hints ❌ βœ…

LSP: Hybrid Rename Only

MSCodeBase uses LSP only for rename_symbol β€” 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 59 MCP tools.

The standalone LSP server (src/lsp_main.py) was experimental and does not work in Zed β€” 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 βœ… βœ… βœ…

✨ Features

Feature Description
πŸ” Unified Search search_code(query, mode, intent_hint) β€” single tool: fast/quality/deep/context/ask/auto
🧠 Intelligence Layer 14 high-level intel_* tools: self-diagnostics, topology, memory, error prediction
πŸ—ƒοΈ Project Memory ADR, known issues, tech debt β€” automatically persisted between sessions
🌐 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 (15+ services), 59 tools (41 class-based + 15 intel + 3 diag), 494+ tests
πŸͺŸ Multi-Window ProjectIndexerRegistry β€” isolated Indexer per project, LRU 5, ResourceMonitor throttle
✏️ Write Tools 6 write tools + 1 graph query (query_graph) with Cypher engine
⚑ 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). 3,337 edges on MSCodeBase (81% conditional).
βš™οΈ SYSTEM_PROFILE light (sync) / server (async with phi-4)

πŸš€ Quick Start

Install the mscodebase-intelligence extension in Zed, then:

cd D:\Project\MSCodeBase
python install.py

# Restart Zed (File β†’ Quit β†’ reopen)
# Verify: intel_get_runtime_status()

install.py does:

  1. Copies 39+ source files to the extension directory
  2. Installs Python dependencies
  3. Downloads llama-server.exe + GGUF models (E5-base embed + reranker)
  4. Configures MCP in Zed's settings.json

See also: AI_INSTALLATION_PROMPT.md, docs/en/INSTALL.md

Providers

MCP auto-selects the best available provider:

llama.cpp GGUF (GPU) β†’ ONNX Runtime (CPU) β†’ LM Studio (if running) β†’ BM25 only
   ~1.0 GB RAM           ~1.7 GB RAM          ~6 GB RAM             no embeddings
   2Γ— llama-server       in-process ONNX       external API

Benchmarks: docs/research/2026-07-10-final-benchmark.md


πŸ“š Documentation Map

Document Description Audience Languages
docs/en/INSTALL.md Installation, setup, uninstall Users πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/ARCHITECTURE.md Clean Architecture, Layers, DI Developers πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/ARCHITECTURE_DEEP.md Deep architecture: pipeline, lifecycle, comparison Architects πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/SEARCH_PIPELINE.md Search pipeline: BM25 β†’ RRF β†’ Reranker Developers πŸ‡¬πŸ‡§
docs/en/GRACEFUL_DEGRADATION.md 5 levels of graceful degradation (llama.cpp β†’ ONNX β†’ BM25) DevOps πŸ‡¬πŸ‡§
docs/en/ARCHITECTURE_LAYERS.md 10 runtime layers Architects πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/FAQ.md Frequently Asked Questions All πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/TELEMETRY.md Metrics, ETA, data collection DevOps πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/investigations/ONNX_SESSION_REPORT.md Full ONNX migration, 7 fixes, benchmarks Support πŸ‡¬πŸ‡§
docs/en/investigations/LSP_WONTFIX.md LSP on Windows investigation (WONTFIX) Support πŸ‡¬πŸ‡§ πŸ‡¨πŸ‡³
docs/en/ZED_WINDOWS_QUIRKS.md Windows specifics, Restricted Mode Windows users πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/CHANGELOG.md Version history All πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/CONTRIBUTING.md How to contribute, PRs Contributors πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
docs/en/SECURITY.md Security policy, vulnerabilities Security πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡¨πŸ‡³
AGENTS.md AI Agent system rules AI Agent πŸ‡¬πŸ‡§
SECURITY.md Security policy, reporting vulnerabilities Security πŸ‡¬πŸ‡§
CODE_OF_CONDUCT.md Community standards Contributors πŸ‡¬πŸ‡§

| docs/KNOWN_ISSUES.md | Known issues & technical debt registry | All | πŸ‡¬πŸ‡§ |

All documents are cross-referenced. Available in 3 languages: English, Русский, δΈ­ζ–‡.


πŸ”§ MCP Tools (59 total)

Core Search

Tool When to Use
search_code(query, mode, filter_layer, intent_hint) Main search tool. mode="auto" / "fast" / "quality" / "deep" / "context" / "ask". intent_hint="code" / "docs" / "auto" β€” soft bucket weighting. filter_layer="core" β€” search within specific architecture layer
structural_search(pattern) AST search: class_inheritance, async_function, function_with_decorator and more
cross_repo_search(query @repo) Search across multiple projects (mono-repo)
cross_project_deps(action) Cross-project dependency graph: graph / deps / cycles / impact
get_symbol_info(query) Call Graph: callers, callees, impact files
impact_analysis(symbol) Symbol change impact analysis (risk score, depth)

Index Management

Tool When to Use
get_index_status() Index status: chunks, files, symbols
get_index_progress() Indexing progress (phase, percent)
index_project_dir(path) Start full project indexing
get_index_timeline() Indexing history by date
index_health(project_root) Index diagnostics and self-recovery
notify_change(file_path) Force index update for a file (via DebounceBatch)
generate_chunk_summaries(root) LLM-generated descriptions for code chunks
scan_changes(project_root) Architectural diff β€” analyze changes since last baseline

System & Diagnostics

Tool When to Use
get_health_report() Full self-diagnosis: index, embedder, logs, synchronization
watcher_status() Component status: embedder mode, indexing, health
get_logs(project_root) Latest errors and warnings from project logs
get_repo_map(project_root) Project map: file tree + key symbols
read_live_file(path) Read file from LSP memory (including unsaved changes)
predict_eta(operation) Predict operation duration based on history
run_health_check() Full project health check (tests + git + index)

Analytics

Tool When to Use
get_hotspots(project_root) Hotspots β€” files with high bug rate
get_repo_rank(project_root, top_k) Symbol importance ranking (PageRank on call graph)
get_bug_correlation(project_root) Bug-change correlation analysis
get_related_files(project_root, path) Files related via co-change / bug correlation
graph_query(query_type, target) Knowledge graph queries: impact / feature / deps / tests
query_graph(query) (new v3.2) Cypher-like graph queries: MATCH (f:Function)-[:CALLS]->(g) WHERE f.name = 'main' RETURN g.name
find_similar_bugs(error) Find similar bugs from history by error text

Git & History

Tool When to Use
get_commit_history(root, limit) Semantic commit history
get_file_history(root, path) Change history for a specific file
get_branch_info(project_root) Branch info + index status

Lifecycle & Verification

Tool When to Use
submit_background_task(type, root) Run long tasks: bug_correlation / build_knowledge_graph / full_analysis
get_task_status(task_id) Background task status
verify_action(action_type) Verification: file_write / git_commit / git_push / index_sync

Write Tools (7)

Tool When to Use
rename_symbol(old, new, apply) Rename symbol across all files (preview/apply, collision check)
move_symbol(symbol, to_file, apply) Move symbol to another file (preview/apply, import updates)
safe_delete(symbol, force, apply) Safe delete with reference check (force mode)
replace_symbol(symbol, new_code, apply) Replace function/class body (preview/apply)
insert_before_symbol(anchor, new_code, apply) Insert code before anchor symbol (preview/apply)
insert_after_symbol(anchor, new_code, apply) Insert code after anchor's body (preview/apply)
ack_impact(file_path) Acknowledge impact for modification guard

Intelligence Layer (intel_*) β€” 14 High-Level Tools

Tool What it does
intel_get_runtime_status() Aggregated health status: embedder, index, resource usage
intel_trigger_reindex() Fire-and-forget reindexing (does not block Zed)
intel_get_job_status(job_id) Background task progress
intel_code_topology(symbol) Call graph + module topology (< 2 sec)
intel_get_project_memory() Project memory map: ADR, known_issues, tech_debt
intel_log_incident(...) Log an incident to project history
intel_analyze_incident(error) Find similar incidents + ready-made solutions
intel_add_memory_node(section, data) Add a record to project memory
intel_get_hotspots() Top-5 files with highest bug load
intel_predict_root_cause(error) Predict root cause from logs + history
intel_get_telemetry(days) Per-tool telemetry, resource usage, LLM stats
intel_tool_health() Tool success rates, latency, confidence
intel_explain_project_state(root) Human-readable project state diagnosis
intel_get_project_context(root) Single snapshot: state, index, health, memory

Diagnostic Tools (3)

Tool What it does
debug_runtime_passport() Process passport: RUN_ID, PID, build info
get_runtime_counters() Runtime counters: calls, blocks, warnings
intel_execution_timeline(limit) Recent action timeline with durations

πŸ—οΈ Architecture

Clean Architecture with DI Container

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   MCP Server (~220 lines)                        β”‚
β”‚            src/mcp/server.py β€” registration only                β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚              DI Container (15 services)                   β”‚   β”‚
β”‚  β”‚  src/core/di_container.py β€” ServiceCollection              β”‚   β”‚
β”‚  β”‚                                                           β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚ Indexer  β”‚  β”‚  Searcher  β”‚  β”‚  DebounceBatch       β”‚  β”‚   β”‚
β”‚  β”‚  β”‚ Embedder β”‚  β”‚  SymbolIdx β”‚  β”‚  CircuitBreaker      β”‚  β”‚   β”‚
β”‚  β”‚  β”‚ Parser   β”‚  β”‚  FileGuard β”‚  β”‚  RateLimiter         β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                           β”‚                                       β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                         β”‚
β”‚              β–Ό                          β–Ό                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  41 Tool Classes   β”‚  β”‚  14 intel_* tools + 3 diag      β”‚
β”‚  β”‚  src/mcp/tools/*.py β”‚  β”‚  src/core/intelligence_layer.py    β”‚  β”‚
β”‚  β”‚  One class per tool  β”‚  β”‚  error_boundary decorator          β”‚
β”‚  β”‚  Constructor Inj.   β”‚  β”‚  JSON status/message/detail        β”‚  β”‚
β”‚  β”‚  Constructor Inj.   β”‚  β”‚  asyncio.wait_for(timeout)        β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  RemoteEmbedder  β”‚     β”‚  LanceDB v2       β”‚
β”‚  (LM Studio /    β”‚     β”‚  (Vector DB)       β”‚
β”‚   Ollama / ONNX) β”‚     β”‚  BM25 + Vector    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚑ Performance

Mode Latency Best For
search_code(query, mode="fast") ~300ms Simple keyword / exact name
search_code(query, mode="quality") ~1200ms Semantic search with reranker
search_code(query, mode="deep") ~2-5s Complex research across modules
search_code(query, mode="context") ~500ms Find similar code by fragment
cross_repo_search(query @repo) ~500ms-2s Cross-project search

Environment Variables

Variable Default Description
LM_STUDIO_URL http://localhost:1234/v1 LM Studio API endpoint
LM_STUDIO_PORT 1234 LM Studio port
OLLAMA_URL http://localhost:11434 Ollama API endpoint
LOG_LEVEL INFO Logging verbosity level
ZED_WINDOWS_QUIRKS.md (see file) Windows-specific instructions

πŸ”§ Troubleshooting

MCP Server Not Responding

Symptoms: tools timeout, no response.

Checklist:

  1. File β†’ Quit β†’ reopen the project
  2. Run python install.py to reconfigure
  3. Check logs: %LOCALAPPDATA%\Zed\extensions\mscodebase-intelligence\.codebase_indices\logs\

Index Empty (0 chunks)

Run in Agent Panel:

intel_trigger_reindex()

Then verify: get_index_status()

LM Studio Connection Issues

# Verify the server responds:
python -c "import urllib.request; print(urllib.request.urlopen('http://localhost:1234/v1/health').read())"

Expected: {"status":"ok"}.


πŸ“ Project Structure

mscodebase-intelligence/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.py                   # MCP server entry point (~220 lines)
β”‚   β”œβ”€β”€ lsp_main.py               # LSP server (DI-based, for didSave indexing)
β”‚   β”œβ”€β”€ mcp/
β”‚   β”‚   β”œβ”€β”€ server.py             # DI routing β€” only imports + registration
β”‚   β”‚   β”œβ”€β”€ write_tools.py        # rename/move/delete/replace/insert symbols
β”‚   └── tools/                 # 11 files, 41 class-based tools
β”‚   β”‚       β”œβ”€β”€ search_tools.py   # search_code, get_symbol_info, impact_analysis
β”‚   β”‚       β”œβ”€β”€ indexing_tools.py # notify_change, index_project_dir, index_health
β”‚   β”‚       β”œβ”€β”€ git_tools.py      # get_branch_info, get_commit_history
β”‚   β”‚       β”œβ”€β”€ system_tools.py   # get_index_status, watcher_status, read_live_file
β”‚   β”‚       β”œβ”€β”€ analysis_tools.py # structural_search, get_repo_map, scan_changes
β”‚   β”‚       β”œβ”€β”€ graph_tools.py    # cross_repo_search, graph_query, get_related_files
β”‚   β”‚       β”œβ”€β”€ investigation_tools.py  # get_bug_correlation, get_hotspots
β”‚   β”‚       └── lifecycle_tools.py      # submit_background_task, verify_action
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ di_container.py       # β˜… DI Container (15 services, ServiceCollection)
β”‚   β”‚   β”œβ”€β”€ error_handler.py      # β˜… error_boundary + ToolError
β”‚   β”‚   β”œβ”€β”€ rate_limiter.py       # β˜… SlidingWindowRateLimiter + DebounceBatch + CircuitBreaker
β”‚   β”‚   β”œβ”€β”€ indexer.py            # LanceDB vector storage
β”‚   β”‚   β”œβ”€β”€ searcher.py           # Hybrid search (BM25 + Dense + RRF)
β”‚   β”‚   β”œβ”€β”€ symbol_index.py       # Call Graph (BFS, impact analysis)
β”‚   β”‚   β”œβ”€β”€ intelligence_layer.py # intel_* tools (14 high-level)
β”‚   β”‚   β”œβ”€β”€ llama_runner.py       # llama.cpp lifecycle manager β˜…
β”‚   β”‚   β”œβ”€β”€ remote_embedder.py    # LM Studio / Ollama / llama.cpp / ONNX client
β”‚   β”‚   β”œβ”€β”€ reranker.py           # Multi-Provider Reranker (HTTP to providers)
β”‚   β”‚   β”œβ”€β”€ parser.py             # Tree-sitter AST
β”‚   β”‚   β”œβ”€β”€ health_report.py      # Self-diagnosis engine
β”‚   β”‚   β”œβ”€β”€ lsp_client.py          # Thin LSP client (pyright JSON-RPC 2.0)
β”‚   β”‚   β”œβ”€β”€ modification_guard.py  # @modification_guard decorator (ack + TTL)
β”‚   β”‚   └── ...
β”‚   └── utils/
β”‚       β”œβ”€β”€ paths.py              # SafePathManager, to_win_long_path
β”‚       └── zed_config.py         # Auto-configure Zed settings
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ en/               # English docs
β”‚   β”œβ”€β”€ ru/               # Russian docs
β”‚   └── zh/               # Chinese docs
β”œβ”€β”€ tests/                        # 494 tests (pytest)
β”œβ”€β”€ .agents/skills/               # Skills for AI agent
β”œβ”€β”€ install.py                    # Installer
└── README.md

πŸ› οΈ Development

See docs/en/CONTRIBUTING.md for:

  • How to add new MCP tools
  • Test structure and CI pipeline
  • Commit message conventions

Quick Start for Devs

# Setup
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

# Run MCP server directly (test)
python -m src.main

# Run tests
pytest tests/ -m "not integration and not benchmark"

πŸ“„ License

MIT License β€” see LICENSE for details.


πŸ™ Acknowledgments

About

High-performance, memory-safe, and native async Python MCP server for Zed IDE on Windows. Features multi-bucket RAG, hybrid LanceDB/BM25 search, dynamic re-ranking, and O(1) status caching.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages