Graft alternative: trace-mcp vs Graft

TL;DR. Graft (trailhq/Graft / @nanonets/graft, 7.1K stars, MIT) is a context layer for AI coding agents (Claude Code, Cursor, Codex) that generates a repository knowledge graph as a folder of linked markdown files. It uses an external LLM (Anthropic Claude or OpenAI) to summarize subsystems, architectural boundaries, and concepts in plain English.

The fundamental differences between the two projects lie in indexing cost, privacy, graph storage, framework depth, and write capabilities. Graft relies on external LLM API calls to generate and update its markdown files, meaning indexing costs tokens, requires external API keys, and uploads proprietary source code to cloud models. trace-mcp is 100% local, deterministic, and private: it parses code in seconds using local Tree-sitter WASM and stores edges in an embedded SQLite database with zero external network requests and zero token bills. Graft stores concept nodes as loose markdown files on disk; trace-mcp stores relational symbol graphs that enable sub-millisecond multi-hop graph queries (get_callers, get_callees, get_change_impact). Furthermore, trace-mcp models deep semantic edges across 88 web frameworks and provides verified AST refactoring write tools (refactor_rename, refactor_extract, refactor_move, refactor_codemod) and OWASP taint analysis, neither of which exists in Graft.

Pick Graft if you want human-readable markdown documentation files committed directly to your repository that developers can browse in standard markdown viewers. Pick trace-mcp if you require instant local indexing with zero API bills, complete source privacy, relational graph traversal across 88 frameworks, and safe AST refactoring write capabilities.

Head-to-head

Capability trace-mcp Graft
GitHub stars 175 7.1K
License MIT (permissive open-source) MIT (permissive open-source)
Written in TypeScript (Node.js) TypeScript (Node.js)
Installation / Distribution npx -y trace-mcp@latest (npm registry) npx @nanonets/graft / npm i -g @nanonets/graft
Indexing engine 100% deterministic local WASM (Tree-sitter) Hybrid: Tree-sitter + external LLM calls (Claude / OpenAI)
Indexing cost $0.00 (zero API tokens, zero keys) Requires external API keys, bills tokens per file
Code privacy 100% local (code never leaves the machine) Sends code chunks to external LLM APIs for summarization
Underlying storage Embedded SQLite WAL + FTS5 full-text index Folder of loose markdown files (graft/*.md) + front matter
Query speed Sub-millisecond indexed SQL queries File system traversal and front matter text parsing
Languages (AST parsing) 81 (precompiled WASM) 9 (native C++ tree-sitter grammars)
Build dependencies Zero native builds (WASM sandboxes) Native C++ compiler toolchain required (node-gyp, Python)
Framework integrations 88 semantic integrations 0 (generic syntax AST only)
Framework-aware edges ✓ route → handler, controller → template, ORM → table ✗ (syntax AST only)
MCP tools defined 182 tools (adaptive task presets) 6 tools (graft_find_code, graft_trace_calls, etc.)
Default advertised tools 29 (~11.6K tok, task presets minimal, review, dev) 6 tools advertised unconditionally
Refactoring write tools ✓ AST-native transforms (rename, extract, move, codemods) ✗ (read-only context retrieval)
Security analysis ✓ OWASP Top-10 taint analysis, SARIF 2.1.0
Session & decision memory ✓ Symbol-bound decision knowledge graph with staleness checks ✗ (file freshness check only)
Human-browsable markdown docs ✗ (structured query context via MCP) ✓ Generates readable markdown files in graft/

Verified on September 11, 2026 against Graft repository at main (v0.18.0, 7.1K stars, trailhq/Graft). Tool definitions from src/mcp/tool-names.ts and src/mcp/tools.ts, package dependencies from package.json, graph representation from src/graph/, and CLI configuration from src/cli/.

Key architectural differences

1. Indexing Cost & Privacy: Local Deterministic Parsing vs. External Paid LLMs

The most fundamental architectural difference between trace-mcp and Graft is how the codebase graph is constructed.

Graft relies on external generative LLMs (@anthropic-ai/sdk, openai) to synthesize concept nodes and describe subsystems:

trace-mcp is 100% local, offline, and private:

2. Storage Architecture: Relational SQLite WAL vs. File-Based Markdown Cache

Graft stores its knowledge graph as a directory of loose markdown files (graft/*.md) using YAML front matter (gray-matter):

trace-mcp stores symbols, calls, and relationships in an embedded SQLite database with WAL (Write-Ahead Logging) mode and FTS5 (Full-Text Search):

3. Tool Surface & Write Path: AST Refactoring vs. Read-Only Retrieval

Graft exposes 6 read-only MCP tools:

Graft offers zero tools to modify code. If an agent needs to refactor a function, rename a symbol across 50 files, or extract duplicate logic, it must fall back to blind string replacement or manual file rewrites.

trace-mcp pairs comprehensive graph navigation with production-grade AST refactoring write tools:

4. Framework Awareness: 88 Web Framework Integrations vs. Generic Syntax

Graft extracts syntactic symbols (classes, functions, calls) from raw language grammars. It does not model web application frameworks or cross-tier abstractions:

trace-mcp constructs semantic graph edges across 88 frameworks:

When an AI agent modifies a backend controller, trace-mcp warns the agent about affected frontend callers and impacted database queries.

5. Build Portability: Sandboxed WASM vs. Native C++ Compilations

Graft relies on native Node.js addons:

trace-mcp is engineered for zero-setup, universal portability:

When to choose Graft

When to choose trace-mcp

Next steps

Last updated: September 11, 2026