Architecture

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.

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.27 grammars

75

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

4-Tier

LSP Detection system with automatic language server discovery

Modules

Module Architecture

Four crates organized by responsibility, built into the one devscriptor executable.

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)

Pure-Rust ONNX inference (tract) — one shared model, RAM-aware concurrency, no API keys

crates/lsp

LSP Module

Language Server Protocol integration with 4-tier server detection.

4-Tier DetectionPriority resolution

A configuration file → Devscriptor’s installs → the system → editor extensions

Server ManagerLifecycle control

Lazy or eager start, idle stop, a cap on running servers, crash restarts

MCP BridgeTool exposure

38 LSP + 5 architecture tools exposed via MCP

Registry21 Servers

Pre-configured language server definitions

crates/mcp

MCP Module

One Model Context Protocol server per workspace with 75 tools, shared by every agent working there.

Core Tools32 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

Shared ServerOne per workspace

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

Freshness CheckAt query time

An answer waits for the watcher, then re-indexes the changed files it names, waiting up to 250 ms

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

embedSemantic vectors

Load the model, embed the index, unload the model

lspLSP operations

Set up, detect and check servers; trust a project’s server configuration

mcp · serveMCP server

The stdio proxy agents start, and the workspace’s shared server

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

~1.3 GB freed immediately after embedding completes

Stack

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
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 · 75 Tools · stdio

crates/core

Parsing · Analysis · Storage

crates/lsp

LSP Client · 21 Servers

crates/cli

Commands · Interface

tree-sitter
SQLite
Jina Embeddings
LSP Servers