MCP Context Graph Compresses 90% of Tokens
nascousa · reddit · 2026-07-13
The author open-sourced a local-first MCP context graph tool, **CGA**, which offloads files, symbols, imports, calls, containment relationships, dependencies, and lightweight variable flows from the model context. The MCP client queries the graph based on the task and generates a smaller evidence package for the agent to use. Testing across 3 real code repositories with 34 deterministic cases each showed: - Average prompt tokens dropped from **5,474.95** to **483.29** - An average reduction of **90.44%** - Hallucination Pressure Score dropped from **17.66** to **13.94**, roughly **13.34%** lower However, one repository degraded in contextual risk metrics. The author stresses that graph slicing can be too narrow, meaning "less context" shouldn't automatically be equated with "better." They currently treat the graph as a **routing layer** rather than a source of truth, falling back to source code search or LSP if evidence is too old, weak, or dynamically changing. Current implementation boundaries: Python uses the standard library AST; TypeScript/JavaScript, PowerShell, Go, Rust, and Java still use lightweight extractors rather than full compilation semantics. The author concludes by asking what signal is most useful to the model: freshness, evidence source, fallback reasons, or retrieval latency.
More from coding & agent
- Codex turns out 123 screensavers in one playful batch — intellectronica · 2026-07-21
- Grok Build adds `grok doctor`, resumable sessions and remote image paste — mark_k · 2026-07-21
- Autoresearch proposes packaging ML runs as studies with questions, analysis, and code diffs — morgymcg · 2026-07-21
- CHAP defines approvals, handoffs, and audit logs for human-agent workflows — DeliveryTechnical199 · 2026-07-21
- The author says Codex reached 20x and is now debugging spec decoding on a hybrid parallel setup — TheZachMueller · 2026-07-21
- Axcess adds an MCP connector for WCAG accessibility checks that scanners miss — modelcontextprotocol · 2026-07-21