Skip to content
verify mcp Beta VerifyMCP is currently in beta. If you notice any issues, get in touch and we’ll put it right.

CGIS Code Graph

PYPI · CODEGRAPH-BRAIN

Code graph for AI agents: impact, call tracing in Python, TypeScript, Go; opt-in JSON and YAML keys

Available components

−15 this week 77 Trust /100

Last scanned (15 minutes ago)

Scores higher than 74% of PyPI servers

Category Developer Tools

Trust breakdown (7 categories)

How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score → Why this is hard to score →

Supply Chain Security50
  • Malware scan not yet available for this package.Unverified
  • No known CVEs affecting this package version or its production dependencies.Pass
  • Runs hatchling.build at install time, a recognised build step with no custom scripting around it. View diagnostics → Pass
  • 4 of 45 dependencies flagged as unhealthy. View diagnostics → Partial
Provenance & Transparency97
  • Source repository is publicly reachable at the declared URL. View diagnostics → Pass
  • Cryptographically verified build provenance (signed, bound to zaebee/codegraph-brain). View diagnostics → Pass
  • Clear OSI-approved license (MIT).Pass
  • Actively maintained (last published 4 days ago).Pass
  • Disclosure check failed: no security disclosure policy was found in the source repository. See how to fix → Fail
Schema Quality & AI Usability60
  • AI-judged instruction clarity (excellent).Pass
  • Context-footprint check failed: tool/resource definitions use about 8605 tokens (~506/item across 17 items; 17 tools + 0 resources), over budget; trim descriptions and params. See how to fix → Fail
  • Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management100
  • No destabilizing schema changes in the last 30 days.Pass
Tool Coverage100
  • 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
  • 100% of tool parameters carry a description.Pass
  • Structured output schemas are declared (100% of tools); any adoption earns full credit.Pass
Tool Safety100
  • No prompt-injection markers were found in the server instructions, tool names or descriptions we captured.Pass
  • We read all 17 captured tool definition(s), and no name or description among them implies an irreversible operation.Pass
  • An AI judge read all 18 captured unit(s) of tool text and found none that tries to manipulate the model reading it.Pass
Capabilities100
  • Implements a current MCP spec version (2026-07-28).Pass
Changelog

Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.

  • 5 Nov 26 −15
    • Malware scan: pass → unverified ▼ security
  • 1 Nov 26 +15
    • Malware scan: unverified → pass ▲ security
  • 31 Oct 26 −15
    • Malware scan: pass → unverified ▼ security
    • Package version: 0.38.0 → 0.39.2 functional
    • Package version: 0.38.0 → 0.39.1 functional
    • Package version: 0.38.0 → 0.39.0 functional
  • 25 Oct 26 0
    • Stability: 0.97 → pass security
    • Package version: 0.29.0 → 0.38.0 functional
  • 24 Oct 26 +15
    • Malware scan: unverified → pass ▲ security
    • Stability: pass → 0.97 functional
  • 23 Oct 26 0
    • Malware scan: unverified → pass ▲ security
    • Package version: 0.36.0 → 0.38.0 functional
  • 22 Oct 26 +10
    • Malware scan: unverified → pass ▲ security
    • Provenance: unverified → pass ▲ security
    • The attested source repository moved: zaebee/codegraph-brain security
    • Package version: 0.35.0 → 0.36.0 functional
  • 21 Oct 26 −25
    • Provenance: pass → unverified ▼ security
    • Malware scan: pass → unverified ▼ security
    • The attested source repository moved: zaebee/codegraph-brain security
    • Schema quality: 7347 → 8192 ▼ functional
    • Package version: 0.34.0 → 0.35.0 functional
    • Package version: 0.29.0 → 0.34.0 functional
Diagnostics

Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.

Captured 5 Nov 2026 · Analysed pypi/codegraph-brain@0.39.2

Provenance Verified

A signed build attestation was found and verified, binding this exact artifact to the source repository it claims to come from.

