gograph
gograph is a local, AST/type-aware Go repository context indexer that builds a navigable graph of packages, symbols, calls, and code signals — enabling AI agents to analyze Go codebases efficiently without raw file reads.
Search & Navigation
gograph_query— Search symbols, packages, files, or importsgograph_node— Full AST details for any symbolgograph_source— Extract exact source code for a symbolgograph_skeleton— Full repo exported API signatures (bodies stripped)gograph_public— Show only exported symbols of a package
Bundled Context
gograph_context— Node + source + callers + callees + tests in one callgograph_explain— LLM-ready architectural narrative (callers, callees, SQL, env, routes, concurrency, tests)gograph_focus— Targeted context bundle for a single packagegograph_capabilities— Discover available tools and workflows
Call Graph & Impact
gograph_callers/gograph_callees— Find callers/callees of a functiongograph_path— Shortest BFS call chain between two symbolsgograph_impact— Full blast radius for a symbol or uncommitted changesgograph_hotspot— Rank functions by incoming call count
Change Management
gograph_changes— New/modified/deleted symbols since last build or a git refgograph_api— Detect breaking public API changes against a baselinegograph_plan— Pre-edit safety plan (affected tests, routes, SQL, env, API impact)gograph_review— Post-edit risk summary
Code Quality & Metrics
gograph_complexity— Cyclomatic complexity per functiongograph_godobj— Detect god-object struct candidatesgograph_coupling— Package fan-in, fan-out, and instability metricsgograph_arity— Functions with too many parametersgograph_orphans— Dead code via reachability analysis
Architecture & Dependencies
gograph_boundaries— Verify layered architecture constraintsgograph_deps/gograph_dependents— Import dependencies and dependentsgograph_imports— Files importing a specific external packagegograph_stats/gograph_stale— Graph health and freshness
Type & Interface Analysis
gograph_interfaces/gograph_implementers/gograph_mocks— Interface satisfaction, implementers, and mocksgograph_fields/gograph_embeds/gograph_usages— Struct fields, embedders, and type usagesgograph_literals/gograph_constructors— Initialization sites and factory functions
HTTP, SQL & Environment
gograph_routes— Extract all HTTP REST API routesgograph_endpoint— Full vertical slice: handler → call chain → SQL → env readsgograph_sql— All SQL queries found in the ASTgograph_envs— Everyos.Getenv/viper.Get*read with file and line
Concurrency & Error Tracing
gograph_concurrency— Map goroutines, channels, mutexes, WaitGroups,sync.Oncegograph_errorflow/gograph_errors— Trace errors up the call stack; list custom errors and panics
Mutation & Return Analysis
gograph_mutate— Find functions mutating a specific struct fieldgograph_returnusage— Show how callers use a function's return value
Testing & Miscellaneous
gograph_tests/gograph_fixtures— Find test functions and test helper structsgograph_globals— Package-level variables and their mutatorsgograph_schema— Structs mapped to database tables via struct tagsgograph_snapshot*— Save, diff, list, and drop architectural metric snapshots
gograph
Stop burning tokens on grep. Give your AI agent a graph.
gograph builds a local, AST-aware call graph of your Go repository and exposes 50+ query tools via CLI and MCP so coding agents can navigate packages, symbols, call chains, routes, SQL, env vars, and tests — without reading raw files.

