# CGIS Code Graph [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/zaebee/codegraph-brain  
**GitHub Stars:** 1  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/cgis-code-graph

## Description
Code graph for AI agents: impact analysis and call tracing for Python and TypeScript.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "cgis-code-graph": {
    "command": "uvx",
    "args": ["--from","codegraph-brain","cgis"]
  }
}
```

## Documentation

## 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:

```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.

_Full upstream README: https://allmcps.com/mcp/cgis-code-graph/readme_