Result Verified
Ecosystem pypi
Reason Verified
Discovered via Registry attestation endpoint
Source repo zaebee/codegraph-brain
Certificate issuer https://token.actions.githubusercontent.com
Certificate SAN https://github.com/zaebee/codegraph-brain/.github/workflows/release-please.yml@refs/heads/main
Rekor log index 3613939293
Predicate type PyPI publish attestation https://docs.pypi.org/attestations/publish/v1
Subject digest sha256:fabf2ab8cde9c6dd5b63b28be60839f28a3c59742069595ff868ae59efd819a8

Background: How many MCP packages publish verified provenance →

Install scripts 1 script
Hook Tier Command
build_backend allowlisted hatchling.build

Background: Why install scripts are a supply-chain risk →

Dependencies 45 packages
Packages resolved 45
Stale 3
No linked repository 1
Tree resolution Complete

Background: SBOMs and build attestations, explained →

MCP tools · 17 exposed · ~7,568 tokens

The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability. A tool's description is untrusted text the model reads on every call, which is what makes this list a security surface and not just an inventory: how tool poisoning works →

Tool Tokens
cgis_analyze_impact ~841

Upstream subgraph of one FQN: everything that reaches it within ``depth`` hops. Follows every edge except containment — in practice callers, importers, subclasses, type references and DI dependents — within internal code, so this answers "what breaks if I change X?". The enclosing class or file and stdlib/third-party nodes are left out unless ``include_structure`` / ``include_external`` ask for them — the same view as the CLI's ``impact``. Test callers are left out unless ``include_tests`` asks for them, and counted in ``excluded_tests``. A file that imports a symbol is listed, but the walk does not continue to the files importing that file; a file's own impact still does. At most ``max_nodes`` nodes come back, nearest first, and a cut is reported in ``truncated``. For what X depends on use ``cgis_trace_flow``; for only the members of a module or class, ``cgis_get_structure``; for a source-included brief to read before editing one symbol, ``cgis_context``. ``output_format="text"`` returns an indented tree of callers, one line per node — the compact form to read; ``"mermaid"`` (default) returns a diagram; ``"json"`` returns a joinable ``{root, nodes, edges, coverage}`` payload with real FQNs — letting an agent compute set differences (e.g. "which route handlers never reach ``verify_ownership``?") directly. ``coverage`` counts unresolved calls whose name matches a traversed function, method or class: callers that may be missing, named in ``top_unresolved``. It is an upper bound — a common name matches calls on unrelated objects, which the names make visible.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
depthinteger–Maximum edge hops upstream, over callers, importers, subclasses, type references and DI dependents (plus the enclosing class or file with include_structure). A hop from an override to the base or int…
fqnstringyesFully qualified name, e.g. pkg.module.Class.method. A unique dot-boundary suffix also resolves; an ambiguous one returns candidates. Use cgis_find_symbol to look a name up.
include_externalboolean–Also return stdlib, third-party and unresolved call targets — calls on values whose type is decided at runtime. Off by default, as in the CLI, because they dominate the payload; in json, coverage/top…
include_structureboolean–Also follow containment (CONTAINS/DECLARES): a module's or class's own members, and the class or file enclosing a symbol. Off by default, as in the CLI; cgis_get_structure is the tool for members alo…
include_testsboolean–Also return test code. Off by default: on a large repo tests outnumber the production code an answer is about. The answer says how many were left out — a floor when it is also truncated, since levels…
max_nodesinteger–Most nodes to return, nearest levels first. A level that does not fit is cut and the walk stops there; the answer says where and how many were left out, so a smaller depth or a narrower FQN can follo…
output_formatstring–"text" for an indented tree, one line per node — the cheapest to read; "mermaid" for a diagram; or "json" for a payload with real FQNs, to compute with (case-insensitive). Any other value returns an…
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_audit_reachability ~425

