@samchon/graph

@samchon/graph is an MCP server that gives AI agents a code graph instead of source files.
It indexes a codebase in 16 languages into a graph of declarations and the relationships each selected provider can defend, then answers an agent's code questions from that index through a single tool. Registered strict providers have compiler, analyzer, or semantic-index authority and may decline a build; the ordinary language server and separately packaged @samchon/graph-sitter remain explicit lower-authority fallbacks.
Coding agents normally answer a code question by grepping the repository and reading file after file into context, and that reading is most of the token bill. The graph removes the need for it, and its own answers stay small in turn: they carry names, signatures, relationships, and source spans, never file bodies.
Since neither side of that exchange grows with the repository, the cost falls by about the same proportion in every situation, on every codebase — for an agent that trusts the graph result enough to stop there. codex/gpt-5.4-mini does; see the Benchmark section below for a harness where a model doesn't, and reads on top of the graph call anyway. That even distribution is what separates this from codegraph and serena when it holds, and it shows directly in the chart below:

Setup
MCP server
npm install -D @samchon/graph
{
"mcpServers": {
"samchon-graph": {
"command": "npx",
"args": ["-y", "@samchon/graph"]
}
}
}
Start the client from the project root. The server builds one resident graph and answers every MCP call from memory. If no language server is installed, a built-in static indexer parses the source directly; every language indexes in about 1–2 seconds, even on large repositories.
Language Server
A language server improves the graph with semantically resolved edges. Install the ones for your stack; nothing is provided automatically, and an installed editor such as VS Code does not expose a stdio language server:
| Language |
Server |
Install |
| TypeScript |
ttscserver |
npm i -D ttsc@^0.24.0 typescript |
| Python |
pyright-langserver |
npm i -D pyright |
| Go |
gopls |
go install golang.org/x/tools/gopls@latest |
| Rust |
rust-analyzer |
rustup component add rust-analyzer |
| C / C++ |
clangd |
LLVM release, or your package manager |
| Java |
jdtls |
Eclipse JDT LS (needs JDK 21+) |
| C# |
csharp-ls |
dotnet tool install -g csharp-ls |
| Kotlin |
kotlin-language-server |
fwcd/kotlin-language-server |
| Swift |
sourcekit-lsp |
ships with the Swift toolchain |
| Scala |
metals |
cs install metals |
| Zig |
zls |
zigtools/zls |
| Ruby |
ruby-lsp |
gem install ruby-lsp |
| PHP |
intelephense |
npm i -D intelephense |
| Lua |
lua-language-server |
LuaLS/lua-language-server |
| Dart |
dart |
ships with the Dart SDK |
Each server must be on PATH. If none is present for a file's language, that language falls back to the static indexer automatically.
Strict provider support
Generated from docs/provider-support.json; do not edit this block by hand.
Strict selection is per registered provider and may decline for missing tools, incompatible options, or incomplete build metadata. Authority grades differ. A provider's facts list means it can defend those edge families; it is not a universal-completeness claim. Strict dumps carry provider/tool provenance plus universe, input-manifest, and content digests. The MCP result reports operation coverage and uncertainty, but does not promise #63's future complete producer-owned per-generation coverage contract. Generic language-server and static fallbacks remain valid lower-authority results and are identified as such.
Capability
| Provider |
Languages |
Authority |
Defensible facts |
Evidence |
ttscgraph |
typescript |
compiler |
exports, calls, accesses, instantiates, type_ref, extends, implements, overrides, renders |
upstream / route #63 |
samchon-graph-go |
go |
compiler |
contains, exports, imports, calls, accesses, instantiates, type_ref, implements, dispatches, tests, references |
upstream / route #63 |
samchon-graph-lua |
lua |
analyzer |
references |
upstream / route #83 |
samchon-rust-analyzer-hir |
rust |
analyzer |
contains, exports, imports, calls, accesses, instantiates, type_ref, extends, implements, overrides, dispatches, decorates, tests, references |
upstream / route #72 |
clangd-snapshot |
c, cpp |
compiler |
contains, exports, imports, calls, accesses, instantiates, type_ref, extends, implements, overrides, dispatches, references |
upstream / route #73 |
javac-graph |
java |
compiler |
contains, exports, imports, calls, accesses, instantiates, type_ref, extends, implements, overrides, dispatches, decorates, tests, references |
upstream / route #74 |
scip-kotlinc |
kotlin |
semantic-index |
contains, references |
upstream / route #76 |
scip-dotnet |
csharp |
semantic-index |
none |
upstream / route #75 |
scip-python |
python |
semantic-index |
references |
upstream / route #80 |
scip-ruby |
ruby |
semantic-index |
none |
upstream / route #81 |
scip-dart |
dart |
semantic-index |
none |
upstream / route #84 |
scip-php |
php |
semantic-index |
none |
upstream / route #82 |
Lifecycle
These are current implementation modes, not future route claims. Preparation and native/export/resident phases are stated separately because the experiment catalog and cold measurement artifact prove different boundaries; the artifact reports whole end-to-end cells, not isolated phase timings.
| Provider |
Mode |
Preparation |
Native analysis |
Export and merge |
Reuse or resident state |
ttscgraph |
resident-no-op-reuse; invalidated-closure shard deltas with a compatible producer |
A matching ttsc/TypeScript project and tsconfig/jsconfig/package inputs. |
A compatible target-project ttsc checker owns one resident compiler process and its incremental semantic state. |
Changed compiler-owned raw shards cross a versioned transaction; the client validates the complete manifest and adapts only upserts before atomic publication. |
Unchanged requests reuse the exact snapshot; body edits reuse unaffected native and normalized shards, while build-universe changes reload safely. |
samchon-graph-go |
unchanged-snapshot-reuse; full-rebuild-on-change |
Go workspace/module inputs, selected GOOS/GOARCH/cgo environment, embedded files and vendored inputs. |
The shipped exporter runs one compiler-owned go/packages batch against the selected build universe. |
A changed-input batch emits and validates one whole-workspace graph before snapshot publication. |
Unchanged inputs reuse the validated snapshot; no resident go/packages checker survives changed builds. |
samchon-graph-lua |
unchanged-snapshot-reuse; full-rebuild-on-change |
LuaLS workspace configuration and the shipped readable exporter. |
LuaLS analyzes the workspace and the shipped exporter asks its semantic VM for declaration references. |
A changed-input run publishes one references-only whole-workspace graph. |
Unchanged inputs reuse the validated snapshot; the current exporter is not a resident incremental session. |
samchon-rust-analyzer-hir |
resident-no-op-reuse; invalidated-closure shard deltas; validated restart checkpoints |
Cargo metadata/config, lock/toolchain inputs, target/features/cfg and build-script/proc-macro universe. |
The pinned rust-analyzer fork owns one resident HIR database and exports declarations, semantic relationships, diagnostics, coverage and unresolved boundaries from that exact analysis revision. |
Content-addressed source shards cross a versioned LSP transaction; the client verifies producer identity, universe, complete manifests, shard digests and graph invariants before atomic publication. |
No-op requests reuse the resident snapshot; interface changes invalidate dependent shards, while a complete consumer checkpoint restores the same generation after process restart. |