Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

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

The author created a TypeScript Compiler Graph MCP tool that reduces token usage in code generation by up to 10x in Claude Code and Codex. It works by representing a TypeScript program's abstract syntax tree as a directed acyclic graph (DAG) instead of JSON, allowing the language model to process the same information more efficiently. The tool is available as an open-source package.

Background

- **MCP (Model Context Protocol)** is an open protocol that lets AI coding assistants (like Claude Code or Codex) directly access external tools or data sources — in this case, a TypeScript compiler's internal dependency graph. - **TS Compiler Graph** is a utility that extracts the full import/export dependency graph from a TypeScript project. Instead of sending entire source files to the AI, the MCP tool sends only the minimal, relevant type definitions and module signatures needed for a task — drastically reducing token usage (the "10x fewer" claim). - **Token efficiency** matters because AI coding tools charge by token and have context window limits. Cutting token count means lower cost and less chance of the AI losing track of important context. - The project is by **Samchon**, a well-known open-source contributor behind `typia` and other TypeScript transformation tools. This is a Show HN (Hacker News) post, meaning the author is presenting their own project for feedback.

Related stories

  • Safari Technology Preview 247 introduces the Safari MCP server, a Model Context Protocol server that lets AI agents connect to a Safari browser window to access DOM, network requests, screenshots, and console output for more autonomous web debugging and development.