Reachability/authorization audit — which sources never reach a checkpoint. The headline use is **IDOR/authz coverage**: list every route handler that does NOT transitively reach an ownership check. Reachability follows behavioral edges (CALLS *and* FastAPI ``Depends()`` DEPENDS_ON), so a guard wired via DI counts. Select sources with ``from_type`` (the ``ROUTE_HANDLER`` role — FastAPI handlers on a router built in the same module — or a NodeType like ``FUNCTION``) and/or ``from_prefix`` (FQN prefix) — at least one is required. Returns JSON ``{target, covered, gaps}`` where each gap carries ``fqn``/``file``/``line``. Generalizes to validators, event tracking, or service-layer-boundary rules by pointing ``target`` at the required node. A selection that matches no source returns a ❌ message, not an empty ``{covered: [], gaps: []}`` that would read as a passing audit (#467).

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
depthinteger–Maximum reachability depth; a longer path is reported as a gap.
from_prefix––Only audit sources at or under this FQN prefix, matched on whole dot-segments. A selection matching no source is an error naming the whole-segment prefixes it may have meant. Combined with from_type…
from_type––NodeType or role of the sources to audit (any case): ROUTE_HANDLER selects FastAPI handlers on a router built in the same module; a structural type such as FUNCTION selects by type. Give this, from_p…
targetstringyesFQN of the checkpoint every source must reach, e.g. an ownership check. A unique dot-boundary suffix also resolves.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_context ~449

Prompt-ready brief on one FQN: its source, class, direct callers and callees. Call this before editing a symbol, instead of reading its files. It follows calls only, one hop by default. Source is included when the file is found (see ``source_root``), and the domain when the graph was tagged with one. For a multi-hop subgraph over calls, imports, inheritance and references without source, use ``cgis_trace_flow`` (downstream) or ``cgis_analyze_impact`` (upstream). Returns an XML-tagged prompt — the focal node's source, its enclosing class, its architectural domain boundary, direct callers (upstream ripple) and callees (downstream dependencies) — meant to be injected into your context window in place of raw file dumps. Far more token-efficient than reading whole files, and structured so boundaries stay unambiguous. Use ``cgis_ingest`` first if the database does not exist. ``source_root`` locates source files on disk when the graph was ingested from a sub-directory (e.g. ``"src"`` after ``cgis ingest ./src``); it is safe to pass even when the stored paths already start with that segment (#228). When no candidate exists the ``<source>`` block degrades gracefully to "unavailable".

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
depthinteger–Call hops around the focal node; 1 means direct callers and callees.
fqnstringyesFully qualified name, e.g. pkg.module.Class.method. A unique dot-boundary suffix also resolves; an ambiguous one returns candidates. Use cgis_find_symbol to look a name up.
source_rootstring–Directory the graph's stored file paths are relative to — normally the project_path given to cgis_ingest; prefer an absolute path. Empty means the server's working directory, so source shows as unava…
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_diff_check ~526

What else depends on what a diff changed: subclasses, callers and data keys. Call this before review or merge. It reads the lines ``base..head`` changed, finds the graph symbols they fall in (and symbols the diff removed, read from the base text), and lists the classes that extend a changed class and the functions that call a changed or removed function. For each data key the changed lines read, write or declare (``doc["avatar"]``, a mapping field) it lists the key's other readers, writers and declarers, reads of a dotted path a mapping does not declare, and reads of a declaration the diff removed; common keys (``id``, ``name``, or used in many files) are left out. Key items need a graph ingested with data keys on (``cgis_ingest(data_keys=True)`` or ``cgis ingest --data-keys``); on a graph without them the answer says so and lists subclasses and callers only. Sites in test files are counted, not listed. An empty list means no static dependants were found, not that the change is safe: dispatch the graph cannot see is not covered. How to read the list: caller and subclass items are leads to read; data-key items are noisy — measured on one application (owner-api), about a quarter of listed items were worth a look (docs/lab-notes/2026-10-19-data-key-diff-check.md). Before judging a code site that reads or writes a key unaffected, read its callers (cgis_analyze_impact): they decide what values reach it.

NameTypeReqDescription
basestring–Base revision of the diff, e.g. origin/main or a sha.
capinteger–Items listed; the rest are only counted.
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
headstring–Head revision of the diff.
output_formatstring–'text' or 'json'.
prefix––The path of the ingested directory inside the repository (e.g. 'src' after cgis_ingest of ./src); empty when the repository root was ingested. Left out, it comes from the root the graph recorded at i…
repo_pathstringyesGit repository holding the diff; prefer an absolute path.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_drift ~392

Report per-domain architectural drift against declared ideal patterns. Returns JSON: ``any_critical`` verdict, per-domain reports (each carrying a ``fit`` block — nearest alphabet template + residual + good/weak/none band), the observe-only quotient layer, and ``coverage`` (graph prefixes bound by no domain). Call after ``cgis_ingest`` to learn whether your edits pushed a domain past its drift tolerance. ``max_drift`` is now the default tolerance only for domains that omit ``drift_tolerance`` — it no longer caps domains that declare their own (see #170). ``profile``: when set, score only domains with this profile (plus profile-less ones). Use when your patterns.yaml mixes languages but the graph holds one language — avoids false EMPTY reports for other-language domains that would otherwise fail the gate. ``max_residual``: a domain whose nearest template is farther than this gets ``fit.band = "none"`` ("no template fits") — a grab-bag module or an alphabet gap, independent of drift tolerance (#177).

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
max_driftnumber–Drift tolerance for domains that declare no drift_tolerance of their own.
max_residualnumber–Distance to the nearest template beyond which a domain's fit band is "none" (no template fits).
patterns_pathstring–patterns.yaml (.yaml or .yml) declaring each domain's expected pattern and tolerance, relative to the server's working directory. cgis_init_ontology proposes one.
profile––Score only domains with this profile, plus profile-less ones — e.g. one language when patterns.yaml mixes several.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_find_orphans ~729

Classes nothing in production builds, extends or names — dead-code candidates. Finds classes that no test, type checker or linter flags, because each is still imported somewhere: a package re-export keeps a class importable long after its last real caller is gone. On one mid-sized backend this reported 43 of 1 789 classes, and the hand-written equivalent's findings were all real and all deleted. Two filters decide the answer. **Tests are not users** — a class built only by its own test is exactly the shape being hunted. **A re-export is not a use** — ``IMPORTS_SYMBOL`` does not count, or nothing is ever reported. What counts is construction (``CALLS``), inheritance (``EXTENDS``) and being named (``REFERENCES`` — an annotation, or a class handed to a framework); the last keeps abstract ports and Protocols off the list. ``prefix`` narrows to one package on a dot boundary. ``include_tests`` counts test code as a user, turning the report into "unreachable from anywhere". Machine-generated classes are **hidden by default**, and ``include_generated`` puts them back. The query is right about them — nothing constructs a betterproto stub — but nobody hand-deletes one either, so they are noise rather than a finding. Measured on owner-api at b7d02fe6, five of six reported orphans were generated entities and the sixth a nested pydantic ``Config``: the unfiltered report had no actionable row in it (#432). Only **module-level** classes are considered by default; ``include_nested`` adds classes defined inside a class or function. Across eight measured repositories none of the 46 nested rows was dead: most were a ``Meta`` / ``Config`` a metaclass reads, the rest live classes reached as ``self.Nested(...)``, which the resolver does not follow (#432). Returns JSON ``{orphans, considered, test_sources, generated_excluded, nested_excluded}``; each orphan carries ``fqn``/``file``/``line``. **A listing is a candidate for deletion, not a proof** — a class named only inside a decora…

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
include_generatedboolean–Include machine-generated classes, which are hidden by default.
include_nestedboolean–Include classes nested in a class or function, which are hidden by default.
include_testsboolean–Count test code as a user, so the report means "unreachable from anywhere".
prefix––Only consider classes under this FQN prefix, cut on a dot boundary.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_find_symbol ~342

Resolve a partial symbol name to candidate FQNs (substring match, ranked). Call this BEFORE ``cgis_trace_flow`` / ``cgis_analyze_impact`` / ``cgis_get_structure`` when you know a short name (e.g. ``get_reservation_prices``) but not its full FQN — it removes the read-the-file-first guesswork. Returns JSON ``[{fqn, name, type, file, line}]`` ranked exact > prefix > substring. ``kind`` filters by node type (FUNCTION / METHOD / CLASS / …); ``fqn_prefix`` scopes the search. A prefix that starts with the directories the graph was ingested below (``src.cgis`` for a graph of ``src/``) and covers no code is read without them.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
fqn_prefix––Only return symbols at or under this FQN prefix, matched on whole dot-segments: app.svc does not match app.svc_alt, and a partial segment matches nothing.
kind––Only return this node type, e.g. FUNCTION, METHOD or CLASS (any case). An unknown type matches nothing rather than raising an error.
limitinteger–Maximum number of candidates to return.
querystringyesLeaf symbol name to search for, without dots (e.g. get_flow_result) — not an FQN. Case-insensitive substring match, ranked exact > prefix > substring.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_fractal ~280

Report the motif census across the repository's structural tiers. Coarsens the graph along its own structure — symbol, class, module, then directory levels trimmed from the leaf end — and measures the 13-triad census at every rung. Returns JSON: one entry per layer (IMPORTS, CALLS) with the full per-rung curve (groups, triads, entropy in bits, dominant motif, tangle ratio) and the fit. ``verdict`` is the sign of ``slope`` (entropy bits per halving of the group count) outside a ``2 * std_error`` dead-band: ``hierarchical`` means coarsening ADDS motif diversity, ``flat`` means it destroys it, ``scale_invariant`` means the mix is the same at every scale, and ``no_signal`` means fewer than three rungs carried enough triads to fit. Read the curve, not just the verdict — the fit is a lossy summary of a non-linear curve. Observe-only: this tool enforces nothing and no gate reads it. Call after ``cgis_ingest``.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_get_structure ~359

Members of a module or class — or, for a package prefix, the modules it holds. Follows containment (CONTAINS/DECLARES) only, so no call or import appears. A package is not a node in the graph (#487), so its row and the edges to its modules are synthesized for the answer and marked with a virtual file path. For how the code connects use ``cgis_trace_flow`` (what it depends on) or ``cgis_analyze_impact`` (what depends on it). Matches the CLI ``structure`` command. ``output_format="text"`` returns the hierarchy as an indented tree, one line per member; ``"mermaid"`` (default) a diagram of the hierarchy rooted at the given FQN; ``"json"`` the joinable ``{root, nodes, edges}`` payload with real FQNs.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
depthinteger–Maximum containment levels to descend (module → class → method).
fqnstringyesFully qualified name, e.g. pkg.module.Class.method. A unique dot-boundary suffix also resolves; an ambiguous one returns candidates. Use cgis_find_symbol to look a name up.
output_formatstring–"text" for an indented tree, one line per node — the cheapest to read; "mermaid" for a diagram; or "json" for a payload with real FQNs, to compute with (case-insensitive). Any other value returns an…
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_ingest ~446

Scan a local directory, extract all symbols, resolve links, and build the graph DB. Use this to initialise or refresh the code knowledge graph for a project. Node FQNs are normalised relative to the workspace root so the graph is portable across machines. ``db_path`` must name a database — it has to end in ``.db``, ``.sqlite`` or ``.sqlite3``, live in a directory that already exists, and not point at an existing file that is not a SQLite database. cgis will not create parent directories. By default the ingest is **incremental**: only changed/new files are re-scanned, and the summary reports both what changed this run and the whole-graph total. When a change alters what other files resolve against — a renamed, removed or added symbol, a deleted or new file, a changed base class or re-export — the incremental run rebuilds the whole graph itself, so edges in unchanged files never point at symbols that no longer exist. Set ``full_rebuild=True`` to force a re-scan of every file from scratch. Data keys are opt-in (``data_keys=True``): they cost every ingest time and graph size, and make JSON and YAML edits mark the graph stale.

NameTypeReqDescription
data_keys––Extract data keys (Python dict keys, JSON and YAML declarations) for cgis_diff_check. Off by default. Left out, an existing graph keeps the mode it was built in, and a new one takes CGIS_DATA_KEYS=1…
db_pathstring–Where to write the graph: must end in .db, .sqlite or .sqlite3, in a directory that already exists, and must not be an existing non-SQLite file. A relative path resolves against the server's working…
full_rebuildboolean–Re-scan every file from scratch instead of the incremental default.
project_pathstringyesRoot directory of the project to scan. A relative path resolves against the MCP server's working directory.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_init_ontology ~195

Propose a starter patterns.yaml from the measured graph (read-only). Returns the YAML text — save it yourself (e.g. to patterns.yaml), review the proposed labels, then run ``cgis_drift`` with it. Tolerances are the measured scores plus ``margin``: a baseline to ratchet down, not a verdict. No files are written; the caller decides where to persist the output.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
depth––Fixed FQN segment depth for domain discovery (positive); omit to pick it automatically.
marginnumber–Headroom added to each measured score to form the proposed tolerance.
min_nodesinteger–Domains with fewer nodes stay hygiene-only instead of getting a label.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_metrics ~676

Whole-graph architectural metrics — coupling bottlenecks, God classes, PageRank. Returns JSON ``{bottlenecks, god_classes, critical, file_coupling, class_cohesion, resolution}`` computed with vectorized DuckDB aggregations over the whole graph (fan-in/fan-out coupling, declared-member counts, PageRank, per-file Ca/Ce/instability) — the global "what are the hotspots?" view that complements the node-local trace/impact/context tools. Requires the optional ``duckdb`` extra; an unavailable dependency is reported as a normal ❌ message. ``file_coupling`` counts *files*, not calls: Ca is how many other files depend on a file (by IMPORTS or CALLS), Ce how many it depends on, and instability ``I = Ce / (Ca + Ce)`` runs from 0 (stable, expensive to change) to 1 (volatile); it is null for a file linked to no other. ``class_cohesion`` ranks classes by LCOM4: the number of groups their instance methods fall into when linked by a shared ``self`` attribute or a call. 1 is cohesive; 2+ is a class doing unrelated jobs. Dunders (``__init__`` above all), abstract, static and class methods are not counted. ``resolution`` is the share of edges the resolver could not place, by the same rule as ``cgis validate``. Read the rankings through it: a node whose calls are mostly unresolved looks uncoupled because its edges point nowhere. Under ``scope``/``exclude`` it counts the edges the selected code *emits*. ``exclude`` drops any node whose FQN contains one of the given dot-segments (e.g. ``["tests"]`` removes both ``tests.*`` and ``domains.*.tests.*``) so test/vendor scaffolding stays out of the rankings. ``scope`` is its complement: it keeps only nodes under one of the given dot-prefixes, anchored and cut on a dot boundary, so ``["domains.reservation"]`` is that subtree and not ``domains.reservation_archive``. Use it for a per-domain review. The two compose, and they differ where it matters for PageRank — ``exclude`` removes nodes from the propagation graph, ``scope`` filters the rows…

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
exclude––Drop nodes whose FQN contains any of these dot-segments, e.g. ["tests"]; they are removed from PageRank propagation too.
limitinteger–Top-N rows returned per section.
scope––Keep only nodes under any of these dot-prefixes, e.g. ["domains.billing"]; rank still propagates over the whole graph.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_module_graph ~396

How one package is built inside: its modules and the dependencies between them. Nodes are the package's direct children, each sub-package one node (``expand`` lists every module instead). Edges are imports ``-->``, inheritance ``==>`` and calls ``-.->``, each kind transitively reduced so the direct layering shows; an edge that closes a cycle is never dropped. Dependencies on code outside the package are summarised per module under the diagram, not drawn. Test modules and type-only imports are left out. The json form is ``{prefix, nodes, subpackages, edges:[{source,target,kind}], dropped, covered, outside}``; ``covered`` counts the imports not drawn because a drawn ``==>`` joins the same pair: that arrow then also stands for the import, so read an import closure over imports and extends together. An import that closes an import cycle is always drawn. Run ``cgis_ingest`` first.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
exclude_testsboolean–Leave test modules out.
expandboolean–Every module below the package instead of one node per sub-package.
layersarray–Edge kinds to draw. Calls make the picture much denser.
output_formatstring–mermaid: a diagram plus a table of outside dependencies; json: data.
prefixstringyesFQN prefix of the package as the graph names it, e.g. cgis.query (cgis_find_symbol shows it), matched on whole dot-segments. A directory above the ingest root, such as src., is dropped.
reduceboolean–Drop each edge implied by a longer path, per kind; cycles stay.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_overview ~245

Where to start in a graph you know nothing about: sizes and a package map. Call this first in an unfamiliar repository — every other tool needs a name, and this is the one that hands you some. Returns JSON: symbol counts by type, file and edge totals, the unresolved-edge ratio, and the largest packages with production and tests listed separately. Each ``prefix`` goes straight into ``cgis_get_structure`` (the modules it holds), ``cgis_find_symbol`` (``fqn_prefix``) or ``cgis_metrics`` (``scope``). Listings are capped; ``packages_omitted`` appears when rows were cut. Entry points are deliberately not reported — "nothing calls it" is not one on a framework codebase, where most handlers have no incoming call edge.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
depthinteger–FQN segments per package prefix; 1 is the top level.
limitinteger–Maximum packages listed per section.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_suggest_packages ~358

Suggest sub-package boundaries for a package from its dependency communities. Returns JSON: modularity_q, divergence, direction (under/over/matched), verdict (split/consolidate/aligned/leave/borderline/no_signal), the detected communities (id + members), the cross-community bridge edges (cost of splitting), and the thresholds used. Default layer is IMPORTS; set ``with_calls`` for the combined import+call graph. Run ``cgis_ingest`` first. Members are the package's direct children by default, each sub-package one node, so the verdict says whether to regroup them; ``level`` in the result says which. ``all_descendants`` clusters every file below the package. A mis-rooted graph (import targets resolve to no internal file) returns ``no_signal`` with a diagnostic note rather than a silent clean verdict.

NameTypeReqDescription
all_descendantsboolean–Cluster every file below the package and compare with its sub-directories, instead of treating each sub-package as one node.
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
min_qnumber–Modularity threshold: at or above it, a package whose layout disagrees with its communities is flagged split (or consolidate, if over-split).
prefix––FQN prefix of the package to analyse, e.g. cgis.query, matched on whole dot-segments. Needed in practice: without it the verdict is no_signal.
with_callsboolean–Use the combined import + call graph instead of imports only.
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_trace_flow ~801

Downstream subgraph of one FQN: everything it reaches within ``depth`` hops. Follows every edge except containment — in practice calls, imports, inheritance, DI dependencies and references — between internal code, so this answers "what does X depend on?". Containment and stdlib/third-party nodes are left out unless ``include_structure`` / ``include_external`` ask for them (external covers stdlib, third-party and unresolved call targets) — the same view as the CLI's ``trace``. For what depends on X use ``cgis_analyze_impact``; for only the members of a module or class, ``cgis_get_structure``; for a source-included brief to read before editing one symbol, ``cgis_context``. Test code is left out unless ``include_tests`` asks for it, and at most ``max_nodes`` nodes come back, nearest first, as for impact. ``output_format="text"`` returns the subgraph as an indented tree, one line per node with children in call-site order, so a flow reads top down — about a fifth of the json for the same answer; ``"mermaid"`` (default) a diagram; ``"json"`` a joinable ``{root, nodes, edges, coverage}`` payload with real FQNs (not display hashes) for agent/CI use. ``coverage`` counts the calls the traversed functions make that resolved to nothing, and ``top_unresolved`` names the most frequent. Read the names, not only the ratio: in Python most are methods on untyped locals (``logger.info``, ``items.append``), which cut nothing short. Use ``cgis_ingest`` first if the database does not exist yet.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
depthinteger–Maximum edge hops downstream, over calls, imports, inheritance, DI dependencies and references (plus containment with include_structure). A hop from a base or interface method to its overrides costs…
fqnstringyesFully qualified name, e.g. pkg.module.Class.method. A unique dot-boundary suffix also resolves; an ambiguous one returns candidates. Use cgis_find_symbol to look a name up.
include_externalboolean–Also return stdlib, third-party and unresolved call targets — calls on values whose type is decided at runtime. Off by default, as in the CLI, because they dominate the payload; in json, coverage/top…
include_structureboolean–Also follow containment (CONTAINS/DECLARES): a module's or class's own members, and the class or file enclosing a symbol. Off by default, as in the CLI; cgis_get_structure is the tool for members alo…
include_testsboolean–Also return test code. Off by default: on a large repo tests outnumber the production code an answer is about. The answer says how many were left out — a floor when it is also truncated, since levels…
max_nodesinteger–Most nodes to return, nearest levels first. A level that does not fit is cut and the walk stops there; the answer says where and how many were left out, so a smaller depth or a narrower FQN can follo…
output_formatstring–"text" for an indented tree, one line per node — the cheapest to read; "mermaid" for a diagram; or "json" for a payload with real FQNs, to compute with (case-insensitive). Any other value returns an…
NameTypeReqDescription
resultstringyes–

No examples provided.

cgis_validate ~108

Report graph integrity as JSON: edge resolution stats + health verdict. Check this before trusting ``cgis_analyze_impact`` output — a high unresolved ratio means callers are missing from the graph.

NameTypeReqDescription
db_pathstring–SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.
thresholdnumber–Highest unresolved-edge ratio (0-1) still reported as healthy.
NameTypeReqDescription
resultstringyes–

No examples provided.

Install

How do I install the CGIS Code Graph MCP server?

CGIS Code Graph runs locally as a PyPI package, launched with uvx codegraph-brain. Ready-made configuration for Claude, Cursor, VS Code, Codex and 5 more is on this page, copied from each client's own documentation.

pypi · codegraph-brain

# add to Claude Code
claude mcp add zaebee-codegraph-brain -- uvx codegraph-brain
Common questions

What is the CGIS Code Graph MCP server?

CGIS Code Graph is an MCP server listed in the public MCP registry as io.github.zaebee/codegraph-brain. Code graph for AI agents: impact, call tracing in Python, TypeScript, Go; opt-in JSON and YAML keys. This page covers its PyPI package (codegraph-brain).

Is the CGIS Code Graph MCP server safe to use?

CGIS Code Graph scores 77 out of 100 on VerifyMCP. We found no known CVEs affecting it as of 5 November 2026. Its build provenance is signed and verified. That is a record of what we were able to check automatically, not an endorsement. The category breakdown on this page shows every signal behind the number, including the ones we could not confirm.

What tools does the CGIS Code Graph MCP server expose?

CGIS Code Graph exposes 17 tools: cgis_ingest, cgis_trace_flow, cgis_analyze_impact, cgis_get_structure, cgis_drift, and 12 more. Their descriptions and schemas cost roughly 7,568 tokens of context every time the server is loaded.

Is the CGIS Code Graph MCP server still maintained?

CGIS Code Graph is still listed as active in the MCP registry. We last reached this channel on 5 November 2026. Those dates come from our own scans of the registry and the channel itself, not from anything the publisher announced.

What licence is the CGIS Code Graph MCP server under?

CGIS Code Graph declares the MIT licence, which is OSI-approved. That covers the source only, and says nothing about the cost of any service it calls.