System Design
How Devscriptor Works
High-performance code analysis platform built in Rust with 26 tree-sitter grammars, 74 MCP tools, and 4-tier LSP detection.
System at a Glance
A modular architecture built for performance, extensibility, and broad language support.
High-performance implementation with memory safety and zero-cost abstractions
Languages & frameworks via tree-sitter 0.25 grammars
MCP Tools total: 31 Core + 38 LSP + 5 Architecture
LSP Detection system with automatic language server discovery
Module Architecture
Four primary crates organized by responsibility. Each module can be used independently or together.
Core Module
The heart of Devscriptor. Handles parsing, analysis, storage, and embeddings.
Dedicated grammar per language for accurate AST extraction
Parallel, gitignore-aware discovery (ripgrep engine)
Fast-path re-scans of only the files that changed
Single-file graph with FTS5 keyword and sqlite-vec search
Code-smell, cross-reference and call-graph analysis
Local ONNX inference, multi-session pool, no API keys
LSP Module
Language Server Protocol integration with 4-tier server detection.
User config → Devscriptor-managed → System → VS Code extensions
Start, stop, and monitor language servers
38 LSP + 5 architecture tools exposed via MCP
Pre-configured language server definitions
MCP Module
Unified Model Context Protocol server with 74 total tools, over stdio.
Scan, search, analyze, context, and the real-time watcher
Navigation, completion, diagnostics, refactoring
LSP detection, prerequisite checks, setup
devscriptor mcp and the devscriptor-mcp entry point
CLI Module
Command-line interface for direct codebase interaction.
Scan directories and build the database
Execute analyzers and generate reports
Start servers, check status, run diagnostics
How Data Flows
Understanding the journey from source code to AI-accessible knowledge.
Codebase Scanning Flow
File Discovery
Parallel, gitignore-aware walk via the ignore crate
Incremental Filtering
mtime+size fast-path, then XXH3 hash — skip unchanged files
Parallel Parsing
26 tree-sitter grammars extract the AST per file
Entity Extraction
Functions, classes, structs, enums, components identified
Relationship Extraction
Calls, inherits, implements, uses — including cross-file
SQLite Storage
Graph + FTS5 index persisted to a single database file
Optional Embedding
devscriptor embed loads ONNX, writes 768-d vectors, unloads
Model Unloaded
~760 MB freed immediately after embedding completes
Technology Stack
Carefully chosen technologies for performance, reliability, and maintainability.
Parsing
- tree-sitter 0.25
- 26 grammars (27 with TSX)
- Memory-mapped file reading
Database
- SQLite (rusqlite 3.45+)
- sqlite-vec 0.1.9 — FLOAT[768]
- FTS5 code-aware tokenizer
- r2d2 connection pool
Embeddings
- jinaai/jina-embeddings-v2-base-code
- fastembed / ONNX Runtime 5.13
- Multi-session pool, no API keys
Async Runtime
- Tokio 1.x
- ignore 0.4 (ripgrep engine)
- reqwest 0.12 (LSP install)
MCP Protocol
- rmcp SDK
- JSON-RPC over stdio
- devscriptor-mcp entry point
LSP Integration
- 21 language servers
- 4-tier detection
- On-demand, checksum-verified install
Crate Structure
Visual representation of how the crates interact and depend on each other.
Claude Desktop, Cursor, Cline, etc.
Unified MCP Server · 74 Tools · stdio
Parsing · Analysis · Storage
LSP Client · 21 Servers
Commands · Interface