System Design
How Devscriptor Works
High-performance code analysis platform built in Rust with 26 tree-sitter grammars, 75 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.27 grammars
MCP Tools total: 32 Core + 38 LSP + 5 Architecture
LSP Detection system with automatic language server discovery
Module Architecture
Four crates organized by responsibility, built into the one devscriptor executable.
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
Pure-Rust ONNX inference (tract) — one shared model, RAM-aware concurrency, no API keys
LSP Module
Language Server Protocol integration with 4-tier server detection.
A configuration file → Devscriptor’s installs → the system → editor extensions
Lazy or eager start, idle stop, a cap on running servers, crash restarts
38 LSP + 5 architecture tools exposed via MCP
Pre-configured language server definitions
MCP Module
One Model Context Protocol server per workspace with 75 tools, shared by every agent working there.
Scan, search, analyze, context, and the real-time watcher
Navigation, completion, diagnostics, refactoring
LSP detection, prerequisite checks, setup
devscriptor mcp relays its stdio to devscriptor serve over a local socket (a named pipe on Windows): one index, watcher, model and set of language servers — no network port
An answer waits for the watcher, then re-indexes the changed files it names, waiting up to 250 ms
CLI Module
Command-line interface for direct codebase interaction.
Scan directories and build the database
Execute analyzers and generate reports
Load the model, embed the index, unload the model
Set up, detect and check servers; trust a project’s server configuration
The stdio proxy agents start, and the workspace’s shared server
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
~1.3 GB freed immediately after embedding completes
Technology Stack
Carefully chosen technologies for performance, reliability, and maintainability.
Parsing
- tree-sitter 0.27
- 26 grammars (27 with TSX)
- Memory-mapped file reading
Database
- rusqlite 0.41 (bundled SQLite 3.54)
- sqlite-vec 0.1.9 — FLOAT[768]
- FTS5 code-aware tokenizer
- r2d2 0.8 connection pool
Embeddings
- jinaai/jina-embeddings-v2-base-code
- tract-onnx 0.23 (pure-Rust ONNX inference)
- Shared model, RAM-aware concurrency, no API keys
Async Runtime
- Tokio 1.x
- ignore 0.4 (ripgrep engine)
- reqwest 0.13 with rustls (model + LSP downloads)
MCP Protocol
- rmcp SDK 3.9
- JSON-RPC over stdio
- One shared server per workspace
LSP Integration
- 21 language servers
- 4-tier detection
- Checksum-verified installs, when asked
Crate Structure
Visual representation of how the crates interact and depend on each other.
Claude Desktop, Cursor, Cline, etc.
Unified MCP Server · 75 Tools · stdio
Parsing · Analysis · Storage
LSP Client · 21 Servers
Commands · Interface