Repository avatar
Other Tools
v0.1.0
active

gographctx

io.github.roshankumar0036singh/gographctx

AST call graph & blast radius intelligence MCP server for Python, TypeScript, and Go.

Documentation

English · 简体中文 · 日本語 · 한국어 · Español · Português (BR) · Deutsch · Français

GoGraphCtx — Single-Binary Code Graph Indexer and Confidence-Aware MCP Server

GoGraphCtx

Single-Binary, Zero-Dependency Code Graph Indexer & Confidence-Aware MCP Server for AI Coding Agents

M8ven Score Unit Tests Lint & Security Go 1.25+ MIT License 15.8 MB Static Binary Zero External DB 7 MCP Tools PRs Welcome

Give Claude Code, Cursor, Windsurf, VS Code Copilot, and Cline an accurate, token-budgeted call graph, blast-radius analysis, and repository structure—in 533ms with zero Neo4j, Docker, or Python dependencies.


Short Interactive Demo

GoGraphCtx Terminal Demo: 533ms indexing, get_impact MCP response, and 22.8ms live file watch

View Architecture & Comparison Visual

Why GoGraphCtx vs Grep and Legacy Graph DBs Infographic


Why Use GoGraphCtx?

AI coding agents struggle on real codebases for three reasons:

  1. The "Context Tax" of grep and glob: Agents waste thousands of tokens and dozens of round-trips scanning comments, imports, and homonyms (Service.run vs Job.run) instead of traversing actual cross-file call chains.
  2. Silent Guesses in Heuristic Graph Tools: Legacy code-graph tools often emit fallback guesses (substring path matches or alphabetical-first matches) as verified call edges, causing agents to miss callers or refactor the wrong function.
  3. Heavy Infrastructure: Python/Cypher graph servers require Neo4j/FalkorDB/Docker containers, ~90 pip dependencies, or brittle per-language LSP setups, taking seconds per query and hundreds of megabytes of RAM.

GoGraphCtx solves all three in one 15.8 MB static binary:

  • Pure-Go AST & Resolution Engine: Compiled-in gotreesitter parsers (CGO_ENABLED=0) for Go, Python, TypeScript/TSX, JavaScript/JSX, Rust, and Java.
  • 8-Tier Confidence Model: Every edge carries explicit confidence (certain vs LIKELY_CALLS vs CallSite evidence). Speculative guesses are never misrepresented as verified facts.
  • Zero External Graph Database: Builds an indexed in-memory graph and persists an atomic, zstd-compressed binary snapshot + CRC32C Write-Ahead Log (.ggctx/index.ggctx).
  • 7 Token-Budgeted MCP Tools: Designed around strict LLM context budgets (default: 4000 tokens) with binary-search shrinking, repo-relative paths, and confidence summaries—instead of 30–50 noisy overlapping tools.
  • Real-Time Incremental Watcher (~22.8ms): fsnotify re-indexes changed files and affected reverse-dependents in milliseconds alongside live MCP serving.

30-Second Quickstart

1. Install (No Go Required)

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/roshankumar0036singh/gographctx/main/scripts/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/roshankumar0036singh/gographctx/main/scripts/install.ps1 | iex

Go toolchain (Go 1.25+) or GitHub Releases:

go install github.com/roshankumar0036singh/gographctx/cmd/gographctx@latest

