Architecture

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.

Overview

System at a Glance

A modular architecture built for performance, extensibility, and broad language support.

Rust

High-performance implementation with memory safety and zero-cost abstractions

26

Languages & frameworks via tree-sitter 0.25 grammars

74

MCP Tools total: 31 Core + 38 LSP + 5 Architecture

4-Tier

LSP Detection system with automatic language server discovery

Modules

Module Architecture

Four primary crates organized by responsibility. Each module can be used independently or together.

crates/core

Core Module

The heart of Devscriptor. Handles parsing, analysis, storage, and embeddings.

Parser26 Tree-sitter Grammars

Dedicated grammar per language for accurate AST extraction

File Scannerignore crate

Parallel, gitignore-aware discovery (ripgrep engine)

Incrementalmtime+size+XXH3

Fast-path re-scans of only the files that changed

DatabaseSQLite + FTS5 + vec0

Single-file graph with FTS5 keyword and sqlite-vec search

Analysis EngineDead code · complexity · clones

Code-smell, cross-reference and call-graph analysis

EmbeddingsJina v2 Base Code (768-d)

Local ONNX inference, multi-session pool, no API keys

crates/lsp

LSP Module

Language Server Protocol integration with 4-tier server detection.

4-Tier DetectionPriority resolution

User config → Devscriptor-managed → System → VS Code extensions

Server ManagerLifecycle control

Start, stop, and monitor language servers

MCP BridgeTool exposure

38 LSP + 5 architecture tools exposed via MCP

Registry21 Servers

Pre-configured language server definitions

crates/mcp

MCP Module

Unified Model Context Protocol server with 74 total tools, over stdio.

Core Tools31 Tools

Scan, search, analyze, context, and the real-time watcher

LSP Tools38 Tools

Navigation, completion, diagnostics, refactoring

Architecture Tools5 Tools

LSP detection, prerequisite checks, setup

rmcp SDKJSON-RPC over stdio

devscriptor mcp and the devscriptor-mcp entry point

crates/cli

CLI Module

Command-line interface for direct codebase interaction.

scanBuild code graph

Scan directories and build the database

analyzeRun analysis

Execute analyzers and generate reports

lspLSP operations

Start servers, check status, run diagnostics

Data Flow

How Data Flows

Understanding the journey from source code to AI-accessible knowledge.

Codebase Scanning Flow

1

File Discovery

Parallel, gitignore-aware walk via the ignore crate

2

Incremental Filtering

mtime+size fast-path, then XXH3 hash — skip unchanged files

3

Parallel Parsing

26 tree-sitter grammars extract the AST per file

4

Entity Extraction

Functions, classes, structs, enums, components identified

5

Relationship Extraction

Calls, inherits, implements, uses — including cross-file

6

SQLite Storage

Graph + FTS5 index persisted to a single database file

7

Optional Embedding

devscriptor embed loads ONNX, writes 768-d vectors, unloads

8

Model Unloaded

~760 MB freed immediately after embedding completes

Stack

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
Structure

Crate Structure

Visual representation of how the crates interact and depend on each other.

MCP Clients

Claude Desktop, Cursor, Cline, etc.

crates/mcp

Unified MCP Server · 74 Tools · stdio

crates/core

Parsing · Analysis · Storage

crates/lsp

LSP Client · 21 Servers

crates/cli

Commands · Interface

tree-sitter
SQLite
Jina Embeddings
LSP Servers