r/coolgithubprojects • • 47m ago

Inspired by CodeGraphContext, I built a zero-DB Go alternative for AST call graphs & MCP (84ms indexing vs 3.8s, ~1ms queries, 98.4% edge precision)

https://github.com/roshankumar0036singh/gographctx

Coding agents (Claude Code, Cursor, etc.) tend to burn a lot of context on grep loops and whole-file reads just to answer "what breaks if I change this function?"

CodeGraphContext (CGC) showed that an AST call graph works much better than plain text search for this. My friction was the operational weight: running a graph DB, managing a Python env, and waiting over a second per query. So I built a lighter alternative, GoGraphCtx. It's v0.2.0, so still early.

What it is

  • A single static Go binary (CGO_ENABLED=0, ~16.5 MB), with no external DB, Docker, or LSP

  • Parses Go, Python, TypeScript/JS, Rust, and Java via tree-sitter

  • Keeps the graph in memory, persisted to a compressed snapshot plus a WAL, with incremental updates on file save

  • 13 MCP tools: find_symbol, get_callers, get_callees, get_impact, trace_path, find_dead_code, get_symbol_source, search_code, and others

  • 8-tier confidence model: verified edges are kept separate from "likely" candidates, and unresolved dynamic calls come back as unresolved_hints instead of silent guesses

  • Responses are trimmed to a token budget (4,000 by default), and the agent can fetch just a function's line range instead of the whole file

  • Portable index bundles via export/import, so CI can ship pre-built graphs

Benchmarks

From my own harness on GitHub Actions (4 vCPU), using a synthetic Flask-like repo with 83 .py files. Treat these as indicative, not definitive.

GoGraphCtxCGC
Index time~84 ms~3.8 s
Query p95~1.2 ms~1.3 s
Peak RSS~48 MB~178 MB
  • ~13k tokens vs ~59k for ripgrep on a symbol-lookup task

  • Incremental update after an edit: ~11.5 ms (p50)

  • 1,000-file Go repo: ~265 ms to index, ~102 MB RSS

About the 98.4% precision number

I checked edges against Jedi as an oracle on Flask (~3,900 call sites): ~98% for GoGraphCtx vs ~69% for CGC. Most of the gap comes from CGC's weaker heuristic edges. This is one codebase and one language, so it may not generalize.

Resolution coverage on real repos varies a lot by language

  • Rust (bytes): ~92%

  • TypeScript (zod): ~90%

  • Go (cobra): ~70%

  • JavaScript (express): ~49% (up from ~4% after adding CommonJS and prototype handling, but still the weakest)

Caveats

  • Dynamic-heavy code (especially JS) will have more unresolved calls

  • I compared against CGC's default setup and may not have tuned it optimally

  • It's young, so expect rough edges

If you already run Neo4j/FalkorDB and like CGC's Python-first heuristics, staying put is fine. If you want zero setup and a tool that tells you what it couldn't resolve, it might be worth a try.

Install:

There are several install options (install script, pip, npm, go install, and one-click MCP bundles). Setup instructions for each are in the repo README. It works with Claude Code, Cursor, Copilot, Windsurf, Cline, and Claude Desktop.

Repo and benchmark docs: https://github.com/roshankumar0036singh/gographctx

Feedback welcome, especially bug reports and repos where resolution is weak.

use this and remodify If you are working on a service, you are welcome to share it with the community after its fully launched. To combat spam, we don't allow links to announcements of future-services until they are barely anything more than a landing page.

  • 2 No AI generated slop

There has been a wave of AI-generated slop used to promote random services, usually disguised as sensational topics like MCP security. Such content will result in a ban.

  • 3 No astroturfing

Self-promotion is allowed with proper disclosure. Anyone caught promoting their product while pretending to be an unaffiliated user will be permanently banned.

  • 4 Use showcase tag to share your work

If you've built something in the MCP ecosystem, use showcase tag to indicate authorship and intent of demonstrating your work to others.

Show more

Here's a version rewritten for those rules. The main changes: it opens with clear disclosure that you built it, it's written in a plainer, first-person voice (rule 2 targets "AI slop", so I cut the polished feature-list tone), and the benchmark claims are trimmed. It's also a shipped, installable project rather than an announcement, which fits rule 1.

Flair: Showcase (rule 4)

Title:

[Showcase] I built GoGraphCtx, a single-binary code-graph MCP server in Go (no DB, no Python env)

Body:

Disclosure: I'm the author of this project.

I've been using Claude Code and Cursor on bigger repos, and I kept watching them run grep loops and read whole files just to answer "what breaks if I change this function?" CodeGraphContext (CGC) showed me an AST call graph is a better approach. What bothered me was the setup: a graph DB, a Python environment, and queries taking over a second. So I wrote a lighter version in Go. It's v0.2.0 and still early.

What it does

  • Single static binary (~16.5 MB), no external DB, Docker, or LSP

  • Parses Go, Python, TS/JS, Rust, and Java with tree-sitter

  • Keeps the graph in memory, saves a snapshot plus WAL, updates incrementally when you save a file

  • 13 MCP tools, including find_symbol, get_callers, get_callees, get_impact, trace_path, find_dead_code and get_symbol_source

  • Separates verified call edges from "likely" ones, and returns unresolved_hints for dynamic calls it can't resolve, rather than guessing

  • Caps responses at a token budget (4,000 by default)

Numbers, with caveats

These come from my own benchmark harness on GitHub Actions (4 vCPU), on a synthetic Flask-like repo with 83 Python files. Indicative only.

GoGraphCtxCGC
Index time~84 ms~3.8 s
Query p95~1.2 ms~1.3 s
Peak RSS~48 MB~178 MB

I also checked edge precision against Jedi on Flask (~3,900 call sites): about 98% for GoGraphCtx vs about 69% for CGC. That's one codebase and one language, and I may not have tuned CGC optimally, so please don't read it as a general claim.

Where it's weak

Coverage of resolved calls on real repos varies a lot: Rust (bytes) ~92%, TypeScript (zod) ~90%, Go (cobra) ~70%, JavaScript (express) ~49%. Dynamic-heavy code will always have more unresolved calls.

If you already run Neo4j/FalkorDB and like CGC, there's no strong reason to switch. If you want something with no setup that tells you what it couldn't resolve, it might be useful.

There are several ways to install it (script, pip, npm, go install, MCP bundle). Instructions are in the README.

Repo: https://github.com/roshankumar0036singh/gographctx

I'd really like bug reports and repos where resolution comes out poorly.

1 Upvotes

0 comments sorted by