Narsil-MCP alternative: trace-mcp vs Narsil-MCP

TL;DR. Narsil-MCP is a Rust-based code intelligence MCP server that organizes codebase knowledge into a 4-layer Code Context Graph (CCG) stored in an oxigraph SPARQL/RDF triple store with tantivy LZ4 full-text search. It exposes 90 specialized MCP tools across 4 presets, features an embedded Axum HTTP server with a React visualization SPA, and provides 147 syntactic security rules.

The fundamental architectural differences center on query ergonomics, framework semantics, refactoring capabilities, and security grounding. Narsil-MCP exposes raw SPARQL queries against RDF triples, which introduces significant syntax and hallucination overhead for LLM agents; trace-mcp provides deterministic, strongly typed MCP tools (get_callers, get_change_impact, find_usages). Narsil-MCP extracts syntax for 32 languages without framework models; trace-mcp builds typed semantic edges across 88 frameworks (connecting HTTP routes to handlers, controllers to templates, and ORM models to tables). Narsil-MCP is strictly read-only with zero refactoring write tools and zero session memory; trace-mcp provides atomic AST-verified refactoring write tools (refactor_rename, refactor_extract, refactor_move, refactor_codemod) and code-linked decision memory with staleness verification.

Pick Narsil-MCP if you need formal RDF/SPARQL knowledge graph querying, want a self-contained embedded React web UI for visual exploration, or prefer a compiled Rust standalone binary. Pick trace-mcp if you develop web applications in modern frameworks, require calibrated 5-tier call graphs, need safe AST refactoring write tools, and want zero-setup execution via npm.

Head-to-head

Capability trace-mcp Narsil-MCP
GitHub stars 175 183
License MIT (permissive open-source) MIT OR Apache-2.0 (dual permissive)
Written in TypeScript (Node.js) Rust (edition 2021)
Installation / Distribution npx -y trace-mcp@latest (npm registry) cargo install narsil-mcp / GitHub release binaries
Underlying storage Embedded SQLite + FTS5 + local ONNX oxigraph (SPARQL/RDF) + tantivy (LZ4) + postcard
Graph specification 5-tier directed code graph (SQLite WAL) Code Context Graph (CCG) v0.2 spec (4 RDF layers)
Languages (AST parsing) 81 (tree-sitter WASM) 32 (tree-sitter native)
Framework integrations 88 semantic integrations ✗ (syntax AST only, no framework semantics)
Framework-aware edges ✓ route → handler, middleware, template, ORM
MCP tools defined 182 tools 90 tools (11 categories)
Default advertised tools 29 (~11.6K tok, task presets) 20-30 (minimal) up to 70+ (full)
Tool surface management Task presets (minimal, review, architecture, dev) + load_tools 4 presets (minimal, balanced, full, security-focused)
Call graph resolution 5-tier resolution (compiler_verified to fuzzy) with calibrated confidence Graph traversal over AST call sites (--call-graph flag)
Refactoring capability ✓ AST-native safe transforms (rename, extract, move, codemods) ✗ (analysis-only, zero refactoring write tools)
Security scanning ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 ✓ 147 rules (regex-pattern taint matching, OSV/SBOM)
Session memory ✓ code-linked decision graph with staleness checks ✗ (stateless across turns, no decision memory)
Graph visualization Desktop app (cosmos.gl, offscreen headless safe) Embedded Axum HTTP server + React SPA frontend
Graph query interface Strongly typed MCP primitives + graph_query SPARQL 1.1 queries against RDF triples (query_sparql)

Verified on September 8, 2026 against Narsil-MCP’s repository at main (v1.7.0, 183 stars). Tool definitions from src/tool_metadata.rs, presets from src/config/preset.rs, taint matching from src/taint/patterns.rs, SPARQL persistence from src/persistence/sparql.rs, and CCG architecture from docs/ccg-spec.md.

Key architectural differences

1. Query Ergonomics: SPARQL 1.1 on RDF vs. Strongly Typed MCP Primitives

The core thesis of Narsil-MCP is representing codebases as semantic RDF knowledge graphs according to the Code Context Graph (CCG) specification. Its Layer 3 graph stores classes, methods, modules, and dependencies as RDF triples inside oxigraph.

To query this graph, Narsil-MCP exposes SPARQL 1.1 endpoints (query_sparql). While SPARQL is a powerful W3C standard for semantic knowledge graphs, it introduces severe friction for AI coding agents:

trace-mcp is designed around Deterministic, Strongly Typed MCP Primitives:

2. Context Delivery: 4-Layer CCG Disclosure vs. 29-Tool Minimal Preset with Dynamic Escalation

Managing model context window budgets is critical to prevent prompt dilution and excessive token costs. The two servers approach context efficiency from different angles.

Narsil-MCP structures repository data into four progressive CCG tiers:

While Layer 0 provides an ultra-compact start, accessing granular symbols in Layers 2 and 3 requires fetching large chunks of serialized graph data. Furthermore, in tool discovery, Narsil-MCP’s 90 tools across 11 categories must be managed via static presets (minimal, balanced, full, security-focused). If an agent on the minimal preset needs a specialized tool from full, it cannot load it without server re-configuration.

trace-mcp addresses context overhead on both tool and data surfaces:

3. Language Breadth vs. 88 Framework Semantic Integrations

Both engines parse source code using tree-sitter grammars. Where they diverge is how syntax trees are elevated into software architecture.

Narsil-MCP provides native tree-sitter parsers for 32 programming languages. However, its extractors capture strictly syntactic elements: function declarations, structs, class hierarchies, imports, and method invocations. It has zero framework-aware extractors:

trace-mcp bridges syntax and application semantics across 88 frameworks:

When an agent reviews a pull request or plans a feature, trace-mcp traces the complete path from the user-facing route to the database query. In Narsil-MCP, the agent must inspect disconnected call sites and manually reconstruct the framework flow.

4. Code Modification: Stateless Analysis vs. Atomic AST Refactoring Write Tools

A critical distinction between the two projects is their operational scope: read-only navigation versus active code modification.

Narsil-MCP is strictly read-only and stateless across agent turns:

When an agent using Narsil-MCP needs to edit code, it must revert to generic string replacement or full file overwrites, risking broken imports and syntax errors.

trace-mcp provides a complete suite of AST-native refactoring write tools:

5. Security & Taint Analysis: Syntactic Regex Matching vs. AST-Grounded Dataflow with SARIF Output

Both tools emphasize security analysis, but implement fundamentally different analysis engines.

Narsil-MCP includes security scanning with 147 rules (covering OWASP, CWE, and OSV/SBOM supply chain checks). However, its taint analysis engine (src/taint/patterns.rs) operates via regex-like pattern matching over function and property names (function_patterns, property_patterns). This syntactic approach cannot track dataflow through intermediate variables, assignments, or scope closures, resulting in high false-positive rates and missed vulnerabilities across complex paths.

trace-mcp implements True AST Dataflow Taint Analysis:

When to choose Narsil-MCP

When to choose trace-mcp

Next steps

Last updated: September 9, 2026