(Or build locally from source: git clone https://github.com/roshankumar0036singh/gographctx.git && cd gographctx && make build.)

2. Index & Query Any Repository

# Index a repository in ~0.5s (creates .ggctx/index.ggctx)
gographctx index ./your-repo

# Check index statistics & resolution coverage
gographctx stats ./your-repo

# Run an impact analysis query directly from CLI
gographctx query get_impact pkg::Service::Handle --path ./your-repo

3. Connect Your AI Coding Agent (MCP)

Claude Code
claude mcp add gographctx -- gographctx watch /absolute/path/to/your/repo
Cursor / Windsurf / Claude Desktop / Cline

Add to ~/.cursor/mcp.json or claude_desktop_config.json:

{
  "mcpServers": {
    "gographctx": {
      "command": "gographctx",
      "args": ["watch", "/absolute/path/to/your/repo"]
    }
  }
}
VS Code Copilot MCP (.vscode/mcp.json)
{
  "servers": {
    "gographctx": {
      "type": "stdio",
      "command": "gographctx",
      "args": ["serve", "${workspaceFolder}"]
    }
  }
}

Measured Benchmarks & Multi-Tool Comparison

All GoGraphCtx numbers below were measured directly via cmd/ggctx-bench (go1.25.1, windows/amd64, 16 vCPUs):

Benchmark MetricMeasured ResultTarget SLA
Flask-scale Python repo (83 .py files, 705 nodes, 2,208 edges)533.39 ms / 51.02 MB RSS< 1s / < 80 MB
Go monorepo (1,000 .go files, 6,002 nodes, 8,000 edges)1,401.70 ms / 116.92 MB RSS< 3s / < 150 MB
Flask strong-tier call edge ratio100.0% (TierStructural..TierSamePackage)>= 85%
Incremental file update (body edit / export change, p50)22.78 ms / 22.77 ms< 50ms / < 100ms
MCP tool query latency (warm stdio, p95)3.80 ms< 10 ms
CLI cold startup (gographctx version, p50)22.80 ms< 50 ms
Stripped static binary (CGO_ENABLED=0)15.79 MB< 30 MB

How GoGraphCtx Compares Against Other Code Intelligence Tools

ToolCategoryRuntime / SetupCall GraphImpact BFSConfidence TiersKey Trade-off vs GoGraphCtx
GoGraphCtxCode-Graph MCP15.8 MB static Go binary, zero external DBYesYes (get_impact)Yes (8 tiers + LIKELY_CALLS + unresolved_hints)98.4% Flask precision, sub-second index, zero DB setup (trades aggressive speculative guesses for high-precision edges + explicit unresolved disclosure)
CodeGraphContext (CGC)Code-Graph MCPPython + ~90 pip deps + Neo4j / FalkorDB / KuzuYesYesPartial (emits Tier 7–8 guesses as facts; ~61% of edges)69.2% Flask precision, higher heuristic recall (~70% vs Jedi), requires Cypher DB & Python env
SCIP (scip-python, scip-go)Compiler OracleNode/Python/Go toolchain + full dependency installYesExternal scriptExact compiler oracleRequires buildable env & project deps installed
Universal CtagsTag IndexerNative CLI binaryNoNoNoNo cross-file call graph or receiver type resolution
ast-grep (sg)AST Search CLIRust binaryNoNoExact syntax matchGreat ad-hoc syntax search, no persistent call/impact graph
SerenaLSP MCP ServerPython + live language servers (pyright, gopls)YesLimitedType-checker-backedHeavier LSP warmup & 50+ tool context footprint
ripgrep (rg)Lexical SearchRust binaryNoNoText onlyFast regex, high noise on homonyms/imports/comments

See docs/benchmarks.md for reproduction commands (ggctx-bench), SCIP ground-truth evaluation details, and CI release regression workflows.


7 Focused MCP Tools

ToolPurposeKey Parameters
find_symbolPattern/kind/file/language symbol lookupname, kind, file, language, exported_only, limit
get_callersDirect callers with confidence tier & call sitessymbol, file, include_likely, limit
get_calleesDirect callees with confidence tier & call sitessymbol, file, include_likely, limit
get_impactTransitive reverse-dependency blast radiussymbol, file, max_depth, limit
file_outlineStructured imports, classes, functions, fields, varsfile, include_private
search_codeMulti-filter query with cyclomatic complexityname_pattern, qname_pattern, kinds, min_complexity, max_complexity
repo_overviewRepo metrics, language mix & coverage summaryinclude_top_complex, limit

Full JSON schemas and envelope examples are documented in docs/mcp-tools.md.


Comprehensive Documentation


Roadmap (v0.2)

  • Package manager distribution (Homebrew tap formula, Scoop manifest, container image)
  • Expanded Python/TS/Rust framework idioms and cross-package trait/protocol resolution
  • Multi-repository workspace graph linking and richer CLI query presets

Contributing & Community

Contributions of all sizes are welcome! Check CONTRIBUTING.md to set up your local environment, add new language resolvers, or run make bench-suite.

If GoGraphCtx saves tokens and time for your AI coding workflow, please consider giving the repository a Star!

MCPB
https://github.com/roshankumar0036singh/gographctx/releases/download/v0.1.0/gographctx_0.1.0_linux_amd64.mcpb
Install Command
# mcpb: https://github.com/roshankumar0036singh/gographctx/releases/download/v0.1.0/gographctx_0.1.0_linux_amd64.mcpb