sqlite-graph-mcp
v0.5.0Zero-embedding code & spec graph over SQLite with file:line citations for every answer.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
graph_index Index workspace
Scan the workspace for .ts/.tsx/.js/.jsx/.md files and package.json manifests, and build the SQLite graph at .sqlite-graph/index.db (nodes: file, symbol, heading, package; edges: imports, exports, defines, links_to, depends_on, references). tsconfig paths aliases and workspace-local packages resolve to real files. The default tree-sitter (WASM AST) engine grounds references in identifier usage; the regex heuristic engine is a fallback. Safe to re-run: it rebuilds atomically.
| Parameter | Type | Description |
|---|---|---|
engine | string | Extraction engine. Default: ast (tree-sitter WASM). |
force | boolean | Accepted for symmetry; indexing always rebuilds. |
ignore | array | Extra directory or file names to skip. |
maxFiles | integer | |
root | string | Workspace directory to index (defaults to the server root). |
graph_find Find nodes
Operator 1 (find): search files, symbols, markdown headings and packages by text. Uses SQLite FTS5 prefix ranking plus substring fallback, so "index" matches "GraphIndexer".
| Parameter | Type | Description |
|---|---|---|
query * | string | Search text, e.g. "walkNodes", "graph", "README". Use "*" to list all. |
kind | Restrict to node kinds. | |
limit | integer | Default 20. |
graph_walk Walk the graph
Operator 2 (walk): traverse edges from a set of nodes with a recursive CTE (cycle-safe, depth capped). Direction out = dependencies/definitions, in = dependents/references — e.g. walk type=references dir=in from a symbol lists the files that import it. Each node returns its traversal depth and a path:line citation.
| Parameter | Type | Description |
|---|---|---|
start * | array | Node ids or keys, as returned by graph_find. |
direction | string | Default "out". |
edgeType | Edge types to follow. Defaults to all. | |
limit | integer | |
maxDepth | integer | Default 6. |
graph_plan Run a 5-operator plan
Operator 5 (answer): chain find → walk → filter → minus in one call and get structured evidence (nodes, touched edges, path:line citations, per-step trace). Accepts a pipeline string such as `find "graph" kind=symbol | walk type=imports depth=2 | filter path=src/**` or a JSON {steps:[...]} plan.
| Parameter | Type | Description |
|---|---|---|
plan * | Pipeline string, step array, or {steps:[...]} object. | |
limit | integer | Max nodes in the answer (default 50). |
graph_orphans Find orphans
Operator 4 (minus) applied: files with no inbound imports/links (dead code, stale docs) and symbols that are never exported (dead-code candidates). Test and entry files are excluded unless asked for.
| Parameter | Type | Description |
|---|---|---|
includeEntries | boolean | Include index/main/cli entry files. |
includeTests | boolean | Include *.test.ts / *.spec.ts files. |
limit | integer |
graph_filter Filter a node set
Operator 3 (filter): narrow an explicit node set by kind, path glob/prefix/suffix, name, or tag (tags include code, doc, test, entry, manifest, exported). Combine with graph_find output ids.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node ids to filter. |
kind | ||
limit | integer | |
name | string | Case-insensitive substring of the node name. |
notKind | ||
path | string | Glob, e.g. src/**/*.ts |
prefix | string | |
regex | string | JavaScript regex over the node name. |
suffix | string | |
tag | string |
graph_diff Diff two revisions
Index two workspace states and answer "what breaks if we ship head?": symbols that are removed or no longer exported while other files still referenced them (with importer citations), files that lost their last inbound edge, and node/edge counts. Each side is a git revision (branch, tag, SHA — verified, no shell) or a directory path.
| Parameter | Type | Description |
|---|---|---|
base * | string | Base side: git rev (e.g. "main") or a directory path. |
head * | string | Head side: git rev (e.g. "HEAD" or a PR SHA) or a directory path. |
engine | string | Extraction engine. Default: ast. |
limit | integer | Cap per list (default 50; counts stay exact). |