sqlite-graph-mcp

v0.5.0
io.github.developjik/sqlite-graph-mcp Checked 1 hour ago Published 9 days ago

Zero-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.

ParameterTypeDescription
enginestringExtraction engine. Default: ast (tree-sitter WASM).
forcebooleanAccepted for symmetry; indexing always rebuilds.
ignorearrayExtra directory or file names to skip.
maxFilesinteger
rootstringWorkspace 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".

ParameterTypeDescription
query *stringSearch text, e.g. "walkNodes", "graph", "README". Use "*" to list all.
kindRestrict to node kinds.
limitintegerDefault 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.

ParameterTypeDescription
start *arrayNode ids or keys, as returned by graph_find.
directionstringDefault "out".
edgeTypeEdge types to follow. Defaults to all.
limitinteger
maxDepthintegerDefault 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.

ParameterTypeDescription
plan *Pipeline string, step array, or {steps:[...]} object.
limitintegerMax 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.

ParameterTypeDescription
includeEntriesbooleanInclude index/main/cli entry files.
includeTestsbooleanInclude *.test.ts / *.spec.ts files.
limitinteger

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.

ParameterTypeDescription
ids *arrayNode ids to filter.
kind
limitinteger
namestringCase-insensitive substring of the node name.
notKind
pathstringGlob, e.g. src/**/*.ts
prefixstring
regexstringJavaScript regex over the node name.
suffixstring
tagstring

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.

ParameterTypeDescription
base *stringBase side: git rev (e.g. "main") or a directory path.
head *stringHead side: git rev (e.g. "HEAD" or a PR SHA) or a directory path.
enginestringExtraction engine. Default: ast.
limitintegerCap per list (default 50; counts stay exact).