Gograph logo

Gograph

by ozgurcd

Analyze Go repositories with AST and call-graph queries, blast-radius analysis, test selection, Mermaid output, and MCP tools.

Install Gograph

Run the project’s own setup commands, in order.

Setup steps from the project

ozgurcd/gograph installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    brew install --cask ozgurcd/tap/gograph
    
  2. 2. Start the server
    gograph mcp . --persist-refresh
    

Overview

ozgurcd/gograph builds a local AST-based graph of a Go repository, with optional type-checked CHA/SSA enrichment for call, dependency, API, and test analysis. Its built-in stdio MCP mode exposes repository queries and workflows to AI agents, while the CLI supports impact analysis, targeted tests, Mermaid diagrams, security-flow tracing, and architecture gates. Reach for it when an agent needs structural codebase context instead of text-only search, especially for Go repositories. Analysis stays local, does not execute target code, and does not send source or telemetry to external services.

Use cases

  • Trace callers and callees before changing a Go symbol
  • Select tests affected by uncommitted changes
  • Render Mermaid dependency and call-graph diagrams
  • Enforce package boundaries and architecture policies in CI
  • Investigate security paths from inputs to sensitive sinks

Key features

  • AST and optional CHA/SSA repository graphs
  • Call-graph and blast-radius queries
  • Change-scoped test selection and coverage analysis
  • Built-in stdio MCP server
  • Mermaid, JSON, and file-only graph output
  • Architecture gates and security-flow tracing

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

21/21 checks healthy over the last 112d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars233Stargazers on the source repository.
Last commit5d agoMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Gograph works

What ozgurcd/gograph does

ozgurcd/gograph analyzes Go repositories as structured graphs rather than treating them as collections of text files. It indexes syntax and can add type-checked call relationships through CHA/SSA analysis. Queries can cover symbols, callers and callees, interface implementations, struct field mutations, HTTP routes, static PostgreSQL queries, error origins, package coupling, and dependency paths.

The project combines a command-line interface with a built-in stdio MCP server. The CLI supports repository summaries, hotspot and coupling reports, blast-radius analysis, source extraction, targeted test selection, coverage-gap reports, API comparison, package-boundary checks, architecture policies, and Mermaid graph output. MCP exposes the repository query, analysis, and workflow capabilities as project tools, along with session lifecycle tools. A separate workspace mode can query multiple independently indexed repositories through a deterministic cross-repository overlay.

How it works

Run gograph build . to create the repository graph. Adding --precise enables type-checked CHA/SSA enrichment; --strict makes a precise build fail if it falls back. The CLI stores its normal graph under .gograph/graph.json and uses metadata to determine whether a rebuild is needed. Queries can target symbols by name or by selectors such as path/to/file.go:Name and file.go:Receiver.Method.

gograph mcp . starts the built-in stdio server without requiring a separate build command. It creates an in-memory graph on first use and incrementally reparses changed packages before answering queries. Starting it with --persist-refresh enables disk persistence for refreshes. The CLI can also inspect another commit, branch, or tag with --rev, and can emit structured JSON, file-only results, or Mermaid diagrams for supported analyses.

Test selection follows changed code through the graph and can produce runnable go test -run commands. Options support transitive selection, package narrowing, skipping tests that already passed on identical inputs, early stopping, and coverage reports. Security-flow analysis traces configured source-to-sink paths, while architecture commands evaluate import boundaries and policy thresholds.

Setup and configuration

Install with Homebrew:

bash
brew install --cask ozgurcd/tap/gograph

Or install the command with Go:

bash
go install github.com/ozgurcd/gograph/cmd/gograph@latest

Build and inspect a repository with:

bash
gograph build . --precise
gograph stats
gograph doctor --json

Start the MCP transport from the repository directory with gograph mcp .. The Go toolchain is used for module and package-loading context. Offline operation can be configured with GOPROXY=off GOTOOLCHAIN=local. Build selection also supports tags, excluded directories, low-memory mode, and an explicit memory limit. Architecture gate thresholds are configured in .gograph.yml; security-flow sanitizer rules use gograph/flow.json.

Tools and capabilities

  • Trace direct and transitive callers, callees, paths, and interface implementations.
  • Identify changed-code test targets and untested production paths.
  • Render graph slices as text, JSON, file lists, or Mermaid diagrams.
  • Inspect repository hotspots, coupling, flows, and package relationships.
  • Enforce package boundaries, complexity limits, instability limits, and other policy predicates.
  • Compare exported API surfaces against a revision and analyze workspace-wide relationships.

Limitations and notes

Analysis is local: gograph does not run target code or transmit source or telemetry to hosted services. Precise analysis depends on the installed Go toolchain and the repository's build context. Files excluded from that context can still be printed with source queries but are not indexed. MCP refreshes are in memory by default, while persistence requires the explicit --persist-refresh option. Workspace member refresh and overlay publication are CLI mutations; the workspace MCP tools are read-only.

The CLI and MCP interfaces have different scopes. Process, host, artifact, build, validation, gate, snapshot, installation, startup, version, and help operations remain CLI-only, while repository analysis and workflow commands have MCP equivalents.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gograph

ozgurcd/gograph is an MCP server that connects AI agents to a locally indexed Go repository graph. Its main tools query symbols, callers, callees, dependencies, tests, paths, architecture relationships, and workflow results, with optional precise CHA/SSA analysis. It runs over stdio, builds graphs locally, and avoids executing target code or sending source externally.

Install gograph with Homebrew or Go, then run `gograph mcp .` from the target repository. Homebrew uses `brew install --cask ozgurcd/tap/gograph`; the Go installation uses `go install github.com/ozgurcd/gograph/cmd/gograph@latest`. MCP mode builds an in-memory graph on first use.

It can analyze callers, callees, transitive paths, interface implementations, struct field mutations, HTTP routes, static PostgreSQL queries, error origins, package coupling, hotspots, API surfaces, test reachability, and configured security flows. Precise mode adds type-checked CHA/SSA graph information.

Yes. `gograph tests --uncommitted` selects tests related to local changes and can emit runnable `go test -run` commands. Options support transitive depth, package filtering, skipping tests already passed on identical inputs, early stopping, and coverage reports for changed lines.

Yes. Analysis is local, and offline runs can set `GOPROXY=off GOTOOLCHAIN=local`. The tool still invokes the installed Go toolchain for module and precise package-loading context, but it does not transmit source or telemetry to external services.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGograph AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ozgurcd-gograph?style=directory)](https://allmcps.com/mcp/ozgurcd-gograph)
HTML Embed
<a href="https://allmcps.com/mcp/ozgurcd-gograph"><img src="https://allmcps.com/api/badge/ozgurcd-gograph?style=directory" alt="Gograph on AllMCPs" /></a>