Skip to content
hnindex.Documentation

TOOLS / SQLITE + TYPESCRIPT AST

Follow the connections.

A local source graph for TypeScript and JavaScript: definitions, imports, references and callers with file/line evidence.

How it works

hnindex analyzes source using the TypeScript compiler AST and stores nodes and relationships in SQLite. There is no separate graph database to deploy and no embedding service needed for graph indexing. Indexed imports, alias/re-export chains, lexical symbols and typed methods use project compiler options.

Initialize the graph

index_code_graph(path: "/your/project", project_name: "my-app")

Full, file and watch indexing can update graph snapshots too. Source changes and deletions re-resolve consumers; failed analysis hides stale graph data. Graph-only indexing provides TS/JS locations; full codebase indexing adds keyword/vector chunks.

Tools to explore

  • locate_code: find files or definitions; inspect ambiguity and per-file freshness.
  • find_references: inspect source references to a symbol.
  • callers: inspect resolved call relationships.
  • graph_context: request bounded source context around a symbol.
  • smart_context: combine retrieval with source relationships.

Use your MCP client’s tool schema for the exact parameters and project filters. Begin with workspace and code locations to select a project explicitly.

Read the evidence

The graph currently analyzes TypeScript and JavaScript. Dynamic calls, external dependencies and uncertain receiver types can remain unresolved. Relationships reflect analyzed source; they do not prove runtime behavior. Check freshness before editing and use filesystem search for stale, missing or excluded code.