« All posts

@ttsc/graph: A Compiler-Built Code Graph MCP for AI Agents

@ttsc/graph is an MCP server using the TypeScript compiler's own type-check to build a code graph, cutting AI agent token use by about 90%.

@ttsc/graph is an MCP server that hands coding agents a graph of declarations and relationships built directly by the TypeScript compiler, instead of forcing them to grep and read source files. Every node and edge comes from ttsc's type-checking, so answers stay exact and compact — names, signatures, relations and spans rather than full file bodies.

According to the project's own benchmark, because neither the question nor the answer scales with repository size, token cost drops by roughly the same proportion across codebases; an agent willing to trust the graph result can settle a task using as little as 4% of the tokens a no-tool baseline needs. Comparable tools like codegraph and serena show cost swinging with repo size instead of staying flat.

Because the graph is simply a byproduct of the type-check the native TypeScript 7 compiler already performs, there's no separate indexing pass or fallback parser. That lets even a three-million-line repository build its index in about 29 seconds, versus several minutes for competing tools.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work