CGIS Code Graph
Code graph for AI agents: impact, call tracing in Python, TypeScript, Go; opt-in JSON and YAML keys
Connector by zaebee · GitHub account verified by the MCP Registry
Install
Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.
npx agentmarket install connector/zaebee-codegraph-brain
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: code-review, refactoring
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this server can do and what it asks for, from its tool list, install config and code. Checked Oct 25, 2026.
- Tools
- 9 read · 0 write · 0 delete · 8 not yet classified
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Tools by what they do 17
Read from the source code; the running server may list different tools.
Read 9 · Look things up without changing anything.
cgis_analyze_impactcgis_audit_reachabilitycgis_diff_checkcgis_find_orphanscgis_find_symbolcgis_get_structurecgis_ingestcgis_suggest_packagescgis_validate
Not yet classified 8 · We could not tell from the name and description.
cgis_contextcgis_driftcgis_fractalcgis_init_ontologycgis_metricscgis_module_graphcgis_overviewcgis_trace_flow
Network hosts it talks to 6
anthropic.com· found in codegithub.com· found in codeglama.ai· found in codeollama.com· found in codeopenrouter.ai· found in coderaw.githubusercontent.com· found in code
Files it touches
~/.ssh/authorized_keys/dev/null/home/zaebee/bench-corpora/exp4-candidates- Your home directory (~)
~/bench-corpora/data-keysC:\\x
Tools (17)
Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].
cgis_analyze_impactUpstream 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 d…
cgis_audit_reachabilityReachability/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 `…
cgis_contextPrompt-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 (ups…
cgis_diff_checkWhat 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 re…
cgis_driftReport 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 do…
cgis_find_orphansClasses 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 not…
cgis_find_symbolResolve 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 c…
cgis_fractalReport 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, …
cgis_get_structureMembers 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 h…
cgis_ingestScan 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…
cgis_init_ontologyPropose 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.
cgis_metricsWhole-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 ot…
cgis_module_graphHow 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, cove…
cgis_overviewWhere 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 deliberat…
cgis_suggest_packagesSuggest 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 w…
Show 2 more tools
cgis_trace_flowDownstream 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``; …
cgis_validateReport 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.
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 69
- Weekly downloads
- 846
- Last commit
- Oct 23, 2026 (6 days ago)
- Last release
- Oct 23, 2026 (6 days ago)
- Last package publish
- Oct 23, 2026 (6 days ago)
From GitHub (fetched Oct 24, 2026) and the package registry.
Details
- Registry name
io.github.zaebee/codegraph-brain- Version
- 0.38.0
- Auth
- No auth
- Packages
- pypi codegraph-brain
- License
- MIT
- Repository
- github.com/zaebee/codegraph-brain
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
More from zaebee
Cite this page
CGIS Code Graph MCP server. Agent Mart. https://agentmart.dev/connectors/zaebee-codegraph-brain (last updated 2026-10-24)