CGIS Code Graph logo

CGIS Code Graph

Builds a local code graph for Python and TypeScript to trace calls, assess impact, and inspect repository structure through MCP.

Install CGIS Code Graph

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "cgis-code-graph": {
      "command": "uvx",
      "args": [
        "--from",
        "codegraph-brain",
        "cgis"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

CGIS Code Graph parses repositories into a SQLite graph of fully qualified symbols, calls, imports, and containment relationships. Its MCP tools let agents ingest or refresh a graph, find symbols, trace callers and callees, inspect structure, and evaluate metrics or graph integrity. Reach for it when repository-scale dependency analysis is more useful than grep, file retrieval, or single-hop symbol lookup. It runs locally through stdio, with no account or telemetry required for normal operation.

Use cases

  • Trace callers before modifying a function
  • Find downstream calls from a method
  • Locate fully qualified symbols in a repository
  • Inspect coupling and package cohesion
  • Audit handler reachability to authorization guards

Key features

  • SQLite-backed repository code graph
  • Python and TypeScript/TSX call and import analysis
  • Transitive impact and flow tracing
  • Graph structure, metrics, drift, and integrity analysis
  • Optional graph-aware pull-request review with Guardian

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.

13/13 checks healthy over the last 55d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 15d ago via OSV.dev · codegraph-brain (PyPI)

Adoption & maintenance

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

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

How CGIS Code Graph works

What CGIS Code Graph does

CGIS Code Graph gives AI agents a queryable representation of a source repository rather than requiring them to infer relationships from file text. It records symbols and the relationships between them, including calls, imports, and containment. Agents can use that graph to investigate change impact, follow execution flow, locate symbols by partial name, and obtain compact graph-based context.

The primary language coverage is Python and TypeScript, including TSX. Go is parsed for structure and metrics, but its impact results are intended as leads to verify against source code. JSON and YAML can contribute data-key declarations when data-key processing is enabled; they do not produce symbols, calls, or impact relationships.

The project also includes Guardian, a graph-aware pull-request reviewer. Guardian uses graph context alongside a diff, supports local Ollama inference or cloud providers including Mistral, Gemini, and Claude, and can post inline comments over HTTPS when configured with a GitHub token.

How it works

Tree-sitter-based extractors read source files and produce graph nodes plus raw call edges. A resolver then maps calls to fully qualified names where the source permits; unresolved edges remain explicitly marked rather than being assigned guessed targets. SQLite stores the resulting graph, and queries traverse it with breadth-first searches.

The resulting database supports both direct command-line queries and MCP requests. An ingestion run can create a graph or incrementally refresh one. Impact analysis walks upstream callers, while flow tracing follows downstream calls. Output can be rendered as text, Mermaid, or JSON for supported CLI operations.

Setup and configuration

The fastest installation path uses uvx, which fetches the codegraph-brain package from PyPI without requiring a local clone or build. The MCP configuration uses the cgis-mcp entry point:

config.json
{
  "mcpServers": {
    "cgis": {
      "command": "uvx",
      "args": ["--from", "codegraph-brain", "cgis-mcp"]
    }
  }
}

Claude Code can install the project through its marketplace integration, which also supplies a skill and an /cgis:ingest command. For terminal use, run uvx --from codegraph-brain cgis ingest ./my-project --output graph.db, or install the package with pip install codegraph-brain and use the cgis command directly. The package requires Python 3.12 or newer.

Tools and capabilities

The MCP interface includes tools for ingestion, repository overviews, partial-name symbol search, impact analysis, flow tracing, hierarchy inspection, GraphRAG context generation, metrics, reachability auditing, drift analysis, and graph validation. Metrics cover coupling, god classes, PageRank, and package cohesion. Reachability auditing checks whether handlers reach their authorization guard, while drift analysis compares domains with declared patterns.

Guardian uses a two-pass review process: a recall-oriented finder identifies possible defects, and a skeptic pass filters false positives. It can use different models for those stages, including a local model for one stage and a cloud model for the other. Inline placement is based on quoted diff text rather than a model-generated line guess.

Limitations and notes

Impact quality depends on resolution. Calls that cannot be mapped remain unresolved and are reported by validation rather than silently converted into likely targets. Go impact analysis has only been evaluated as a structural lead on a limited library corpus, so application-level results should be confirmed by reading the code.

The graph is local by default and remains on disk. Guardian is a separate review workflow that may contact configured model providers and GitHub when enabled. JSON and YAML support is limited to optional data-key declarations, and does not provide general code relationships.

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 CGIS Code Graph

CGIS Code Graph is an MCP server that connects AI agents to a local SQLite graph built from source repositories. Its main tools ingest code, find fully qualified symbols, analyze upstream impact, trace downstream calls, inspect structure, generate graph context, calculate metrics, audit reachability, analyze drift, and validate graph integrity.

Install it through `uvx` without cloning the repository, or use `pip install codegraph-brain` with Python 3.12 or newer. Configure an MCP client to run `uvx --from codegraph-brain cgis-mcp`; Claude Code also provides a marketplace installation.

Run `uvx --from codegraph-brain cgis ingest ./my-project --output graph.db`, replacing the path with your repository. The ingestion process parses the source, resolves calls where possible, and stores the graph in SQLite.

Yes. Cursor is listed as a supported MCP client through the standard configuration that runs `cgis-mcp` with `uvx`. The same setup pattern is also shown for Claude Desktop and other MCP clients.

Yes, with narrower coverage. Go supports structure and metrics, while its impact results should be treated as leads to verify. JSON and YAML can provide data-key declarations when data-key processing is enabled, but do not provide symbols, calls, or impact analysis.

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 PreviewCGIS Code Graph AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/cgis-code-graph?style=directory)](https://allmcps.com/mcp/cgis-code-graph)
HTML Embed
<a href="https://allmcps.com/mcp/cgis-code-graph"><img src="https://allmcps.com/api/badge/cgis-code-graph?style=directory" alt="CGIS Code Graph on AllMCPs" /></a>