Zero network. Zero execution. Zero secrets read.
gographis purely static analysis — it never runs your code, makes API calls, or opens non-.gofiles.
Quick Start
# Install
brew install ozgurcd/tap/gograph
# Build the graph
gograph build . --precise
# Try it — who calls ValidateToken?
gograph callers "ValidateToken"
# Full context in ONE call (node + source + callers + callees + tests)
gograph context "ValidateToken"
# Change plan before editing (callers, tests, routes, SQL, env risk)
gograph plan "ValidateToken"Related MCP server: Axon
Why gograph?
Benchmarked on gograph's own codebase (70 files, 518 symbols, 16 packages):
Task |
|
| Savings |
Find callers of | 158 noisy lines (comments, docs, vars) | 56 exact structural call sites | ~65% noise eliminated |
Locate symbol definitions | 842 lines matching "Symbol" | 83 true type/method declarations | ~90% noise eliminated |
Read one function body |
|
| ~93% fewer tokens |
Understand a symbol fully | 4–5 separate tool calls | 1 call: | 80% fewer tool calls |
Key Features
50+ Query Tools — callers, callees, impact, context, plan, review, errorflow, orphans, hotspot, coupling, and more. Full command reference →
Native MCP Server — all tools available as MCP endpoints for Claude, Cursor, Copilot, and any MCP-compatible agent. One command setup: gograph add-claude-plugin
Token-Saving Composites — context replaces 5 calls. plan replaces 8. explain synthesizes architectural narratives. Built to minimize agent round-trips.
Safe by Design — no network, no code execution, no secrets, no .env files read. AI worktree directories (.claude/, .cursor/, .agents/) auto-excluded.
Architecture Enforcement — boundary rules, API drift detection, complexity gates, dead code sweeps, god-object detection, coupling analysis. Run in CI with gograph gate.
Agent Compliance Auditing — session telemetry tracks whether agents run plan before edits and review after. Grades agent behavior A–F with actionable recommendations.
Command Reference
All commands support --json for machine-readable output and --files-only for flat file lists.
Category | Commands | What it does |
Indexing |
| Parse AST, write graph. Check freshness. Index health. |
Navigation |
| Find symbols, trace call chains, extract source. |
Context |
| Bundled structural data in one call. Token savers. |
Change Analysis |
| Pre-edit planning, post-edit review, risk analysis, blast radius, drift. |
Architecture |
| Quality gates, dead code, coupling, god objects. |
Types & Structs |
| Struct fields, interface satisfaction, type usage. |
Infrastructure |
| HTTP routes, SQL, env vars, concurrency, outbound HTTP calls, imports. |
Testing |
| Test coverage map, helpers, mock implementations. |
Error Tracing |
| Reverse-BFS from error strings to HTTP entry points. |
Diagnostics |
| Hotspots, return usage, API signatures, Mermaid diagrams. |
CI/CD |
| Policy checks, threshold enforcement, metric snapshots. |
Telemetry |
| Agent compliance tracking and grading (A–F). |
LLM-Wiki |
| Generate |
Summary |
| Single-call codebase briefing: top 3 hotspots, worst instability package, highest complexity function, orphan count, god-object count. Replaces 5 separate calls. |
Untested |
| Functions with callers but zero test edges — coverage gaps invisible to orphans or per-symbol test queries. One sweep replaces N |
Doc |
|
|
Full command reference with examples: gograph.identuum.ai/docs/command-reference
Define boundaries in .gograph/boundaries.json:
{
"layers": [
{ "name": "domain", "packages": ["internal/domain/**"], "may_import": [] },
{ "name": "handler", "packages": ["internal/handler/**"], "may_import": ["internal/service/**", "internal/domain/**"] }
]
}Run gograph boundaries — exits with code 1 on violation. Works in CI/CD.
AI Agent Integration
One-command setup (Claude Desktop + Claude Code):
gograph add-claude-pluginThis registers the MCP server, injects CLAUDE.md steering rules, and installs a PreToolUse hook that redirects grep on Go symbols to gograph tools.
Alternative — install via Claude Code plugin marketplace:
/plugin marketplace add ozgurcd/gograph
/plugin install gograph@gographDiscovers gograph through Claude Code's plugin marketplace and ships a SKILL.md that auto-activates on Go work, teaching the agent the mandatory workflow (capabilities → build → plan → context → review) and that grep/rg/find must not be used for Go symbol search.
You still need the gograph binary installed (brew install ozgurcd/tap/gograph or go install github.com/ozgurcd/gograph@latest). Use gograph add-claude-plugin above for the full one-command bootstrap (MCP wiring + CLAUDE.md rules + PreToolUse hook). Use the plugin marketplace when you'd rather discover and install gograph from inside Claude Code's plugin UI.
Other agents (Cursor, Copilot, Antigravity, etc.):
gograph mcp . # Run as MCP server over stdioAdd to your .cursorrules or AI system prompt:
Before answering architecture or repository questions, inspect the available
gograph_*MCP tools and use them instead of grep/find. Rungograph capabilitiesfirst.
All commands support --json for machine-readable output:
gograph callers "ValidateToken" --json
# → {"schema_version": "1", "command": "callers", "status": "ok", "count": 2, "results": [...]}For full integration guides, see docs/coding-agent-usage.md.
Zero-cost orientation with llm-wiki/: Run gograph wiki once per session to generate a directory of machine-first markdown pages — overview, architecture diagram, hotspots, routes, env vars, error sites, concurrency, per-package docs, and the full API surface. Agents read these pages instead of issuing dozens of individual tool calls:
gograph build . --precise
gograph wiki # writes to ./llm-wiki/
# then read: llm-wiki/README.md → project.md → rules.md → agent-contract.md → overview.mdAdd llm-wiki/ to .gitignore — these files are regenerated each session.
Example Output
When you run gograph build ., the generated GRAPH_REPORT.md gives your AI a condensed context map:
External Dependencies (Tech Stack)
Module | Version |
|
|
|
|
Important Symbols (Top by outgoing calls)
Symbol | Kind | File | Line | Calls out |
| method |
| 42 | 18 |
| function |
| 12 | 14 |
Why not use a Language Server (gopls)?
gopls is optimized for human IDEs. gograph is optimized for terminal-based LLMs:
Protocol Mismatch —
goplsreturnsfile:line:colcoordinates. Agents must then burn tokens runningcat/sedto read the actual code.gographextracts the exact structural slice and formats it as Markdown.Graph-Level Diagnostics —
goplsdoes hover and go-to-definition.gographdoes reverse-BFS error tracing, full blast radius analysis, and PR-level change plans across the entire call graph.Composable Intelligence —
goplsanswers one question at a time.gograph contextbundles node + source + callers + callees + tests in a single call.gograph planaggregates impact, routes, SQL, env, and test risk into one checklist.
Default mode uses Go AST parsing and best-effort heuristics. Tolerates incomplete or non-compiling repositories.
Precise mode uses type-checked enrichment and requires compilable packages.
Heuristic extractors (routes, SQL, tests, error mapping) are navigation aids, not authoritative program analysis.
No multi-language parsing
No AI/model API calls
No embeddings or SaaS backend
No telemetry
No replacement for compiler/type-checker correctness
Contributing
Pull requests welcome! See CONTRIBUTING.md for build, test, and contribution guidelines.
Language Support:
gographcurrently parses Go only. The architecture is extensible — if you want to add Python, TypeScript, Rust, etc., please open an issue first.
License
MIT — see LICENSE.
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ozgurcd/gograph'
If you have feedback or need assistance with the MCP directory API, please join our Discord server