graphify-ts: Local MCP server cuts Claude Code PR review tokens from 63K to 8.7K

If you've used Claude Code on a real codebase, you've seen the problem: every question triggers 8-10 sequential tool calls (glob, grep, read, read, read) to build context from scratch. Input tokens pile up, latency drags, and the agent rediscovers the same structure each time. graphify-ts is a free, open-source MCP server that pre-indexes your code into a local knowledge graph, so Claude makes a single retrieve call instead.
How it works
At index time, graphify-ts parses your code with tree-sitter AST, extracts structural relationships (files, functions, classes, calls, imports), runs Louvain community detection to group related modules, indexes with BM25, and optionally re-ranks with a local ONNX model. The resulting graph is served via MCP stdio — fully local, no data leaves your laptop. The default core profile exposes 6 tools to keep session overhead low (about 5K tokens); you can opt into the full 21-tool surface with GRAPHIFY_TOOL_PROFILE=full.
Benchmarks you can verify
The repo includes a verify.sh script that re-derives all numbers from committed evidence. Results measured on a real production NestJS + Next.js codebase (1,268 files) with Claude Opus 4.7:
- Single code query: 9 tool calls → 3, 615,190 input tokens → 233,508 (2.6× fewer), latency 96 sec → 35 sec (2.8× faster). Both from Claude's
--output-format jsonusage field. - 36-file PR review: Prompt tokens dropped from 63,024 to 8,690 (7.25× smaller). Same reviewer, same diff, same review depth — both runs flagged the same hotspots.
- Multi-repo question across 3 repos: Estimated naive prompt ~1.5M tokens (wouldn't fit any window) vs. 2,800 tokens with graphify-ts. The author notes this is a structural estimate, not a sent prompt.
Install & use
npm install -g @mohammednagy/graphify-ts
cd your-project
graphify-ts generate .
graphify-ts claude installAlso works with Cursor, Copilot, Gemini CLI, Aider, OpenCode via <agent> install.
Trade-offs to know
- Cold-start cost: First session costs about 13% more than no-graph baseline due to tool-schema overhead (~5K tokens). Multi-question sessions amortize this.
- Language support: Deep extraction is best on JS/TS with framework-aware passes (Express, NestJS, Next.js, Redux Toolkit, React Router). Python/Ruby/Go/Java/Rust use plain tree-sitter AST. C/Kotlin/C#/Scala/PHP/Swift/Zig use a generic structural extractor.
- Limits: This is a structural map for an agent, not a full program-analysis database. Heavily meta-programmed routes fall back to the base AST.
The author is actively seeking counterexamples — repos where structural slicing breaks. MIT licensed, requires Node 20+.
📖 Read the full source: r/ClaudeAI
👀 See Also

Weejur: A Simple UI Front-End for GitHub Pages Publishing
Weejur is a free tool that provides a simplified UI for publishing websites via GitHub Pages, allowing users to paste HTML or upload files after OAuth login.

LightMem: Lightweight Memory System for LLM Agents with 10×+ Gains and 100× Lower Cost
LightMem is a modular memory system for LLM agents that achieves up to 10.9% accuracy improvement while reducing tokens by up to 117×, API calls by up to 159×, and runtime by over 12×. It's designed for scalable long-context reasoning across agent workflows.

Apideck CLI: A Low-Context Alternative to MCP for AI Agents
Apideck CLI is an AI-agent interface that uses ~80 tokens for its agent prompt instead of tens of thousands for tool schemas, addressing MCP's context window consumption problem. Benchmarks show MCP can cost 4 to 32× more tokens than CLI for identical operations.

Ultimate Unreal Engine MCP: Claude Code Can Now Build and Verify Unreal Engine Levels with 132 Tools
Open-source MCP server exposes 132 tools across 26 domains, letting Claude spawn actors, set UPROPERTY values, take viewport screenshots, navigate cameras, and self-correct after mutations.