Show HN: I Made TS Compiler Graph MCP: 10x Fewer Tokens in Claude Code and Codex

autobe1 pts0 comments

ttsc/packages/graph at master · samchon/ttsc · GitHub

//files/disambiguate" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

//files/disambiguate;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

samchon

ttsc

Public

Uh oh!

There was an error while loading. Please reload this page.

Notifications<br>You must be signed in to change notification settings

Fork

Star<br>179

FilesExpand file tree

master

/graph<br>Copy path

Directory actions

More options<br>More options

Directory actions

More options<br>More options

Latest commit

History<br>History<br>History

master

/graph<br>Copy path

Top

Folders and files<br>NameNameLast commit message<br>Last commit date<br>parent directory<br>..<br>build

build

src

src

README.md

README.md

package.json

package.json

tsconfig.json

tsconfig.json

View all files

README.md<br>Outline<br>@ttsc/graph

@ttsc/graph gives your coding agent a graph of your TypeScript codebase over MCP: what calls what, what depends on what, where each piece lives.

It is drawn by the real TypeScript compiler, so it is exact, and every claim is anchored to a file and line you can open.

The agent answers structural questions from the graph instead of crawling file by file, which cuts its tokens by roughly 10x on open-ended "how does this work?" questions.

For why I built it, how it works in depth, and how it compares to codegraph, codebase-memory-mcp, and serena, read the launch post: https://ttsc.dev/blog/i-made-ts-compiler-graph-mcp

Setup

npm install -D ttsc @ttsc/graph typescript@rc

@ttsc/graph reads the graph from the program ttsc type-checked, so install the two together.

ttsc runs on the TypeScript-Go (TypeScript v7) runtime, which is still a release candidate, so the install pins typescript@rc. It does not run on stable TypeScript v6.x yet.

Add the server to your agent's MCP config, once. For Claude Code, that is a .mcp.json in your project root:

"mcpServers": {<br>"ttsc-graph": {<br>"command": "npx",<br>"args": ["-y", "@ttsc/graph"]

Start your agent from your project root so the server finds your tsconfig.json. The agent queries the graph on its own; you never call it by hand.

The example says Claude Code, but any MCP-capable agent works (Codex, Cursor, and others).

How it works

The whole MCP surface is one tool, inspect_typescript_graph. You ask in plain language, and a short required chain of thought inside the tool (question, draft, review) plans the smallest query and picks one operation.

An index, not source bodies. It returns names, edges, signatures, and spans, never code, so the response stays flat as the repository grows.

Built on the real compiler. It reads the program ttsc type-checked, so tsconfig aliases, pnpm monorepos, symlinks, and re-exports resolve exactly, where a text parser can only guess.

It does not force itself. It states when the graph is the right source and offers a first-class escape for everything else.

Errors and lint too. tsc compile errors and @ttsc/lint and plugin (typia, nestia) findings ride the same graph, so "what is broken here?" answers from one index.

The operations (tour, entrypoints, lookup, trace, details, overview, escape) and the full request and result contract are in the Design guide: https://ttsc.dev/docs/graph/design

Benchmark

Across eight real repositories, @ttsc/graph holds a flat, low median token cost while the alternatives swing with repository size.

The full benchmark has the interactive charts, every model, and the method: https://ttsc.dev/docs/benchmark/graph

Browse it in 3D

Run this in your own project to open the graph in your browser, served from a local port:

npx @ttsc/graph view

This is TypeORM in 3D, colored by kind (live viewer):

Learn more

Launch post: why I built it, and how it compares to codegraph, codebase-memory-mcp, and serena.

Design: the one tool, its request and result branches, and the node and edge kinds.

Comparison: the head-to-head with other graph and language-server MCP tools.

Benchmark: the interactive charts, every model, and the method.

Sponsors

Thanks for your support.

Your donation encourages ttsc development.

You can’t perform that action at this time.

graph ttsc typescript json agent code

Related Articles