CodeGraph MCP v3.0.1
GitHub Star
v3.0.1 Production · 25 Pillars, 97 Verified FastMCP Tools, Multi-Language CSR Engine

The deterministic
code-intelligence engine.

CodeGraph MCP maps repository relationships with interactive Web visualizer, VS Code extension, Three Pillars, AI/ML PyTorch stack, and database lineage. AI coding agents resolve call hierarchies, mutating SQL queries, and pre-merge contract conflicts in < 50ms without token waste.

$ pip install codegraph-engine[mcp]
1from codegraph import reconcile_static_runtime
2
3# Reconcile static AST edges against live recorded traces
4report = reconcile_static_runtime(
5 route="/api/v1/scan-bill",
6 table="bills"
7)
8
9# Verified execution context returned in < 25ms:
10assert report.status == "RECONCILED"
11>>> [scan_bill_handler → BillService.process (RUNTIME_OBSERVED)]
12>>> [BillService.process → bills table (DATAFLOW_VERIFIED)]
1-- Trace all mutating callers writing to SQL tables
2SELECT * FROM find_db_writers('users');
3
4-- Verified Mutating Callers (INSERT / UPDATE / DELETE):
5• AuthService.register_user (app/auth.py:42) INSERT
6• BillingService.charge_card (app/billing.py:91) UPDATE
7• AdminService.delete_user (app/admin.py:114) DELETE
8
9-- Column lineage traced to SQLite foreign keys & models
1{
2 "query": "Trace scan_bill and database writes",
3 "status": "AST_VERIFIED",
4 "freshness": "FRESH (Git HEAD match in 2ms)",
5 "telemetry": "OBSERVED (pytest live traces)",
6 "database_impact": { "writers": 3, "table": "bills" },
7 "context_reduction_pct": 94.2,
8 "latency_ms": 18.4
9}

Runtime evidence

Reconcile static AST with live execution traces for verified context.

→

Database intelligence

Trace SQL/ORM to tables, columns, mutating queries, and data flows.

→

Tree-sitter & AST parsing

Deterministic parsing across Python, JavaScript, and TypeScript.

→

82 MCP tools server

Expose the graph to Claude Code, Cursor, Codex, and Antigravity.

→

Framework-aware routes

FastAPI, Flask, Django, and Express.js route discovery.

→

Git-Aware Intelligence & Conflicts

Structural AST diffs, visual impact trees, and pre-merge semantic contract conflicts.

→

Next Steps

You've got CodeGraph MCP installed and a graph built. Here's where to go next.

Understand the model

Put it to work

Introduction

CodeGraph MCP is a deterministic, local-first code-intelligence engine for AI coding agents. Instead of letting agents waste context tokens repeatedly running grep, find, and reading hundreds of random files, CodeGraph MCP pre-indexes the structural relationships of a repository.

It parses code locally using Tree-sitter to deterministically extract symbols, definitions, class hierarchies, import chains, and function call relationships. The extracted graph is stored local-first inside a project-level SQLite database with WAL mode and FTS5 full-text search.

Quickstart

Install CodeGraph MCP from PyPI with complete CLI and FastMCP server bindings:

Terminal
pip install "codegraph-engine[mcp]"

Initialize and index your repository:

Terminal
cd /path/to/project
codegraph init .
codegraph index .
codegraph status .

Configuration

Add CodeGraph MCP to Claude Code, Cursor, Windsurf, or Antigravity via your standard MCP config:

claude_desktop_config.json / .cursor/mcp.json
{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph",
      "args": ["serve", "."]
    }
  }
}

How It Works

CodeGraph MCP operates through a deterministic four-phase pipeline:

  • Tree-sitter Parsing: Source files are parsed incrementally into concrete ASTs. Zero LLM hallucinations.
  • Relational Graph Storage: Symbols, calls, imports, and routes are stored in SQLite with foreign-key constraints.
  • Deterministic Resolution: Canonical IDs, qualified names, and route endpoints are resolved with explicit ambiguity states.
  • MCP Tool Serving: FastMCP stdio/SSE server serves 82 verified tools with token-bounded context packets.

Git-Aware Repository Intelligence & Merge Conflict Safety (v3.0.1)

CodeGraph MCP v3.0.1 understands how the repository changed across branches and commits, what those changes affect, and whether previously generated context is still valid.

Pre-Merge Safety: Standard git merge only checks for textual overlaps. CodeGraph checks for semantic contract conflicts—flagging when branch A invokes functions or route handlers that branch B deleted or modified.
  • Working-Tree Freshness: Sub-5ms detection of branch, HEAD, indexed commit, and dirty modifications (codegraph git-state).
  • Structural AST Diff: Semantic analysis of added, removed, and modified functions, parameters, and routes (codegraph git-diff [base] [head]).
  • Visual Downstream Impact Tree: ASCII tree visualization mapping affected callers, routes, tests, and database writers (codegraph git-impact --tree).
  • Pre-Merge Semantic Conflict Detection: Detect contract breaks before pull requests merge (codegraph git-conflicts main HEAD).
  • Context Freshness Validation: Guarantees that AI agent context packets stay valid when unrelated files change (codegraph check-freshness).
  • Deterministic Symbol History: Exact commit provenance for symbols across git log (codegraph symbol-history <symbol>).

Runtime Telemetry Reconciliation

Static analysis alone cannot detect runtime dynamic dispatch, monkey-patching, or live test coverage. CodeGraph MCP reconciles static AST graph edges against recorded runtime execution traces.

Runtime Verification Guarantee: Recorded execution traces produce RUNTIME_OBSERVED edges. If a static path is not triggered during tests, it is flagged as NOT_OBSERVED_AT_RUNTIME without claiming it cannot execute.

Database Lineage & Schema Intelligence

CodeGraph MCP indexes relational databases, migrations, and ORMs (SQLAlchemy, Prisma, Django ORM). It connects tables and columns to the exact Python or TypeScript functions that read or write them.

Mutating SQL Writers: Instantly discover which API routes execute INSERT, UPDATE, or DELETE queries before performing breaking database migrations.

Indexing a Project

Run codegraph index . to scan and parse all files in your repository. Incremental indexing utilizes content hashes so subsequent runs finish in milliseconds.

Interactive Web Knowledge Graph Dashboard (codegraph ui)

Launch the local interactive visualizer with codegraph ui to explore callers, callees, full-stack routes, and database relationships in real-time directly in your browser:

Terminal
codegraph ui --port 8765

The dashboard includes a force-directed knowledge graph, full-stack route tree, database lineage matrix (Prisma, Drizzle, SQLAlchemy, Mongoose), PR blast radius explorer, and live REST/SSE endpoints.

Official VS Code Extension

The official CodeGraph VS Code extension brings deterministic repository intelligence right into your code editor. It adds:

  • Full-Stack Route Explorer: Activity bar tree displaying all Next.js, FastAPI, Flask, Express, and NestJS endpoints with one-click jump-to-definition.
  • Database Lineage & Models: Side-by-side inspection of tables, fields, readers, and writers.
  • PR Blast Radius Tree: Instant risk score, downstream callers, and targeted test command for the current active file.
  • In-Editor Visual Knowledge Graph: Interactive dashboard opened inside a native VS Code Webview panel.
  • Safe AST Rename: Deterministic symbol refactoring across all callers and route handlers.

Framework Routes

CodeGraph MCP automatically traces routes for FastAPI, Flask, Django, Express.js, and NestJS, connecting HTTP verbs and path templates directly to their handler symbols.

Affected Tests in CI

Use find_related_tests to discover the exact subset of unit and integration tests covering a modified symbol, optimizing continuous integration test run times.

Database Schema & Writers

Query find_db_tables, find_db_columns, and find_db_writers to audit data flow before performing database refactors.

MCP Tools Reference (82 Verified Tools)

Every tool exposed by CodeGraph MCP over Model Context Protocol, categorized into Git Intelligence, Database, Runtime, Graph, Core, Routes, and Tests.

Git-Aware Intelligence & Change Impact Tools (9)

Working-tree freshness, AST-level git diffs, semantic merge conflicts, symbol history, and blast-radius impact.

get_git_impact GIT

Compute deterministic change impact between Git refs (`base`..`head`), including modified symbols, downstream callers, affected packages, and covering tests. Use for PR review, regression analysis, and pre-commit blast-radius checks. Does not execute tests; reports static test-to-symbol coverage edges.

Resolves: Finding affected callers, packages, and tests after recent commits or before a refactor
Parameters Schema
ParameterTypeStatusDefaultDescription
base string Optional HEAD~1 Base
head string Optional HEAD Head
Client Invocation
MCP Client / Agent Call
get_git_impact(base="HEAD~1", head="HEAD")
Return Model: GitImpactResult
FieldTypeDescription
statusstringStatus
basestringBase
headstringHead
changed_filesarrayChanged Files
modified_symbolsarrayModified Symbols
impacted_callersarrayImpacted Callers
affected_packagesstringAffected Packages
related_testsarrayRelated Tests
Evidence Guarantee Git diff line mapping intersected with AST symbol spans and graph dependents.
Epistemic Boundary Does not prove whether tests pass or fail at runtime.
get_recent_changes GIT

Return repository files modified between two Git refs (`since`..`until`) in a read-only sandboxed query. Use when reviewing recent commits or identifying which files changed before running impact analysis. Does not compute downstream symbol callers; use get_git_impact for symbol-level blast radius.

Resolves: Listing files touched in the last N commits during debugging or code review
Parameters Schema
ParameterTypeStatusDefaultDescription
since string Optional HEAD~10 Since
until string Optional HEAD Until
Client Invocation
MCP Client / Agent Call
get_recent_changes(since="HEAD~5", until="HEAD")
Return Model: GitChangedFilesList
FieldTypeDescription
pathstringPath
statusstringStatus
Evidence Guarantee Git diff status and relative file paths between refs.
Epistemic Boundary Does not compute symbol-level callers or covering tests (use get_git_impact).
get_file_history GIT

Return recent Git commits touching a specific repository file (`path`, up to `n` commits). Use when investigating when and why a specific file was recently modified. Does not return full commit diffs or cross-file dependency impact.

Resolves: Checking recent commit history on a buggy file
Parameters Schema
ParameterTypeStatusDefaultDescription
path string Required - Path
n integer Optional 10 N
Client Invocation
MCP Client / Agent Call
get_file_history(path="src/auth/service.py", n=5)
Return Model: FileCommitHistoryList
FieldTypeDescription
commitstringCommit
authorstringAuthor
datestringDate
subjectstringSubject
Evidence Guarantee Commit hashes, authors, timestamps, and commit subjects touching `path`.
Epistemic Boundary Does not prove which specific symbol inside the file caused a regression.
analyze_change_impact GIT

Analyze changed files, modified symbols, downstream callers, and related tests between Git refs `since` and `until`. Use for commit-range impact analysis when `since`/`until` parameter naming is preferred. Does not execute tests at runtime.

Resolves: Analyzing blast radius of commits between `since` and `until`
Parameters Schema
ParameterTypeStatusDefaultDescription
since string Optional HEAD~1 Since
until string Optional HEAD Until
Client Invocation
MCP Client / Agent Call
analyze_change_impact(since="HEAD~2", until="HEAD")
Return Model: ChangeImpactReport
FieldTypeDescription
changed_filesarrayChanged Files
modified_symbolsarrayModified Symbols
callersarrayCallers
related_testsarrayRelated Tests
Evidence Guarantee Git diff mapped to indexed symbols, callers, and related tests.
Epistemic Boundary Does not prove runtime test pass/fail status.
get_git_state GIT

Track current Git branch, HEAD commit, indexed commit, working tree modifications, staged files, and explicit freshness states (CLEAN, DIRTY, STALE, REINDEXING, ERROR). Use when asking if the index is up to date, which files changed, or what git branch is active. Does not perform a full repository scan when an incremental update is safe.

Resolves: Checking if repository has uncommitted changes or if re-indexing is required after pulling git commits
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_git_state()
Return Model: GitStateReport
FieldTypeDescription
is_gitstringIs Git
branchstringBranch
current_headstringCurrent Head
indexed_headstringIndexed Head
freshnessbooleanFreshness
working_treestringWorking Tree
reindex_requiredstringReindex Required
detailstringDetail
Evidence Guarantee Deterministic Git rev-parse and status porcelain v1 inspection.
Epistemic Boundary Does not prove semantic impact; reports file-level and commit-level freshness.
compare_git GIT

Compare two Git revisions, commits, or branches structurally. Detects added/deleted/modified/renamed files, AST symbol changes, relationship diffs, routes, and affected tests. Use when comparing branches or commits structurally. Does not execute repository code.

Resolves: Understanding structural changes between two branches or commits without parsing raw diff text
Parameters Schema
ParameterTypeStatusDefaultDescription
base string Optional HEAD~1 Base
head string Optional HEAD Head
branch_comparison boolean Optional False Branch Comparison
Client Invocation
MCP Client / Agent Call
compare_git(base="main", head="HEAD", branch_comparison=True)
Return Model: StructuralDiffResult
FieldTypeDescription
base_refstringBase Ref
head_refstringHead Ref
added_filesarrayAdded Files
deleted_filesarrayDeleted Files
modified_filesarrayModified Files
renamed_filesarrayRenamed Files
added_symbolsarrayAdded Symbols
removed_symbolsarrayRemoved Symbols
changed_symbolsarrayChanged Symbols
changed_routesarrayChanged Routes
affected_testsarrayAffected Tests
Evidence Guarantee AST parsing of before/after revisions with exact file:line citations and similarity scores.
Epistemic Boundary Does not execute code or run test assertions.
get_change_impact GIT

Compute deep downstream change impact across callers, callees, framework routes, covering tests, mutating database queries, and monorepo packages. Returns ranked entities with explicit confidence (FACT, POSSIBLE, UNKNOWN) and blast radius score. Use when evaluating ripple effects of git commits. Does not execute repository test suites.

Resolves: Evaluating what code, routes, database writes, and tests will break if git changes are merged
Parameters Schema
ParameterTypeStatusDefaultDescription
base string Optional HEAD~1 Base
head string Optional HEAD Head
max_depth integer Optional 2 Max Depth
max_results integer Optional 50 Max Results
Client Invocation
MCP Client / Agent Call
get_change_impact(base="HEAD~1", head="HEAD")
Return Model: DeepImpactResult
FieldTypeDescription
base_refstringBase Ref
head_refstringHead Ref
changed_filesarrayChanged Files
changed_symbolsarrayChanged Symbols
direct_callersarrayDirect Callers
transitive_callersarrayTransitive Callers
affected_routesarrayAffected Routes
affected_testsarrayAffected Tests
db_writersarrayDb Writers
blast_radius_scorestringBlast Radius Score
Evidence Guarantee Complete graph traversal connecting modified AST symbols to callers, routes, tests, and DB queries.
Epistemic Boundary Does not prove runtime execution frequencies; reports static graph reachability.
check_context_freshness GIT

Validate whether a previously compiled context packet or task context is still VALID, PARTIALLY_STALE, or STALE. Guarantees that changes to unrelated files keep context VALID. Use when checking if previously compiled context remains valid after edits. Does not invalidate context when only unrelated files change.

Resolves: Checking if previously cached or generated AI context packet is still safe to use after editing files
Parameters Schema
ParameterTypeStatusDefaultDescription
task string Optional Task
context_packet any Optional None Context Packet
Client Invocation
MCP Client / Agent Call
check_context_freshness(task="Fix auth timeout")
Return Model: ContextFreshnessResult
FieldTypeDescription
statusstringStatus
base_commitstringBase Commit
current_headstringCurrent Head
repository_dirtystringRepository Dirty
context_filesarrayContext Files
changed_relevant_filesarrayChanged Relevant Files
unrelated_changed_filesarrayUnrelated Changed Files
invalidated_symbolsarrayInvalidated Symbols
reasonstringReason
recommended_actionstringRecommended Action
Evidence Guarantee Intersection of Git diff line/file changes against exact symbol and file references in context packet.
Epistemic Boundary Does not recompile context; reports freshness validity and recommended action.
trace_symbol_history GIT

Trace deterministic symbol evolution across Git history: introduced, modified, moved across files, renamed, or deleted. Uses AST structure and body hashes to differentiate FACT from POSSIBLE/AMBIGUOUS renames. Use when discovering when a symbol was added, moved, or renamed. Does not guess ambiguous renames without evidence.

Resolves: Tracing when a function was introduced, modified, moved to a different module, or renamed
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Required - Symbol
path string Optional Path
max_commits integer Optional 15 Max Commits
Client Invocation
MCP Client / Agent Call
trace_symbol_history(symbol="AuthService")
Return Model: SymbolHistoryResult
FieldTypeDescription
symbolstringSymbol
current_pathstringCurrent Path
eventsstringEvents
total_commits_evaluatedstringTotal Commits Evaluated
statusstringStatus
detailstringDetail
Evidence Guarantee Git log history correlated with AST body hashes and file rename metadata.
Epistemic Boundary Does not guarantee intent behind refactors; reports structural code evolution.

Database Lineage & Schema Tools (11)

Tools for table inspection, column typing, mutating SQL writers, and schema impact analysis.

find_db_tables DATABASE

Find database tables discovered across ORM models, raw SQL queries, and migrations. Use instead of grep when asking which database tables exist in this repository. Returns canonical IDs (`db.<dialect>.<schema>.<table>`), columns, ORM models, and evidence classes (`FRAMEWORK_VERIFIED`, `STATIC_VERIFIED`, `POSSIBLE`, `UNKNOWN`). Does not connect to live databases or execute SQL.

Resolves: Answering 'Which database tables exist in this repository?'
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Optional Table
dialect string Optional Dialect
schema string Optional Schema
Client Invocation
MCP Client / Agent Call
find_db_tables()
Return Model: DatabaseTableListResult
FieldTypeDescription
statusstringStatus
tablesarrayTables
countintegerCount
Evidence Guarantee Static ORM, SQL, and migration table definitions with canonical IDs and explicit dialect/schema uncertainty.
Epistemic Boundary Does not inspect live production database catalogs or unindexed external schemas.
find_db_columns DATABASE

Find database columns, data types, nullability, primary keys, and foreign keys across tables and ORM models. Use instead of grep when locating where a table column is defined or mapped (`MAPS_TO_COLUMN`, `HAS_PRIMARY_KEY`, `FOREIGN_KEY_TO`). Returns column definitions and source coordinates. Does not inspect live database catalogs.

Resolves: Answering 'What columns exist in bills?' or 'Where is column total_amount defined?'
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Optional Table
column string Optional Column
Client Invocation
MCP Client / Agent Call
find_db_columns(table="bills")
Return Model: DatabaseColumnListResult
FieldTypeDescription
statusstringStatus
columnsarrayColumns
countintegerCount
Evidence Guarantee ORM field-to-column mappings and SQL/migration column definitions with file:line evidence.
Epistemic Boundary Does not prove live database column values or runtime constraint violations.
find_db_models DATABASE

Find ORM models (SQLAlchemy, Flask-SQLAlchemy, Django ORM, SQLModel, Prisma) and their `MAPS_TO_TABLE` mappings. Use when asking which model class maps to a database table or vice versa. Returns model name, table, canonical ID, and `FRAMEWORK_VERIFIED` evidence. Does not import or execute application model modules.

Resolves: Finding which ORM class maps to table 'products' or listing all ORM models in the repository
Parameters Schema
ParameterTypeStatusDefaultDescription
model string Optional Model
table string Optional Table
Client Invocation
MCP Client / Agent Call
find_db_models(table="products")
Return Model: DatabaseModelListResult
FieldTypeDescription
statusstringStatus
modelsstringModels
countintegerCount
Evidence Guarantee Framework-verified ORM model declarations and table mappings.
Epistemic Boundary Does not execute dynamic metaclass table name generators.
find_db_queries DATABASE

Find database queries (`SELECT`, `INSERT`, `UPDATE`, `DELETE`) across ORM calls, query builders, and raw SQL strings. Use when asking which queries touch a table or what SQL a function executes. Returns `READS_TABLE`, `WRITES_TABLE`, `POSSIBLE_TABLE`, or `UNKNOWN_TABLE` with redacted snippets. Never exposes SQL literal secret parameters.

Resolves: Listing all SELECT/INSERT/UPDATE/DELETE operations targeting a table or inside a service function
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Optional Table
symbol string Optional Symbol
operation string Optional Operation
Client Invocation
MCP Client / Agent Call
find_db_queries(table="orders")
Return Model: DatabaseQueryListResult
FieldTypeDescription
statusstringStatus
queriesarrayQueries
countintegerCount
Evidence Guarantee AST- and framework-verified query operations with normalized/redacted SQL snippets and uncertainty preservation.
Epistemic Boundary Does not execute SQL queries or prove query execution plans.
find_db_callers DATABASE

Find all functions, methods, and upstream HTTP routes (`HANDLED_BY`) that read from or write to a database table. Use instead of grep when asking which code or route reaches a table. Returns direct accessors, upstream routes, relationships (`READS_TABLE`, `WRITES_TABLE`), and evidence classes. Does not prove runtime query frequency.

Resolves: Answering 'Which route or service accesses the products table?'
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Required - Table
Client Invocation
MCP Client / Agent Call
find_db_callers(table="products")
Return Model: DatabaseCallersResult
FieldTypeDescription
statusstringStatus
tablestringTable
direct_accessorsstringDirect Accessors
upstream_routesarrayUpstream Routes
countintegerCount
Evidence Guarantee Direct table readers/writers plus transitive upstream callers and HTTP route entrypoints.
Epistemic Boundary Does not prove runtime execution frequency unless paired with get_runtime_trace.
find_db_writers DATABASE

Find all symbols and queries that write (`INSERT`, `UPDATE`, `DELETE`) to a database table or column (`WRITES_TABLE`, `WRITES_COLUMN`). Use when investigating data mutations, state changes, or write blast radius. Returns writer symbols, operations, file:line citations, and redacted snippets. Does not execute database transactions.

Resolves: Answering 'Which service writes to the products table or updates inventory.quantity?'
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Optional Table
column string Optional Column
Client Invocation
MCP Client / Agent Call
find_db_writers(table="products")
Return Model: DatabaseWritersResult
FieldTypeDescription
statusstringStatus
writersarrayWriters
countintegerCount
Evidence Guarantee Verified INSERT/UPDATE/DELETE and ORM mutation call sites with source coordinates.
Epistemic Boundary Does not prove whether a database transaction commits or rolls back at runtime.
find_db_readers DATABASE

Find all symbols and queries that read (`SELECT`, `.query()`, `.objects.filter()`, `.findMany()`) from a database table or column (`READS_TABLE`, `READS_COLUMN`). Use when tracing where table data is consumed across services and views. Returns reader symbols, operations, and evidence classes. Does not prove runtime cache hits.

Resolves: Answering 'What code reads from users or reads column email?'
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Optional Table
column string Optional Column
Client Invocation
MCP Client / Agent Call
find_db_readers(table="users")
Return Model: DatabaseReadersResult
FieldTypeDescription
statusstringStatus
readersarrayReaders
countintegerCount
Evidence Guarantee Verified SELECT and ORM read query sites with file and line spans.
Epistemic Boundary Does not prove whether results are served from an in-memory cache at runtime.
find_db_relationships DATABASE

Find database schema and ORM relationships (`FOREIGN_KEY_TO`, `ORM_RELATION`, `MAPS_TO_TABLE`, `HAS_PRIMARY_KEY`, `HAS_INDEX`, `MIGRATES_TABLE`). Use when inspecting foreign keys, table joins, or model associations. Preserves explicit database relationship types and never collapses them into generic `DEPENDS_ON`.

Resolves: Answering 'What foreign keys or ORM relationships exist for orders?'
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Optional Table
Client Invocation
MCP Client / Agent Call
find_db_relationships(table="orders")
Return Model: DatabaseRelationshipsResult
FieldTypeDescription
statusstringStatus
relationshipsstringRelationships
countintegerCount
Evidence Guarantee Explicit schema and ORM relationship edges with canonical source/target IDs and source coordinates.
Epistemic Boundary Does not prove unindexed database triggers on external servers.
get_db_table DATABASE

Return complete structural details for a database table including columns, primary keys, foreign keys, indexes, constraints, ORM models, readers, writers, migrations, and upstream routes. Use when inspecting a specific table's schema and code usage in one call. Does not query live database servers.

Resolves: Inspecting everything known about a database table (columns, models, readers, writers, routes, migrations)
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Required - Table
Client Invocation
MCP Client / Agent Call
get_db_table(table="products")
Return Model: DatabaseTableDetailResult
FieldTypeDescription
statusstringStatus
tablestringTable
canonical_idstringCanonical Id
dialectstringDialect
schemastringSchema
columnsarrayColumns
primary_keysstringPrimary Keys
foreign_keysstringForeign Keys
indexesstringIndexes
orm_modelsstringOrm Models
readersarrayReaders
writersarrayWriters
migrationsstringMigrations
upstream_routesarrayUpstream Routes
Evidence Guarantee Consolidated static schema, ORM mapping, reader/writer, route, and migration evidence for the table.
Epistemic Boundary Does not return live table row counts or production data rows.
get_db_schema DATABASE

Return a repository-wide database schema summary including all discovered tables, columns, ORM models, foreign keys, and migrations. Use for database architecture overviews or schema audits. Preserves `UNKNOWN` dialect and schema when not statically provable and never guesses database names.

Resolves: Understanding the complete data model, tables, foreign keys, and migration history of a repository
Parameters Schema
ParameterTypeStatusDefaultDescription
dialect string Optional Dialect
schema string Optional Schema
Client Invocation
MCP Client / Agent Call
get_db_schema()
Return Model: DatabaseSchemaOverviewResult
FieldTypeDescription
statusstringStatus
dialectsstringDialects
schemasstringSchemas
tablesarrayTables
orm_modelsstringOrm Models
foreign_keysstringForeign Keys
migrationsstringMigrations
env_variablesstringEnv Variables
Evidence Guarantee Repository-wide database topology with explicit dialect/schema uncertainty and redacted env metadata.
Epistemic Boundary Does not connect to external database servers or read `.env` secret values.
get_db_impact DATABASE

Compute bidirectional Code <-> Database change impact for a table or column, returning affected ORM models, readers, writers, upstream HTTP routes, migrations, and statically linked tests. Use before renaming or altering a database table or column. Does not execute database migrations or tests.

Resolves: Answering 'What breaks if I rename or drop column shop_id on products?'
Parameters Schema
ParameterTypeStatusDefaultDescription
table string Optional Table
column string Optional Column
Client Invocation
MCP Client / Agent Call
get_db_impact(table="products", column="shop_id")
Return Model: DatabaseImpactResult
FieldTypeDescription
statusstringStatus
tablestringTable
columnstringColumn
affected_modelsstringAffected Models
affected_readersarrayAffected Readers
affected_writersarrayAffected Writers
affected_routesarrayAffected Routes
affected_migrationsstringAffected Migrations
affected_testsarrayAffected Tests
Evidence Guarantee Bidirectional impact across ORM models, queries, service callers, HTTP routes, migrations, and tests.
Epistemic Boundary Does not prove runtime migration locking or production table size.

Runtime Telemetry & Reconciliation Tools (6)

Tools for execution trace recording, runtime observation reconciliation, and dynamic call tracing.

trace_path RUNTIME

Compute deterministic multi-hop relationship paths between two symbols (`from_symbol` -> `to_symbol`). Use when tracing how an entrypoint, route, or caller reaches a downstream service or database function. Returns ordered hop edges with relationship types and evidence classes. Does not prove runtime branch conditions along the path.

Resolves: Proving how an HTTP endpoint or CLI command reaches a downstream repository or helper
Parameters Schema
ParameterTypeStatusDefaultDescription
from_symbol string Optional From Symbol
to_symbol string Optional To Symbol
start_symbol string Optional Start Symbol
target_symbol string Optional Target Symbol
source_symbol string Optional Source Symbol
max_depth integer Optional 5 Max Depth
Client Invocation
MCP Client / Agent Call
trace_path(from_symbol="login_endpoint", to_symbol="find_by_email", max_depth=4)
Return Model: PathTraceResult
FieldTypeDescription
statusstringStatus
from_symbolstringFrom Symbol
to_symbolstringTo Symbol
pathstringPath
pathsstringPaths
hopsstringHops
evidence_classstringEvidence Class
confidencestringConfidence
Evidence Guarantee Ordered multi-hop chain where every hop carries file, line, and evidence_class.
Epistemic Boundary Does not prove that a conditional runtime branch is taken for a specific input payload.
trace_call RUNTIME

Traverse callers, callees, or both from a single `symbol` (`canonical_id` supported as alias) up to `depth` with confidence and relationship labels. Use when exploring upstream and/or downstream call trees from one symbol without a known second endpoint. Does not prove runtime branch execution.

Resolves: Tracing 2 hops of upstream callers (`callers=True`) or downstream callees (`callees=True`) from one symbol
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
depth integer Optional 2 Depth
callers boolean Optional True Callers
callees boolean Optional False Callees
both boolean Optional False Both
Client Invocation
MCP Client / Agent Call
trace_call(symbol="verify_password", depth=2, callers=True)
Return Model: DirectionalCallTraceList
FieldTypeDescription
sourcestringSource
targetstringTarget
relationshipstringRelationship
confidencestringConfidence
evidence_classstringEvidence Class
depthintegerDepth
filestringFile
start_lineintegerStart Line
Evidence Guarantee Directional multi-hop call traversal with hop depth and confidence.
Epistemic Boundary Does not prove runtime reachability under specific input conditions.
trace_flow RUNTIME

Trace multi-hop upstream callers and downstream callees around a single symbol (`symbol`; `canonical_id` supported as alias) up to `depth`. Use when exploring bidirectional execution flow around a function or handler without a known second endpoint. Does not prove runtime branch execution; use trace_path when both endpoints are known.

Resolves: Exploring upstream callers and downstream callees around a single symbol in one call
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
depth integer Optional 2 Depth
callers boolean Optional True Callers
callees boolean Optional False Callees
both boolean Optional False Both
Client Invocation
MCP Client / Agent Call
trace_flow(symbol="place_order", depth=2)
Return Model: DirectionalCallTraceList
FieldTypeDescription
sourcestringSource
targetstringTarget
relationshipstringRelationship
confidencestringConfidence
evidence_classstringEvidence Class
depthintegerDepth
filestringFile
start_lineintegerStart Line
Evidence Guarantee Bidirectional multi-hop call traversal with hop depth, confidence, and evidence_class.
Epistemic Boundary Does not prove runtime reachability under specific input conditions.
ingest_runtime_traces RUNTIME

Ingest optional runtime observation traces (OpenTelemetry JSON, structured JSON/JSONL events, or SQL query logs) into CodeGraph's `RUNTIME_OBSERVED` layer. Use when grounding static analysis with recorded runtime traces. Automatically strips headers/cookies/bodies, redacts SQL bind parameters and secrets, and never converts runtime observations into static `AST_VERIFIED` proof.

Resolves: Loading recorded OpenTelemetry spans, JSONL runtime events, or SQL logs before calling get_runtime_trace or reconcile_static_runtime
Parameters Schema
ParameterTypeStatusDefaultDescription
source_path string Optional Source Path
format string Optional auto Format
payload string Optional Payload
max_events integer Optional 5000 Max Events
sample_rate number Optional 1.0 Sample Rate
Client Invocation
MCP Client / Agent Call
ingest_runtime_traces(source_path="traces/scan_bill.json")
Return Model: RuntimeIngestResult
FieldTypeDescription
statusstringStatus
runtime_generationstringRuntime Generation
events_ingestedstringEvents Ingested
edges_recordedarrayEdges Recorded
redacted_fieldsstringRedacted Fields
Evidence Guarantee Sanitized RUNTIME_OBSERVED edges with observation_count, first_seen, last_seen, and runtime_generation.
Epistemic Boundary Never proves static AST_VERIFIED relationships and never launches or instruments the user application.
get_runtime_trace RUNTIME

Retrieve aggregated runtime execution edges (`RUNTIME_OBSERVED`) and reverse maps (`table -> runtime writers/readers`, `route -> runtime tables`) with `observation_count`, `first_seen`, `last_seen`, and `runtime_generation`. Use when asking what actually happened at runtime. Does not treat unobserved paths as impossible.

Resolves: Answering 'What happened at runtime when /api/scan-bill ran?' or 'Which runtime queries wrote to bills?'
Parameters Schema
ParameterTypeStatusDefaultDescription
route string Optional Route
symbol string Optional Symbol
table string Optional Table
Client Invocation
MCP Client / Agent Call
get_runtime_trace(route="/api/scan-bill")
Return Model: RuntimeTraceResult
FieldTypeDescription
statusstringStatus
edgesarrayEdges
observationsstringObservations
reverse_mapsstringReverse Maps
countintegerCount
Evidence Guarantee Aggregated RUNTIME_OBSERVED edges with observation counts, timestamps, and sanitized SQL templates.
Epistemic Boundary Does not prove that unobserved static branches cannot execute under other inputs.
reconcile_static_runtime RUNTIME

Reconcile static repository edges against ingested runtime observations, classifying edges into `CONFIRMED_RUNTIME_PATH`, `STATIC_RUNTIME_CONFLICT`, `NOT_OBSERVED_AT_RUNTIME`, and `RUNTIME_ONLY_OBSERVED`. Use when comparing static code analysis with runtime behavior. Never treats `NOT_OBSERVED_AT_RUNTIME` as proof that a path cannot execute.

Resolves: Answering 'Where do static and runtime paths differ?' or 'Which dynamic calls were observed only at runtime?'
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
route string Optional Route
table string Optional Table
Client Invocation
MCP Client / Agent Call
reconcile_static_runtime(route="/api/scan-bill")
Return Model: StaticRuntimeReconciliationResult
FieldTypeDescription
statusstringStatus
confirmed_runtime_pathsstringConfirmed Runtime Paths
static_runtime_conflictsstringStatic Runtime Conflicts
not_observed_at_runtimebooleanNot Observed At Runtime
runtime_only_observedbooleanRuntime Only Observed
summarystringSummary
Evidence Guarantee Explicit four-bucket reconciliation preserving both static evidence classes and RUNTIME_OBSERVED / RUNTIME_UNOBSERVED states.
Epistemic Boundary Never overwrites static AST_VERIFIED edges and never treats NOT_OBSERVED_AT_RUNTIME as dead-code proof.

Graph Traversal & Call Hierarchy Tools (12)

Directional call hierarchies, caller/callee graphs, and change impact propagation.

get_callers GRAPH

Return statically verified callers of a symbol with confidence and evidence_class. Primary input: `symbol` (also accepts `canonical_id` as a compatibility alias using the exact same resolution path). Use for multi-file call-relationship and upstream impact questions. Does not prove runtime dispatch unless evidence_class indicates framework/dataflow verification.

Resolves: Answering 'What calls function X?' across the repository
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
Client Invocation
MCP Client / Agent Call
get_callers(symbol="verify_password")
Return Model: CallerListResult
FieldTypeDescription
statusstringStatus
canonical_idstringCanonical Id
callersarrayCallers
sourcestringSource
relationshipstringRelationship
evidence_classstringEvidence Class
confidencestringConfidence
filestringFile
start_lineintegerStart Line
Evidence Guarantee Call-site file, line, source caller symbol, and RelationshipEvidenceClass.
Epistemic Boundary Does not prove dead-code reachability at runtime or reflective eval/getattr calls.
get_callees GRAPH

Return symbols called or invoked by the specified symbol with evidence_class classification. Primary input: `symbol` (also accepts `canonical_id` as a compatibility alias using the exact same resolution path). Use to inspect downstream dependencies invoked by a function or handler. Does not resolve dynamic callbacks passed as opaque runtime arguments.

Resolves: Answering 'What does function X call?' without manually reading every imported module
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
Client Invocation
MCP Client / Agent Call
get_callees(symbol="process_checkout")
Return Model: CalleeListResult
FieldTypeDescription
statusstringStatus
canonical_idstringCanonical Id
calleesarrayCallees
targetstringTarget
relationshipstringRelationship
evidence_classstringEvidence Class
confidencestringConfidence
filestringFile
start_lineintegerStart Line
Evidence Guarantee AST/dataflow-verified outgoing calls with exact call-site line numbers.
Epistemic Boundary Does not prove external network calls or dynamically constructed strings.
analyze_impact GRAPH

Compute downstream callers, dependents, affected routes, and related tests if a symbol (`symbol`; `canonical_id` supported as alias) is modified. Use before refactoring or changing a function/class signature. Does not prove runtime failure without inspecting call sites.

Resolves: Evaluating blast radius of a signature or behavior change to a symbol
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
max_depth integer Optional 3 Max Depth
Client Invocation
MCP Client / Agent Call
analyze_impact(symbol="DatabasePool.acquire", max_depth=3)
Return Model: SymbolImpactResult
FieldTypeDescription
symbolstringSymbol
direct_callersarrayDirect Callers
transitive_callersarrayTransitive Callers
dependent_filesarrayDependent Files
affected_routesarrayAffected Routes
related_testsarrayRelated Tests
Evidence Guarantee Multi-hop reverse dependency traversal with hop distances and evidence classes.
Epistemic Boundary Does not prove dynamic string-based reflection consumers.
find_callers GRAPH

Find functions and methods that call the specified symbol (`symbol`; `canonical_id` supported as alias) up to `max_results`. Use instead of grep or search_code when answering 'who calls X?'. Does not prove runtime execution of conditional branches; preserves POSSIBLE and UNKNOWN evidence classes.

Resolves: Answering 'Who calls function X?' with a bounded result list
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
max_results integer Optional 20 Max Results
Client Invocation
MCP Client / Agent Call
find_callers(symbol="place_order", max_results=20)
Return Model: CallerEdgeList
FieldTypeDescription
sourcestringSource
targetstringTarget
relationshipstringRelationship
confidencestringConfidence
evidence_classstringEvidence Class
filestringFile
start_lineintegerStart Line
Evidence Guarantee Graph edges with relationship, confidence, evidence_class, and call-site coordinates.
Epistemic Boundary Does not prove runtime execution or dynamic reflection calls.
find_callees GRAPH

Find functions and methods called by the specified symbol (`symbol`; `canonical_id` supported as alias) up to `max_results`. Use instead of reading multiple files manually when answering 'what does X call?'. Does not resolve opaque runtime callbacks; preserves POSSIBLE and UNKNOWN evidence classes.

Resolves: Answering 'What does function X call?' with a bounded result list
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
max_results integer Optional 20 Max Results
Client Invocation
MCP Client / Agent Call
find_callees(symbol="place_order", max_results=20)
Return Model: CalleeEdgeList
FieldTypeDescription
sourcestringSource
targetstringTarget
relationshipstringRelationship
confidencestringConfidence
evidence_classstringEvidence Class
filestringFile
start_lineintegerStart Line
Evidence Guarantee Outgoing call edges with target, confidence, evidence_class, and line numbers.
Epistemic Boundary Does not prove external service behavior or dynamic eval calls.
get_call_graph GRAPH

Compute the multi-hop call graph rooted at `symbol` (`canonical_id` supported as alias) up to `depth` and `max_results`. Use when exploring the multi-hop call neighborhood around a central service or controller. Does not prove runtime reachability for specific inputs.

Resolves: Mapping 2-hop or 3-hop call neighborhoods around a core function
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
depth integer Optional 2 Depth
max_results integer Optional 100 Max Results
Client Invocation
MCP Client / Agent Call
get_call_graph(symbol="AuthService.authenticate", depth=2, max_results=50)
Return Model: CallGraphEdgeList
FieldTypeDescription
sourcestringSource
targetstringTarget
relationshipstringRelationship
confidencestringConfidence
evidence_classstringEvidence Class
depthintegerDepth
filestringFile
start_lineintegerStart Line
Evidence Guarantee Bounded multi-hop subgraph edges with hop depth and evidence metadata.
Epistemic Boundary Does not prove that every branch in the call graph executes on a single request.
get_dependency_graph GRAPH

Return module-level `IMPORTS` graph edges across the repository or filtered to `file_path`. Use when inspecting raw module-to-module import topology. Does not prove symbol-level call invocation; prefer get_imports or get_dependents for targeted queries.

Resolves: Inspecting module import edges for a specific file or across a small repository
Parameters Schema
ParameterTypeStatusDefaultDescription
file_path any Optional None File Path
Client Invocation
MCP Client / Agent Call
get_dependency_graph(file_path="src/auth/service.py")
Return Model: DependencyGraphEdgeList
FieldTypeDescription
sourcestringSource
targetstringTarget
relationshipstringRelationship
confidencestringConfidence
evidencestringEvidence
Evidence Guarantee AST-extracted module IMPORTS edges with source, target, and confidence.
Epistemic Boundary Does not prove whether imported symbols are called.
get_graph GRAPH

Return up to `limit` (1..500) parser-confirmed definition and import graph edges with evidence metadata. Use for inspecting raw structural `DEFINES` and `IMPORTS` edges in small repositories or diagnostics. Does not replace targeted relationship tools like get_callers or trace_path.

Resolves: Sampling raw structural graph edges during diagnostics
Parameters Schema
ParameterTypeStatusDefaultDescription
limit integer Optional 200 Limit
Client Invocation
MCP Client / Agent Call
get_graph(limit=50)
Return Model: GraphEdgeList
FieldTypeDescription
sourcestringSource
targetstringTarget
relationshipstringRelationship
confidencestringConfidence
evidence_classstringEvidence Class
filestringFile
lineintegerLine
Evidence Guarantee Validated structural edges with source, target, relationship, and confidence.
Epistemic Boundary Does not return task-ranked context or multi-hop traces.
batch_find_callers GRAPH

Find functions and methods calling each of the specified symbols in a single round-trip. Use when querying callers of multiple symbols to reduce round trips and multi-turn latency. Does not prove runtime execution of conditional branches.

Resolves: Tracing caller hierarchies across multiple related functions or methods in one call
Parameters Schema
ParameterTypeStatusDefaultDescription
symbols array Required - Symbols
max_results_per_symbol integer Optional 10 Max Results Per Symbol
Client Invocation
MCP Client / Agent Call
batch_find_callers(symbols=["AuthService.login", "TokenValidator.verify"])
Return Model: dict[str, Any]
FieldTypeDescription
resultsstringResults
countintegerCount
total_callersarrayTotal Callers
Evidence Guarantee Verified CALLS relationships with confidence and AST_VERIFIED evidence.
Epistemic Boundary Does not prove runtime execution of conditional branches.
fast_graph_path GRAPH

Compute microsecond BFS shortest path between two symbols using the Compressed Sparse Row (CSR) binary graph. Use for instant path tracing between caller and callee. Does not modify graph.

Resolves: Finding shortest invocation path between an entrypoint route and a database writer
Parameters Schema
ParameterTypeStatusDefaultDescription
start_node string Required - Start Node
end_node string Required - End Node
Client Invocation
MCP Client / Agent Call
fast_graph_path(start_node="handle_checkout", end_node="process_payment")
Return Model: dict[str, Any]
FieldTypeDescription
start_nodestringStart Node
end_nodestringEnd Node
pathstringPath
lengthstringLength
Evidence Guarantee Microsecond breadth-first search path traversal in C-contiguous memory.
Epistemic Boundary Does not guarantee runtime dataflow execution along static edges.
resolve_polymorphic_callees GRAPH

Resolve an abstract interface method or trait invocation to all concrete implementing classes in the workspace. Use when tracing dynamic dispatch or trait method implementations. Does not execute code.

Resolves: Finding which concrete classes implement an interface like PaymentProcessor.charge()
Parameters Schema
ParameterTypeStatusDefaultDescription
interface_symbol string Required - Interface Symbol
method_name string Required - Method Name
Client Invocation
MCP Client / Agent Call
resolve_polymorphic_callees(interface_symbol="IOrderRepository", method_name="findById")
Return Model: dict[str, Any]
FieldTypeDescription
interface_symbolstringInterface Symbol
method_namestringMethod Name
total_implementationsstringTotal Implementations
implementationsstringImplementations
Evidence Guarantee AST-verified inheritance and interface implementation matching.
Epistemic Boundary Does not determine runtime active branch when multiple implementers exist.
analyze_supply_chain_cve_impact GRAPH

Inspect third-party dependency manifests (package.json, go.mod, Cargo.toml, requirements.txt) and trace actual internal call site reachability. Use when assessing CVE vulnerability blast radius. Does not execute external dependencies.

Resolves: Determining if a flagged vulnerable third-party package is actually imported by your code
Parameters Schema
ParameterTypeStatusDefaultDescription
target_package any Optional None Target Package
Client Invocation
MCP Client / Agent Call
analyze_supply_chain_cve_impact(target_package="lodash")
Return Model: dict[str, Any]
FieldTypeDescription
workspacestringWorkspace
total_dependenciesstringTotal Dependencies
actively_imported_countintegerActively Imported Count
packagesstringPackages
active_call_sitesstringActive Call Sites
Evidence Guarantee Manifest parsing and import call-site reachability matching.
Epistemic Boundary Does not fetch live CVE databases without external network connectivity.

Core Symbol Inspection & Context Tools (52)

Canonical symbol resolution, bounded context packets, file slices, and evidence verification.

resolve_symbol CORE

Resolve a symbol name, qualified name, canonical ID, or route into its canonical repository identity and file/line location. Use as the first step before relationship queries when exact symbol identity is unknown or potentially ambiguous. Primary input: `symbol` (also accepts `canonical_id` or `name` as compatibility aliases). Returns canonical_id, ambiguity_state, and candidate alternatives. Does not prove runtime execution or dynamic monkey-patching.

Resolves: Locating where a class, function, or method is canonically defined
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
name string Optional Name
Client Invocation
MCP Client / Agent Call
resolve_symbol(symbol="AuthService")
Return Model: SymbolResolutionResult
FieldTypeDescription
statusstringStatus
canonical_idstringCanonical Id
qualified_namestringQualified Name
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
ambiguity_statestringAmbiguity State
matchesarrayMatches
alternativesarrayAlternatives
Evidence Guarantee AST-verified symbol definition coordinates and explicit AMBIGUOUS/UNKNOWN states.
Epistemic Boundary Does not prove runtime call edges or dynamic attribute injection.
search_symbols CORE

Search indexed repository symbols by partial name or keyword with ranked relevance. Use when exact symbol spelling is unknown and you need candidate symbol definitions. Returns ranked symbol definitions with file paths and line spans. Does not return module import graphs or call relationships.

Resolves: Finding where a feature or domain concept is defined across the codebase
Parameters Schema
ParameterTypeStatusDefaultDescription
query string Required - Query
top_k integer Optional 20 Top K
Client Invocation
MCP Client / Agent Call
search_symbols(query="verify_password", top_k=10)
Return Model: SymbolSearchResult
FieldTypeDescription
statusstringStatus
querystringQuery
resultsstringResults
canonical_idstringCanonical Id
qualified_namestringQualified Name
kindstringKind
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
Evidence Guarantee AST-extracted symbol declarations with source file and line numbers.
Epistemic Boundary Does not prove who calls or imports the matched symbols.
get_symbol CORE

Return authoritative signature, kind, parent scope, decorators, and bounded source snippet for a symbol. Primary input: `symbol` (also accepts `canonical_id` or `name` as compatibility aliases). Use when you have a symbol name or canonical_id and need its declaration metadata. Does not traverse multi-hop call graphs.

Resolves: Inspecting a symbol's signature, return type, and decorators without reading the entire file
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
name string Optional Name
Client Invocation
MCP Client / Agent Call
get_symbol(symbol="login_endpoint")
Return Model: SymbolDetailResult
FieldTypeDescription
statusstringStatus
canonical_idstringCanonical Id
qualified_namestringQualified Name
kindstringKind
signaturestringSignature
decoratorsstringDecorators
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
snippetstringSnippet
Evidence Guarantee AST-verified symbol signature, decorators, and exact line span.
Epistemic Boundary Does not prove downstream impact or callers outside the symbol body.
get_file CORE

Open and inspect a repository file's structural AST outline or a bounded line range (`path`, `start_line`, `end_line`, `max_lines`). Use after `search_code`, `find_symbol`, or `find_routes` identifies a target file and line span across Python, HTML, Jinja, JS, TS, CSS, YAML, JSON, or Markdown. Blocks path traversal, binary files, and sensitive files; does not prove cross-file callers.

Resolves: Opening a targeted line range (`start_line`, `end_line`) of a Python, HTML, Jinja, JS, CSS, or config file
Parameters Schema
ParameterTypeStatusDefaultDescription
path string Required - Path
start_line any Optional None Start Line
end_line any Optional None End Line
max_lines integer Optional 200 Max Lines
include_content boolean Optional False Include Content
Client Invocation
MCP Client / Agent Call
get_file(path="templates/dashboard.html", start_line=40, end_line=110)
Return Model: FileStructureResult
FieldTypeDescription
statusstringStatus
pathstringPath
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
contentstringContent
truncatedbooleanTruncated
categorystringCategory
file_categorystringFile Category
artifact_typestringArtifact Type
symbolsarraySymbols
importsstringImports
freshnessbooleanFreshness
Evidence Guarantee Bounded on-disk source lines (`start_line`..`end_line`, `truncated`) plus parser-extracted symbols and imports.
Epistemic Boundary Does not prove reverse dependents across the repository.
get_references CORE

Return verified and candidate references to a symbol across the repository with evidence_class labels. Primary input: `symbol` (also accepts `canonical_id` or `name` as compatibility aliases). Use for cross-file reference, registration, dispatch, or DI binding lookup. Does not guarantee dynamic reflection targets when evidence_class is UNKNOWN or POSSIBLE.

Resolves: Finding all usages, registrations, or DI bindings of a symbol across files
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
name string Optional Name
Client Invocation
MCP Client / Agent Call
get_references(symbol="command_registry")
Return Model: ReferenceListResult
FieldTypeDescription
statusstringStatus
canonical_idstringCanonical Id
referencesstringReferences
relationshipstringRelationship
evidence_classstringEvidence Class
confidencestringConfidence
filestringFile
start_lineintegerStart Line
Evidence Guarantee Source-backed reference locations with explicit confidence and evidence_class.
Epistemic Boundary Does not prove runtime execution order or unindexed external consumers.
get_imports CORE

Return parser-extracted module and symbol imports for a file or symbol (`file` or `symbol`; `canonical_id` and `path` supported as aliases). Use for forward dependency and package boundary questions. Does not return reverse importers (use get_dependents for reverse dependencies).

Resolves: Inspecting what modules or workspace packages a file depends on
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol any Optional None Symbol
file any Optional None File
canonical_id any Optional None Canonical Id
path any Optional None Path
Client Invocation
MCP Client / Agent Call
get_imports(file="src/auth/routes.py")
Return Model: ImportsResult
FieldTypeDescription
statusstringStatus
filestringFile
importsstringImports
sourcestringSource
targetstringTarget
relationshipstringRelationship
evidence_classstringEvidence Class
Evidence Guarantee AST-verified import statements and resolved internal module paths.
Epistemic Boundary Does not prove whether an imported symbol is actually invoked at runtime.
get_dependents CORE

Return files, symbols, and packages that import or depend on the target symbol or file (`symbol` or `file`; `canonical_id` and `path` supported as aliases). Use for blast-radius, change-impact, and package boundary analysis. Does not prove runtime failure without checking test and caller evidence.

Resolves: Determining which modules or packages break if a shared symbol or file signature changes
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol any Optional None Symbol
file any Optional None File
canonical_id any Optional None Canonical Id
path any Optional None Path
Client Invocation
MCP Client / Agent Call
get_dependents(file="src/auth/repository.py")
Return Model: DependentsResult
FieldTypeDescription
statusstringStatus
dependentsstringDependents
sourcestringSource
targetstringTarget
relationshipstringRelationship
evidence_classstringEvidence Class
filestringFile
Evidence Guarantee Verified reverse import and call edges pointing to the target.
Epistemic Boundary Does not prove unindexed external repository consumers.
get_architecture CORE

Return structural repository overview including modules, workspace packages (`DEPENDS_ON_PACKAGE`), entrypoints, and layer relationships. Use for high-level architecture, monorepo package boundary, and onboarding questions. Does not replace symbol-level evidence for specific bug fixes.

Resolves: Understanding overall system structure, entrypoints, and monorepo package dependencies
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_architecture()
Return Model: ArchitectureOverviewResult
FieldTypeDescription
statusstringStatus
modulesstringModules
packagesstringPackages
package_dependenciesstringPackage Dependencies
entrypointsstringEntrypoints
routesarrayRoutes
summarystringSummary
Evidence Guarantee Manifest-backed workspace packages and AST-verified module dependency counts.
Epistemic Boundary Does not infer package boundaries from directory names without manifest evidence.
get_context CORE

Compile a token-bounded, coverage-optimized ContextPacket containing verified symbols, compressed relationships, routes, DI providers, packages, and related tests. Primary input: `query` (natural-language question, symbol, or task description; `task` is also supported as a compatibility alias for string or structured TaskSpec dict). Budget controls: `max_tokens` (default 4000, hard cap 20000), `max_files` (default 25, hard cap 40), `max_lines` (default 500, hard cap 1500). Preserves UNKNOWN, POSSIBLE, and AMBIGUOUS states explicitly. Does not return full raw files; use targeted get_file or read_file only if exact omitted lines are needed afterward.

Resolves: Investigating a bug, route flow, DI chain, or multi-file feature in one bounded call
Parameters Schema
ParameterTypeStatusDefaultDescription
query string Optional Query
task any Optional Task
intent any Optional None Intent
max_tokens integer Optional 4000 Max Tokens
max_files integer Optional 25 Max Files
max_lines integer Optional 500 Max Lines
top_k integer Optional 25 Top K
plan any Optional None Plan
mode string Optional BALANCED Mode
explain boolean Optional False Explain
resource_mode any Optional None Resource Mode
Client Invocation
MCP Client / Agent Call
get_context(query="How does UserRepository get injected into UserController", intent="DEBUG", max_tokens=4000)
Return Model: ContextPacket
FieldTypeDescription
symbolsarraySymbols
relationshipsstringRelationships
routesarrayRoutes
testsarrayTests
packagesstringPackages
unknownsstringUnknowns
conflictsstringConflicts
uncertaintiesstringUncertainties
freshnessbooleanFreshness
selected_tokensintegerSelected Tokens
candidate_tokensintegerCandidate Tokens
selected_filesarraySelected Files
selected_linesintegerSelected Lines
coverage_scorestringCoverage Score
truncatedbooleanTruncated
candidate_token_estimatestringCandidate Token Estimate
selected_token_estimatestringSelected Token Estimate
context_reduction_pctstringContext Reduction Pct
coveragestringCoverage
Evidence Guarantee Bounded source snippets, compressed relationships with supporting_locations, coverage_score, budget metadata (selected_tokens, candidate_tokens, selected_files, selected_lines, truncated), and explicit UNKNOWN/POSSIBLE/AMBIGUOUS preservation.
Epistemic Boundary Does not execute code or fabricate edges for unresolvable dynamic dispatch.
read_file CORE

Read a bounded line range (1..500 lines) of a non-sensitive repository file. Use AFTER CodeGraph tools identify the exact file and line span, or directly for trivial single-file edits. Blocks path traversal and sensitive credential files. Does not compute cross-file relationships.

Resolves: Inspecting exact implementation lines inside a symbol span identified by CodeGraph
Parameters Schema
ParameterTypeStatusDefaultDescription
path string Required - Path
start_line integer Optional 1 Start Line
end_line integer Optional 200 End Line
Client Invocation
MCP Client / Agent Call
read_file(path="src/auth/service.py", start_line=10, end_line=45)
Return Model: FileContentSlice
FieldTypeDescription
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
contentstringContent
Evidence Guarantee Exact on-disk source lines within repository privacy boundaries.
Epistemic Boundary Does not compute cross-file callers, DI bindings, or test links.
search_code CORE

Search literal text, HTML/Jinja template IDs, UI strings, CSS selectors, config keys, or route paths across readable repository files and indexed code chunks. Use instead of grep when searching for exact text, button labels, or template strings. Does not prove semantic call, import, or route relationships; never creates semantic graph edges from text matches.

Resolves: Locating UI button labels, HTML/Jinja template IDs, CSS selectors, error message strings, SQL fragments, or configuration keys
Parameters Schema
ParameterTypeStatusDefaultDescription
query string Required - Query
top_k integer Optional 10 Top K
path_filter any Optional None Path Filter
file_types any Optional None File Types
include_tests boolean Optional True Include Tests
include_configs boolean Optional True Include Configs
max_results integer Optional 20 Max Results
Client Invocation
MCP Client / Agent Call
search_code(query="Add Manual Entry", top_k=10)
Return Model: CodeChunkSearchResult
FieldTypeDescription
pathstringPath
filestringFile
lineintegerLine
start_lineintegerStart Line
end_lineintegerEnd Line
matched_textstringMatched Text
snippetstringSnippet
categorystringCategory
file_categorystringFile Category
match_typestringMatch Type
symbolstringSymbol
scorestringScore
reasonstringReason
Evidence Guarantee Ranked source and text matches with file path, exact line number, matched_text, snippet, match_type, and file_category.
Epistemic Boundary Does not prove module import graphs or caller/callee relationships; never creates semantic edges.
find_symbol CORE

Find function, method, or class definitions by exact short name or qualified name (`symbol`; `name` and `canonical_id` supported as aliases). Use instead of grep when locating where a class, function, or method is defined. Does not return callers, callees, or ambiguity alternatives like resolve_symbol.

Resolves: Quickly listing all definitions matching an exact symbol name
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
name string Optional Name
canonical_id string Optional Canonical Id
Client Invocation
MCP Client / Agent Call
find_symbol(symbol="InventoryService")
Return Model: SymbolLocationList
FieldTypeDescription
symbolstringSymbol
kindstringKind
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
Evidence Guarantee AST-indexed symbol rows matching name or qualified_name.
Epistemic Boundary Does not disambiguate routes or compute call relationships.
find_references CORE

Find textual occurrences and references of a symbol name (`symbol`; `name` and `canonical_id` supported as aliases) across indexed code chunks. Use when locating references or mentions of an identifier across files. Does not prove semantic call edges; use get_references when full relationship classification is required.

Resolves: Finding all code chunks referencing an identifier across the repository
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
name string Optional Name
canonical_id string Optional Canonical Id
Client Invocation
MCP Client / Agent Call
find_references(symbol="parse_bill")
Return Model: ChunkReferenceList
FieldTypeDescription
filestringFile
symbolstringSymbol
start_lineintegerStart Line
end_lineintegerEnd Line
Evidence Guarantee Lexical substring matches inside indexed code chunks.
Epistemic Boundary Does not prove AST-verified call or reference semantics.
compile_task CORE

Normalize a developer question or task (`query`; `task` supported as string or TaskSpec dict alias) into a structured `TaskSpec`, ground targets against the index, detect ambiguities, and build a `RetrievalPlan`. Use before get_context when you want to inspect target resolution and ambiguity candidates prior to context retrieval. Does not retrieve source code snippets.

Resolves: Pre-checking whether task targets are ambiguous before compiling a full ContextPacket
Parameters Schema
ParameterTypeStatusDefaultDescription
query string Optional Query
task any Optional Task
max_tokens integer Optional 20000 Max Tokens
resource_mode string Optional BALANCED Resource Mode
Client Invocation
MCP Client / Agent Call
compile_task(query="Debug AuthService")
Return Model: CompiledTaskPlan
FieldTypeDescription
task_specstringTask Spec
ambiguitystringAmbiguity
ambiguitiesstringAmbiguities
entry_pointsstringEntry Points
retrieval_planstringRetrieval Plan
recommended_next_stepstringRecommended Next Step
Evidence Guarantee Deterministic TaskSpec, ambiguity list, candidate entrypoints, and RetrievalPlan.
Epistemic Boundary Does not return symbol bodies or relationship edges until get_context is called.
plan_retrieval CORE

Construct a deterministic `RetrievalPlan` for a question or task (`query`; `task` supported as alias) without executing graph or source retrieval. Use to inspect planned retrieval steps, token budgets, and query expansions. Does not return code snippets or relationship edges.

Resolves: Inspecting how CodeGraph plans to allocate token budget for a complex query
Parameters Schema
ParameterTypeStatusDefaultDescription
query string Optional Query
task any Optional Task
max_tokens integer Optional 20000 Max Tokens
resource_mode string Optional BALANCED Resource Mode
Client Invocation
MCP Client / Agent Call
plan_retrieval(query="Trace payment processing")
Return Model: RetrievalPlanDict
FieldTypeDescription
intentstringIntent
stepsstringSteps
token_budgetstringToken Budget
expanded_queriesarrayExpanded Queries
ambiguitiesstringAmbiguities
Evidence Guarantee Deterministic step list, token budget allocation, and expanded queries.
Epistemic Boundary Does not execute retrieval or prove symbol relationships.
get_repository_status CORE

Return repository indexing status, generation counter, freshness state (`FRESH` or `STALE`), symbol counts, and modified/deleted file lists. Use to check whether the index is fresh before trusting cached graph facts after disk edits. Does not re-index the repository automatically.

Resolves: Checking if freshness is FRESH or STALE after editing files
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_repository_status()
Return Model: RepositoryStatusReport
FieldTypeDescription
repositorystringRepository
generationstringGeneration
freshnessbooleanFreshness
freshness_detailbooleanFreshness Detail
files_indexedarrayFiles Indexed
symbols_indexedarraySymbols Indexed
graph_edgesarrayGraph Edges
framework_routesarrayFramework Routes
modified_filesarrayModified Files
deleted_filesarrayDeleted Files
parse_failed_filesarrayParse Failed Files
Evidence Guarantee On-disk mtime/hash comparison against indexed file records.
Epistemic Boundary Does not prove external git remote state.
get_project_structure CORE

Return up to 500 indexed repository-relative source file paths in deterministic sorted order. Use for a flat inventory of indexed files when exploring a small project. Does not return package dependency graphs or entrypoints (prefer get_architecture).

Resolves: Listing indexed file paths in a small repository
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_project_structure()
Return Model: IndexedFilePathList
FieldTypeDescription
pathstringPath
Evidence Guarantee Sorted list of non-sensitive indexed file paths.
Epistemic Boundary Does not prove package ownership or module relationships.
get_dependencies CORE

List up to 500 raw parser-extracted `(source_path, imported)` rows from the imports table. Use for bulk inspection of raw import statements across the repository. Does not resolve workspace package boundaries; prefer get_imports or get_architecture.

Resolves: Auditing raw import strings across the repository
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_dependencies()
Return Model: RawImportRowList
FieldTypeDescription
source_pathstringSource Path
importedstringImported
Evidence Guarantee AST-extracted import strings per source file.
Epistemic Boundary Does not prove installed third-party package versions.
get_file_symbols CORE

List extracted symbols (`symbol`, `kind`, `start_line`, `end_line`) in a single repository-relative file. Use for a lightweight symbol table of one file when imports and artifact metadata are not needed. Does not return cross-file relationships; prefer get_file for full file outline.

Resolves: Listing symbol names and line ranges inside a single file
Parameters Schema
ParameterTypeStatusDefaultDescription
path string Required - Path
Client Invocation
MCP Client / Agent Call
get_file_symbols(path="src/auth/service.py")
Return Model: FileSymbolRowList
FieldTypeDescription
symbolstringSymbol
kindstringKind
start_lineintegerStart Line
end_lineintegerEnd Line
Evidence Guarantee AST-extracted symbol names, kinds, and line spans within `path`.
Epistemic Boundary Does not return file imports or callers.
search_memory CORE

Search local SQLite repository memory notes by keyword up to `limit` (1..100). Use only to recall previously stored local session notes. Never overrides current AST or source-file evidence; does not prove current repository state.

Resolves: Looking up user-saved architectural notes in local memory
Parameters Schema
ParameterTypeStatusDefaultDescription
query string Required - Query
limit integer Optional 20 Limit
Client Invocation
MCP Client / Agent Call
search_memory(query="auth", limit=10)
Return Model: MemoryNoteList
FieldTypeDescription
keystringKey
valuestringValue
Evidence Guarantee Local key-value notes stored in the repository memory table.
Epistemic Boundary Never proves current code structure; source code and AST evidence always take precedence.
get_evidence CORE

Return bounded source-derived `Evidence` citations (`file`, `start_line`, `end_line`, `symbol`, `snippet`, `content_hash`) for a non-sensitive file or symbol. Use when constructing hash-verifiable code citations. Blocks sensitive files and does not compute cross-file callers.

Resolves: Fetching verifiable evidence snippets for a symbol inside a known file
Parameters Schema
ParameterTypeStatusDefaultDescription
path string Required - Path
symbol any Optional None Symbol
Client Invocation
MCP Client / Agent Call
get_evidence(path="src/auth/service.py", symbol="AuthService.authenticate")
Return Model: EvidenceCitationList
FieldTypeDescription
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
symbolstringSymbol
snippetstringSnippet
content_hashstringContent Hash
Evidence Guarantee Indexed chunk snippets paired with SHA-256 content hashes and line coordinates.
Epistemic Boundary Does not compute cross-file relationship edges.
verify_evidence CORE

Verify that a cited evidence span (`file_path`, `start_line`, `end_line`) exists on disk, matches `expected_hash`, and is not stale. Use to validate whether previously retrieved evidence is still current after repository edits. Does not re-index modified files.

Resolves: Confirming a cited snippet has not drifted on disk before applying a patch
Parameters Schema
ParameterTypeStatusDefaultDescription
file_path string Required - File Path
start_line integer Required - Start Line
end_line integer Required - End Line
expected_hash any Optional None Expected Hash
symbol any Optional None Symbol
Client Invocation
MCP Client / Agent Call
verify_evidence(file_path="src/auth/service.py", start_line=1, end_line=20)
Return Model: EvidenceVerificationResult
FieldTypeDescription
validstringValid
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
reasonstringReason
current_hashstringCurrent Hash
Evidence Guarantee Cryptographic hash and line-bound check against current on-disk file content.
Epistemic Boundary Does not prove semantic correctness of the code inside the span.
get_resource_status CORE

Return current resource governor state including memory usage, pressure level, concurrency limits, and activity mode. Use for diagnosing server resource pressure or throttling behavior. Does not inspect repository source code or symbols.

Resolves: Checking if the MCP server is under memory pressure or running in CONSERVATIVE mode
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_resource_status()
Return Model: ResourceGovernorState
FieldTypeDescription
modestringMode
pressurestringPressure
rss_mbstringRss Mb
active_tasksstringActive Tasks
Evidence Guarantee Live process memory and governor concurrency telemetry.
Epistemic Boundary Does not report symbol index freshness (use get_repository_status for index freshness).
detect_semantic_conflicts CORE

Detect semantic and contract conflicts between Git branches (calling deleted symbols, broken call signatures, or missing route handlers). Use when verifying whether branches can be safely merged without semantic breakage. Does not report false conflicts when branches are structurally compatible.

Resolves: Checking if a feature branch introduces calls to symbols deleted or modified on main
Parameters Schema
ParameterTypeStatusDefaultDescription
base_branch string Optional main Base Branch
head_branch string Optional HEAD Head Branch
Client Invocation
MCP Client / Agent Call
detect_semantic_conflicts(base_branch="main", head_branch="HEAD")
Return Model: SemanticConflictResult
FieldTypeDescription
base_branchstringBase Branch
head_branchstringHead Branch
has_conflictsstringHas Conflicts
total_conflictsstringTotal Conflicts
conflictsstringConflicts
summarystringSummary
Evidence Guarantee Deterministic cross-branch AST call-site and definition verification.
Epistemic Boundary Does not execute code; reports contract incompatibility between revisions.
safe_rename CORE

Perform a deterministic, syntax-validated, transaction-safe AST rename of a symbol across the repository. Use when renaming a function, method, or class across multiple files safely with in-memory preview diffs. Does not prove runtime equivalence beyond AST syntax validation and statically verified references.

Resolves: Renaming a function, method, or class safely across multiple files without breaking references
Parameters Schema
ParameterTypeStatusDefaultDescription
target string Required - Target
new_name string Required - New Name
dry_run boolean Optional True Dry Run
force_uncertain boolean Optional False Force Uncertain
Client Invocation
MCP Client / Agent Call
safe_rename(target="AuthService", new_name="AuthenticationService", dry_run=True)
Return Model: RefactorResult
FieldTypeDescription
statusstringStatus
target_symbolstringTarget Symbol
new_namestringNew Name
riskstringRisk
files_changedarrayFiles Changed
spans_countintegerSpans Count
diffsstringDiffs
rollback_idstringRollback Id
errorsstringErrors
Evidence Guarantee Token-exact replacement with in-memory ast.parse syntax validation and atomic rollback manifest.
Epistemic Boundary Does not prove semantic preservation beyond AST syntax validation and statically verified references.
rollback_refactor CORE

Atomically rollback an applied refactoring transaction using its rollback manifest ID. Use when reverting an applied refactoring transaction to restore original source files cleanly. Does not restore files if they were modified externally after refactoring was applied.

Resolves: Undoing an applied refactoring transaction cleanly to restore original code bytes
Parameters Schema
ParameterTypeStatusDefaultDescription
transaction_id string Required - Transaction Id
Client Invocation
MCP Client / Agent Call
rollback_refactor(transaction_id="rf_12345")
Return Model: RefactorResult
FieldTypeDescription
statusstringStatus
target_symbolstringTarget Symbol
new_namestringNew Name
files_changedarrayFiles Changed
rollback_idstringRollback Id
errorsstringErrors
Evidence Guarantee Precondition SHA-256 validation and atomic file replacement with os.replace.
Epistemic Boundary Cannot rollback if files were modified externally after refactoring was applied.
get_live_services CORE

Detect and attribute active localhost services, ports, PIDs, frameworks, and workspace sub-packages with zero idle CPU. Use when diagnosing running dev servers or multi-service architectures. Does not prove live HTTP response payloads or application layer health.

Resolves: Identifying running backend and frontend dev servers
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_live_services()
Return Model: dict[str, Any]
FieldTypeDescription
live_servicesstringLive Services
configured_servicesstringConfigured Services
countintegerCount
Evidence Guarantee Kernel socket table inspection and static configuration discovery with 5-second TTL cache.
Epistemic Boundary Does not prove live HTTP response payloads or application layer health.
check_db_drift CORE

Detect database schema drift between migration files, live database state, and code ORM models with zero idle CPU. Flags unmapped tables, missing columns, and migration version state. Use when verifying whether database migrations are up to date with code models. Does not execute SQL data assertions or validate column constraints against live row data.

Resolves: Verifying whether database migrations are up to date with code models
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
check_db_drift()
Return Model: dict[str, Any]
FieldTypeDescription
statusstringStatus
unmapped_tablesarrayUnmapped Tables
missing_columnsarrayMissing Columns
migration_versionstringMigration Version
is_driftedstringIs Drifted
Evidence Guarantee Comparison of SQLite/PostgreSQL schemas and migration folder state with 5-second TTL cache.
Epistemic Boundary Does not execute SQL data assertions or validate column constraints against live row data.
get_distributed_trace CORE

Stitch and reconstruct multi-service distributed execution trees across frontend, backend, and database boundaries for a specific W3C trace ID. Use when tracing cross-service requests or debugging multi-service latency bottlenecks. Does not capture unobserved code paths or untraced sidecar requests.

Resolves: Tracing an end-to-end user request from UI click to backend SQL execution
Parameters Schema
ParameterTypeStatusDefaultDescription
trace_id string Required - Trace Id
Client Invocation
MCP Client / Agent Call
get_distributed_trace(trace_id="4bf92f3577b34da6a3ce929d0e0e4736")
Return Model: dict[str, Any]
FieldTypeDescription
trace_idstringTrace Id
statusstringStatus
root_spanstringRoot Span
total_spansstringTotal Spans
services_involvedstringServices Involved
timelineintegerTimeline
Evidence Guarantee W3C traceparent stitching across multi-service runtime observations.
Epistemic Boundary Does not capture unobserved code paths or untraced sidecar requests.
check_api_drift CORE

Detect client-server API contract drift between frontend fetch or axios calls and backend route registrations. Flags orphaned client endpoints (404s) and HTTP method mismatches (405s). Use when validating frontend API calls against backend endpoints before deployment. Does not execute live HTTP requests or validate dynamic URL strings constructed via runtime interpolation.

Resolves: Finding broken API endpoint paths in frontend client code
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
check_api_drift()
Return Model: dict[str, Any]
FieldTypeDescription
statusstringStatus
orphaned_client_routesarrayOrphaned Client Routes
method_mismatchesarrayMethod Mismatches
verified_contracts_countintegerVerified Contracts Count
Evidence Guarantee Cross-layer AST static verification comparing frontend fetch calls with backend route trees.
Epistemic Boundary Does not execute live HTTP requests or validate dynamic URL concatenation at runtime.
get_monorepo_packages CORE

Catalog monorepo workspace packages, tools (pnpm, Turborepo, npm/yarn workspaces), entry points, and inter-package dependencies. Use when mapping multi-package repository structure and package boundaries. Does not prove build system execution order or runtime dependency loading.

Resolves: Mapping multi-package repository structure and package boundaries
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_monorepo_packages()
Return Model: dict[str, Any]
FieldTypeDescription
toolstringTool
packagesstringPackages
dependency_graphstringDependency Graph
root_pathstringRoot Path
Evidence Guarantee Deterministic workspace manifest analysis across pnpm, yarn, npm, Turborepo, Cargo, and Poetry.
Epistemic Boundary Does not prove build system execution order or runtime dependency loading.
batch_get_symbols CORE

Retrieve authoritative signature, kind, parent scope, decorators, and bounded source snippet for multiple symbols in a single round-trip. Use when inspecting multiple related symbols to minimize turn count and token overhead. Does not traverse multi-hop call graphs.

Resolves: Inspecting multiple symbol declarations concurrently
Parameters Schema
ParameterTypeStatusDefaultDescription
symbols array Required - Symbols
Client Invocation
MCP Client / Agent Call
batch_get_symbols(symbols=["UserService", "OrderService"])
Return Model: dict[str, Any]
FieldTypeDescription
resultsstringResults
countintegerCount
found_countintegerFound Count
Evidence Guarantee Deterministic symbol metadata resolution across Python, TypeScript, JavaScript, and Luau AST definitions.
Epistemic Boundary Does not traverse multi-hop call graphs; use batch_find_callers for call hierarchies.
batch_get_context CORE

Compile token-bounded, coverage-optimized ContextPackets for multiple task prompts or symbol targets in a single call. Use when retrieving separate focused contexts for different sub-tasks concurrently. Does not execute repository code or tests.

Resolves: Gathering context for multiple sub-goals in parallel
Parameters Schema
ParameterTypeStatusDefaultDescription
tasks any Required - Tasks
max_tokens_per_task integer Optional 2000 Max Tokens Per Task
Client Invocation
MCP Client / Agent Call
batch_get_context(tasks=[{"query": "auth service", "intent": "DEBUG"}, {"query": "payment processor", "intent": "TRACE"}])
Return Model: dict[str, Any]
FieldTypeDescription
resultsstringResults
countintegerCount
Evidence Guarantee Strict token-budgeted context slices with coverage scoring and candidate optimization.
Epistemic Boundary Does not execute repository code or tests.
preview_semantic_patch CORE

Dry-run preview a multi-file semantic patch across repository files with pre-flight syntax validation and unified diffs. Use when verifying multi-file changes, syntax correctness, and diff previews before applying modifications to disk. Guarantees zero disk mutation during preview. Does not commit modifications to disk.

Resolves: Previewing exact unified diffs before modifying files
Parameters Schema
ParameterTypeStatusDefaultDescription
patches array Required - Patches
Client Invocation
MCP Client / Agent Call
preview_semantic_patch(patches=[{"path": "app.py", "hunks": [{"target": "old()", "replacement": "new()"}]}])
Return Model: RefactorResult
FieldTypeDescription
statusstringStatus
files_changedarrayFiles Changed
diffsstringDiffs
errorsstringErrors
Evidence Guarantee Zero disk mutation guarantee; pre-flight AST syntax validation for Python, Luau, JSON, and JS/TS.
Epistemic Boundary Does not commit modifications to disk; use apply_semantic_patch to commit.
apply_semantic_patch CORE

Atomically apply a multi-file semantic patch across repository files with pre-flight syntax validation and rollback support. Use when executing validated multi-file code modifications with transactional safety and rollback guarantees. Does not prove semantic preservation beyond syntax validation and hash preconditions.

Resolves: Executing multi-file code modifications atomically with rollback safety
Parameters Schema
ParameterTypeStatusDefaultDescription
patches array Required - Patches
dry_run boolean Optional False Dry Run
Client Invocation
MCP Client / Agent Call
apply_semantic_patch(patches=[{"path": "app.py", "hunks": [{"target": "a", "replacement": "b"}]}])
Return Model: RefactorResult
FieldTypeDescription
statusstringStatus
files_changedarrayFiles Changed
rollback_idstringRollback Id
diffsstringDiffs
errorsstringErrors
Evidence Guarantee Precondition hash verification, AST syntax validation, atomic file replacement via os.replace under RefactorLock, and persistent rollback manifest.
Epistemic Boundary Does not prove business logic correctness beyond syntax tree validity.
find_dead_code CORE

Detect zero-caller functions, classes, uncalled zombie HTTP routes, and orphaned database tables by cross-referencing AST graphs with runtime traces. Use when identifying unused code, zombie endpoints, or unread/unwritten database tables. Does not prove unobserved paths are impossible when runtime traces are absent.

Resolves: Identifying dead functions and classes before refactoring or cleanup
Parameters Schema
ParameterTypeStatusDefaultDescription
max_symbols integer Optional 50 Max Symbols
Client Invocation
MCP Client / Agent Call
find_dead_code()
Return Model: dict[str, Any]
FieldTypeDescription
repositorystringRepository
dead_symbolsarrayDead Symbols
zombie_routesarrayZombie Routes
orphaned_tablesarrayOrphaned Tables
runtime_traces_presentstringRuntime Traces Present
total_dead_countintegerTotal Dead Count
Evidence Guarantee Deterministic cross-referencing of static AST callers, route tables, DB entity readers/writers, and runtime observations.
Epistemic Boundary Does not prove unobserved paths are impossible when runtime traces are absent.
generate_pr_review CORE

Generate comprehensive semantic PR review evaluating structural diffs, caller contract breaks, affected routes, and test gaps. Use when reviewing pull requests or evaluating branch changes before merging. Does not execute repository code or guarantee merge builds pass without running tests.

Resolves: Auditing PR branches for breaking API changes and deleted symbols before merge
Parameters Schema
ParameterTypeStatusDefaultDescription
base_ref string Optional main Base Ref
head_ref string Optional HEAD Head Ref
Client Invocation
MCP Client / Agent Call
generate_pr_review(base_ref="main", head_ref="HEAD")
Return Model: dict[str, Any]
FieldTypeDescription
base_refstringBase Ref
head_refstringHead Ref
verdictstringVerdict
summarystringSummary
findingsstringFindings
files_changedarrayFiles Changed
affected_routesarrayAffected Routes
affected_testsarrayAffected Tests
suggested_test_commandstringSuggested Test Command
markdown_reportstringMarkdown Report
Evidence Guarantee Deterministic 3-way AST merge-base comparison, semantic contract verification, and test coverage gap detection.
Epistemic Boundary Does not execute repository code or guarantee merge builds pass without running tests.
federate_repositories CORE

Discover and catalog federated repositories in a multi-repo workspace. Use when mapping microservice boundaries and cross-service index sizes. Does not modify child repository indices or re-index dirty working trees automatically.

Resolves: Mapping all microservices within a multi-repo developer workspace
Parameters Schema
ParameterTypeStatusDefaultDescription
workspace_root any Optional None Workspace Root
Client Invocation
MCP Client / Agent Call
federate_repositories()
Return Model: dict[str, Any]
FieldTypeDescription
workspace_rootstringWorkspace Root
reposstringRepos
total_reposstringTotal Repos
total_linksstringTotal Links
Evidence Guarantee Deterministic inspection of workspace manifests (codegraph.workspace.json) and child repository SQLite indices.
Epistemic Boundary Does not modify child repository indices or re-index dirty working trees automatically.
store_agent_memory CORE

Store an agent debugging trajectory, test repair pattern, or architectural decision into persistent memory. Use when recording successful bug resolutions or architecture decisions for future recall. Does not share stored memory outside the local repository index.

Resolves: Saving the root cause and fix for a tricky edge-case bug for future agents
Parameters Schema
ParameterTypeStatusDefaultDescription
title string Required - Title
resolution string Required - Resolution
category string Optional BUG_FIX Category
symptoms string Optional Symptoms
root_cause string Optional Root Cause
Client Invocation
MCP Client / Agent Call
store_agent_memory(title="Fixed token leak", resolution="Closed session in finally block")
Return Model: dict[str, Any]
FieldTypeDescription
idstringId
created_atstringCreated At
session_idstringSession Id
categorystringCategory
titlestringTitle
symptomsstringSymptoms
root_causestringRoot Cause
resolutionstringResolution
filesarrayFiles
tagsstringTags
outcomestringOutcome
scorestringScore
Evidence Guarantee Atomic persistence into SQLite and FTS5 full-text index with WAL mode concurrency.
Epistemic Boundary Does not share stored memory outside the local repository index.
query_agent_memory CORE

Search past agent debugging memories and architectural decisions using FTS5 BM25 ranking. Use when investigating recurring bugs or checking past resolutions. Does not guarantee past solutions apply to unrelated bugs without semantic match.

Resolves: Checking if similar error traces or symptoms have been solved in past sessions
Parameters Schema
ParameterTypeStatusDefaultDescription
query string Required - Query
category any Optional None Category
limit integer Optional 5 Limit
max_tokens integer Optional 1500 Max Tokens
Client Invocation
MCP Client / Agent Call
query_agent_memory(query="401 token expiry")
Return Model: dict[str, Any]
FieldTypeDescription
querystringQuery
countintegerCount
memoriesstringMemories
Evidence Guarantee Deterministic FTS5 BM25 relevance ranking and recency scoring.
Epistemic Boundary Does not guarantee past solutions apply to unrelated bugs without semantic match.
analyze_dataflow_taint CORE

Analyze source-to-sink dataflow taint paths for injection and security vulnerabilities (SQL injection CWE-89, command execution CWE-78, path traversal CWE-22, SSRF CWE-918, insecure deserialization CWE-502) using AST dataflow tracking. Use when auditing endpoint security, sanitization gaps, or vulnerable data sinks. Does not execute repository code; reports AST-verified taint propagation chains.

Resolves: Auditing user-input flows into raw SQL queries, shell commands, file opens, or HTTP requests
Parameters Schema
ParameterTypeStatusDefaultDescription
entrypoint_symbol any Optional None Entrypoint Symbol
filter_cwe any Optional None Filter Cwe
max_depth integer Optional 12 Max Depth
Client Invocation
MCP Client / Agent Call
analyze_dataflow_taint(filter_cwe="CWE-89")
Return Model: dict[str, Any]
FieldTypeDescription
repositorystringRepository
total_vulnerabilitiesstringTotal Vulnerabilities
critical_countintegerCritical Count
high_countintegerHigh Count
vulnerabilitiesstringVulnerabilities
Evidence Guarantee Deterministic AST source-to-sink variable propagation and sink validation.
Epistemic Boundary Does not prove runtime exploitability when external WAF or runtime middleware blocks traffic.
repair_repository_index CORE

Perform automated self-healing, SQLite integrity verification, rebuilding corrupted FTS5 indices, pruning dangling FK references, clearing stale locks, and truncating WAL logs. Use when the repository index encounters lock contention, corrupted FTS entries, or orphaned edges. Does not delete source repository code.

Resolves: Recovering from unexpected process termination, stale lock files, or SQLite disk I/O errors
Parameters Schema
ParameterTypeStatusDefaultDescription
deep boolean Optional True Deep
vacuum boolean Optional False Vacuum
Client Invocation
MCP Client / Agent Call
repair_repository_index(deep=True, vacuum=True)
Return Model: dict[str, Any]
FieldTypeDescription
statusstringStatus
integrity_check_passedstringIntegrity Check Passed
fts_rebuiltstringFts Rebuilt
wal_checkpointedstringWal Checkpointed
stale_locks_clearedstringStale Locks Cleared
Evidence Guarantee PRAGMA integrity_check validation and atomic SQLite WAL log truncation.
Epistemic Boundary Does not restore deleted source files from outside the repository index.
get_lsp_diagnostics CORE

Collect live compiler diagnostics, type errors, and lint warnings via Language Server Protocol (LSP) daemons (pyright, gopls, rust-analyzer, clangd). Use when diagnosing compile errors, missing types, or verifying code correctness across languages. Does not modify source files; reports language-server diagnostics.

Resolves: Checking whether recent code edits introduced syntax or type check errors
Parameters Schema
ParameterTypeStatusDefaultDescription
file_path any Optional None File Path
Client Invocation
MCP Client / Agent Call
get_lsp_diagnostics(file_path="src/service.py")
Return Model: dict[str, Any]
FieldTypeDescription
workspacestringWorkspace
statusstringStatus
total_diagnosticsstringTotal Diagnostics
error_countintegerError Count
warning_countintegerWarning Count
diagnosticsstringDiagnostics
Evidence Guarantee Compiler-accurate type checker error ranges and diagnostic severities.
Epistemic Boundary Does not prove runtime correctness in untyped or dynamic script sections.
register_agent_session CORE

Register an active AI coding agent session in the multi-agent shared workspace. Use when joining a swarm or announcing an active coding task to coordinate with other agents. Does not acquire file locks.

Resolves: Announcing an agent's active task to peer agents in a shared repository
Parameters Schema
ParameterTypeStatusDefaultDescription
agent_id string Required - Agent Id
name string Required - Name
task string Required - Task
Client Invocation
MCP Client / Agent Call
register_agent_session(agent_id="claude-1", name="RefactorBot", task="Refactor auth")
Return Model: dict[str, Any]
FieldTypeDescription
agent_idstringAgent Id
namestringName
task_descriptionstringTask Description
registered_atstringRegistered At
statusstringStatus
Evidence Guarantee Atomic registration in SQLite WAL workspace registry.
Epistemic Boundary Does not lock files or prevent uncoordinated file system modifications outside CodeGraph.
claim_file_lease CORE

Claim a lease lock on a file path to prevent concurrent edit clobbering by other AI agents. Use before modifying a file in a multi-agent environment. Does not modify file content.

Resolves: Locking a core module before applying automated refactoring patches
Parameters Schema
ParameterTypeStatusDefaultDescription
agent_id string Required - Agent Id
file_path string Required - File Path
lease_type string Optional EXCLUSIVE_WRITE Lease Type
ttl_seconds number Optional 60.0 Ttl Seconds
Client Invocation
MCP Client / Agent Call
claim_file_lease(agent_id="agent-1", file_path="src/auth.py")
Return Model: dict[str, Any]
FieldTypeDescription
successbooleanSuccess
messagestringMessage
file_pathstringFile Path
agent_idstringAgent Id
lease_typestringLease Type
Evidence Guarantee Atomic mutex lock preventing overlapping write leases.
Epistemic Boundary Does not prevent manual human edits via external text editors.
release_file_lease CORE

Release one or all file leases held by an AI agent upon completing task edits. Use after committing or discarding file edits. Does not delete source files.

Resolves: Releasing file locks so waiting agents can proceed with edits
Parameters Schema
ParameterTypeStatusDefaultDescription
agent_id string Required - Agent Id
file_path any Optional None File Path
Client Invocation
MCP Client / Agent Call
release_file_lease(agent_id="agent-1")
Return Model: dict[str, Any]
FieldTypeDescription
released_countintegerReleased Count
agent_idstringAgent Id
file_pathstringFile Path
Evidence Guarantee Atomic lease release and lock clearance in SQLite registry.
Epistemic Boundary Does not commit file changes to git.
get_multi_agent_status CORE

Return consolidated multi-agent status report including active agent sessions, held file leases, and predicted AST conflicts. Use to check if other agents are working on related files. Does not acquire locks.

Resolves: Checking who is currently working on what in a multi-agent coding workspace
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
get_multi_agent_status()
Return Model: dict[str, Any]
FieldTypeDescription
workspacestringWorkspace
total_agentsstringTotal Agents
active_leases_countintegerActive Leases Count
conflicts_countintegerConflicts Count
agentsstringAgents
leasesstringLeases
conflictsstringConflicts
Evidence Guarantee Real-time SQLite inspection of active leases and AST conflict analysis.
Epistemic Boundary Does not predict future unannounced edits from unregistered agents.
evaluate_speculative_patch CORE

Project an in-memory virtual AST branch in RAM to evaluate caller breakages, parameter mismatches, and route mutations without modifying disk files. Use before writing refactoring patches. Does not modify disk files.

Resolves: Testing candidate function signature edits before committing to disk
Parameters Schema
ParameterTypeStatusDefaultDescription
patches object Required - Patches
Client Invocation
MCP Client / Agent Call
evaluate_speculative_patch(patches={"src/auth.py": "def login(user): return True"})
Return Model: dict[str, Any]
FieldTypeDescription
is_safestringIs Safe
modified_filesarrayModified Files
contract_breaksstringContract Breaks
route_mutationsstringRoute Mutations
diff_summarystringDiff Summary
Evidence Guarantee In-memory AST parsing and virtual diff contract break detection.
Epistemic Boundary Does not execute code or run test assertions.
verify_architectural_rules CORE

Evaluate declarative architectural boundaries, forbidden cross-module dependencies, and layer rules against the repository index. Use when checking pull request compliance with enterprise architecture. Does not modify code.

Resolves: Enforcing clean architecture separation between controllers and database models
Parameters Schema
ParameterTypeStatusDefaultDescription
rules any Optional None Rules
Client Invocation
MCP Client / Agent Call
verify_architectural_rules()
Return Model: dict[str, Any]
FieldTypeDescription
statusstringStatus
total_rules_checkedstringTotal Rules Checked
violations_countintegerViolations Count
violationsstringViolations
Evidence Guarantee Deterministic import edge matching against declarative glob patterns.
Epistemic Boundary Does not infer architectural intent outside configured rule patterns.
find_unreachable_code CORE

Perform DI-aware root-to-leaf reachability analysis from HTTP routes, CLIs, and crons to detect true dead code with STATIC_VERIFIED confidence. Use when pruning dead code or unused legacy modules. Does not delete code.

Resolves: Identifying unused functions, orphaned classes, and abandoned legacy endpoints
Parameters Schema
ParameterTypeStatusDefaultDescription
No arguments required.
Client Invocation
MCP Client / Agent Call
find_unreachable_code()
Return Model: dict[str, Any]
FieldTypeDescription
workspacestringWorkspace
total_symbolsarrayTotal Symbols
reachable_countintegerReachable Count
unreachable_countintegerUnreachable Count
dead_code_percentagestringDead Code Percentage
Evidence Guarantee BFS reachability traversal over calls, inheritance, and DI bindings.
Epistemic Boundary Does not prove unreachability for code invoked via external dynamic reflection or eval.
generate_semantic_changelog CORE

Synthesize human-readable release changelog categorizing breaking changes, new endpoints, and database mutations from AST diffs. Use when writing release notes or preparing deployment summaries. Does not modify git repository.

Resolves: Summarizing release highlights between two Git release tags
Parameters Schema
ParameterTypeStatusDefaultDescription
base_ref string Optional HEAD~1 Base Ref
head_ref string Optional HEAD Head Ref
Client Invocation
MCP Client / Agent Call
generate_semantic_changelog(base_ref="HEAD~5", head_ref="HEAD")
Return Model: dict[str, Any]
FieldTypeDescription
base_refstringBase Ref
head_refstringHead Ref
total_changesstringTotal Changes
breaking_changes_countintegerBreaking Changes Count
markdown_changelogstringMarkdown Changelog
Evidence Guarantee AST-diff categorization of added/removed routes, schema mutations, and API drops.
Epistemic Boundary Does not document non-code changes such as asset or documentation edits.
propagate_interprocedural_dataflow CORE

Trace inter-procedural dataflow, return type inference, and unguarded None/null dereferences across caller-callee boundaries. Use when investigating NullPointerExceptions or type contract violations. Does not execute code.

Resolves: Checking if a function returning Optional[T] causes AttributeError in downstream callers
Parameters Schema
ParameterTypeStatusDefaultDescription
target_symbol string Required - Target Symbol
Client Invocation
MCP Client / Agent Call
propagate_interprocedural_dataflow(target_symbol="find_user")
Return Model: dict[str, Any]
FieldTypeDescription
target_symbolstringTarget Symbol
inferred_return_typestringInferred Return Type
is_nullablestringIs Nullable
nullability_warningsstringNullability Warnings
Evidence Guarantee Inter-procedural signature analysis and caller dereference checking.
Epistemic Boundary Does not prove runtime null dereference if runtime input guarantees non-null.

Framework Route Discovery Tools (4)

Framework-aware HTTP route mapping for FastAPI, Flask, Django, and Express.

list_routes ROUTES

Return HTTP/RPC framework routes, mounted router prefixes (`MOUNTS`), methods, and handler symbols. Use when locating API endpoints, route handlers, or mounted sub-applications (FastAPI, Flask, Django, Express, NestJS). Does not prove runtime middleware authentication unless traced via get_context or trace_path.

Resolves: Answering 'Which route handles /api/v1/auth/login?'
Parameters Schema
ParameterTypeStatusDefaultDescription
framework any Optional None Framework
method any Optional None Method
path any Optional None Path
Client Invocation
MCP Client / Agent Call
list_routes(method="POST", path="/api/v1/auth/login")
Return Model: RouteListResult
FieldTypeDescription
statusstringStatus
routesarrayRoutes
route_pathstringRoute Path
http_methodstringHttp Method
handler_namestringHandler Name
canonical_idstringCanonical Id
frameworkstringFramework
filestringFile
lineintegerLine
evidence_classstringEvidence Class
Evidence Guarantee Framework-verified route paths, HTTP methods, composed mount prefixes, and handler canonical IDs.
Epistemic Boundary Does not prove external API gateway or reverse-proxy rewrite rules outside the repository.
find_routes ROUTES

Find HTTP/RPC framework routes, mounted router prefixes (`MOUNTS`), methods, and handler symbols across FastAPI, Flask, Django, Express, and NestJS. Use instead of grep when locating API endpoints or route handlers. Does not prove runtime middleware authentication unless traced via trace_path or get_context.

Resolves: Answering 'Where is /api/scan-bill handled?'
Parameters Schema
ParameterTypeStatusDefaultDescription
framework any Optional None Framework
method any Optional None Method
path any Optional None Path
Client Invocation
MCP Client / Agent Call
find_routes(path="/api/scan-bill")
Return Model: RouteListResult
FieldTypeDescription
statusstringStatus
routesarrayRoutes
route_pathstringRoute Path
http_methodstringHttp Method
handler_namestringHandler Name
canonical_idstringCanonical Id
frameworkstringFramework
filestringFile
lineintegerLine
evidence_classstringEvidence Class
Evidence Guarantee Framework-verified route paths, HTTP methods, composed mount prefixes, and handler canonical IDs.
Epistemic Boundary Does not prove external API gateway or reverse-proxy rewrite rules outside the repository.
check_route_schema_drift ROUTES

Use when detecting schema validation drift between a route/handler input schema (Pydantic BaseModel, Django Form, DRF Serializer) and destination database table columns. Flags MISSING_REQUIRED_COLUMN, NULLABILITY_MISMATCH, TYPE_INCOMPATIBILITY, LENGTH_CONSTRAINT_DRIFT, and UNUSED_SCHEMA_FIELD. Does not execute live requests.

Resolves: Validating route request payload models against destination database columns
Parameters Schema
ParameterTypeStatusDefaultDescription
route string Optional Route
handler string Optional Handler
table any Optional None Table
schema any Optional None Schema
Client Invocation
MCP Client / Agent Call
check_route_schema_drift(route="/api/v1/orders/checkout")
Return Model: dict[str, Any]
FieldTypeDescription
statusstringStatus
route_or_handlerstringRoute Or Handler
target_tablestringTarget Table
schema_namestringSchema Name
drift_countintegerDrift Count
critical_countintegerCritical Count
warning_countintegerWarning Count
info_countintegerInfo Count
issuesstringIssues
Evidence Guarantee Deterministic AST and database schema entity comparison.
Epistemic Boundary Does not execute live HTTP requests or live SQL transactions.
find_cross_repo_routes ROUTES

Resolve cross-repository HTTP and RPC service-to-service links across microservices. Use when tracing requests across separate repositories. Does not prove unobserved dynamic endpoints without static route or URL evidence.

Resolves: Tracing an API call in a frontend service to the corresponding backend microservice handler
Parameters Schema
ParameterTypeStatusDefaultDescription
workspace_root any Optional None Workspace Root
query any Optional None Query
Client Invocation
MCP Client / Agent Call
find_cross_repo_routes(query="/api/v1/users")
Return Model: dict[str, Any]
FieldTypeDescription
workspace_rootstringWorkspace Root
total_linksstringTotal Links
cross_repo_linksstringCross Repo Links
Evidence Guarantee Deterministic cross-repository URL pattern matching against indexed framework_routes tables.
Epistemic Boundary Does not prove unobserved dynamic endpoints without static route or URL evidence.

Test Discovery & Coverage Tools (3)

Deterministic symbol-to-test suite mapping.

find_tests TESTS

Find test files and test functions statically linked to a target symbol (`symbol`; `canonical_id` supported as alias) via direct calls, imports, fixtures, or route invocation. Use instead of grep when answering 'what tests cover symbol X?'. Does not execute tests at runtime and never fabricates coverage from lexical similarity alone.

Resolves: Selecting the exact pytest/jest test functions to run after modifying a symbol
Parameters Schema
ParameterTypeStatusDefaultDescription
symbol string Optional Symbol
canonical_id string Optional Canonical Id
max_results integer Optional 10 Max Results
Client Invocation
MCP Client / Agent Call
find_tests(symbol="parse_bill")
Return Model: RelatedTestsResult
FieldTypeDescription
test_symbolstringTest Symbol
filestringFile
start_lineintegerStart Line
end_lineintegerEnd Line
relationshipstringRelationship
evidence_classstringEvidence Class
confidencestringConfidence
reasonstringReason
Evidence Guarantee AST/fixture/route-verified links from test functions to target symbols.
Epistemic Boundary Does not prove runtime line coverage percentage or assertion completeness.
generate_test_scaffolding TESTS

Generate production-ready test scaffolding with fixtures, dependency mocks (DB sessions, HTTP clients), and boundary test cases for a symbol or route. Use when writing tests for untested functions or HTTP endpoints. Does not execute generated tests or prove test assertions pass without execution.

Resolves: Generating test scaffolding for newly added functions or methods
Parameters Schema
ParameterTypeStatusDefaultDescription
target string Required - Target
framework any Optional None Framework
Client Invocation
MCP Client / Agent Call
generate_test_scaffolding(target="process_payment")
Return Model: dict[str, Any]
FieldTypeDescription
target_symbolstringTarget Symbol
target_filestringTarget File
frameworkstringFramework
suggested_test_filestringSuggested Test File
test_codestringTest Code
mock_requirementsstringMock Requirements
test_casesstringTest Cases
Evidence Guarantee Deterministic callee inspection, database dependency tracking, and framework signature analysis.
Epistemic Boundary Does not execute generated tests or prove test assertions pass without execution.

CLI Commands Reference (13 Commands)

CodeGraph MCP provides 13 deterministic terminal commands for repository indexing, health auditing, MCP server hosting, and context extraction.

codegraph init [PATH] CORE LIFECYCLE

Initialize repository indexing and configuration.

Resolves: Creates the persistent SQLite index (.codegraph.sqlite3) and sets up the project graph cache without requiring external DB infrastructure.
Terminal Command
codegraph init .
Flags & Options
FlagDescription
--repository, -r <path>Repository path
--jsonMachine-readable JSON output
Terminal Output
Deterministic Output
Initialized CodeGraph repository at /path/to/repo (indexed 190 files)
codegraph index [PATH] CORE LIFECYCLE

Perform incremental AST & relationship indexing with 16-phase telemetry.

Resolves: Detects modified or deleted files using content hashes and Git commits; only re-indexes what changed in milliseconds.
Terminal Command
codegraph index . --verbose
Flags & Options
FlagDescription
--verbose, -vShow phase-by-phase timings and memory usage
--quiet, -qSuppress progress blocks
--jsonOutput phase metrics as JSON
Terminal Output
Deterministic Output
Phase: Repository Scan [190/190 files, 100%] elapsed: 0.09s
Phase: Final Commit & Checkpoint
scanned=190 indexed=1 unchanged=189 removed=0
codegraph status [PATH] HEALTH & FRESHNESS

Inspect index freshness, file counts, and resource consumption in < 5ms.

Resolves: Eliminates slow full-repo scans before queries by checking git commit HEAD match and working tree status instantly.
Terminal Command
codegraph status .
Flags & Options
FlagDescription
--repository, -r <path>Repository path
Terminal Output
Deterministic Output
{
  "status": "FRESH",
  "files": 190,
  "symbols": 1944,
  "graph_edges": 14293,
  "resource_profile": "BALANCED"
}
codegraph doctor [PATH] HEALTH & FRESHNESS

Verify SQLite schema integrity, foreign keys, FTS search, and orphaned processes.

Resolves: Detects database corruption, schema mismatches, duplicate canonical symbol IDs, and stale background processes.
Terminal Command
codegraph doctor --database
Flags & Options
FlagDescription
--databaseRun deep schema & foreign key checks
--processesAudit active MCP processes and parent PIDs
--jsonOutput diagnostic report as JSON
Terminal Output
Deterministic Output
{
  "status": "OK",
  "database_version": 8,
  "foreign_keys": true,
  "issues": []
}
codegraph run <COMMAND...> RUNTIME TELEMETRY

Zero-friction runtime telemetry interceptor.

Resolves: Bypasses the complexity of setting up OpenTelemetry or Pino streaming. Injects lightweight NODE_OPTIONS or PYTHONSTARTUP hooks to record live HTTP routes, latencies, and uncaught exceptions directly into SQLite.
Terminal Command
codegraph run npm run dev
# or
codegraph run uvicorn main:app --reload
Flags & Options
FlagDescription
--sample-rate <float>Trace sampling rate (0.0 to 1.0, default 1.0)
Terminal Output
Deterministic Output
>> Dev server active on port 8000
[CodeGraph Runtime Interceptor: Captured 14 HTTP spans -> .codegraph/runtime.sqlite3]
codegraph serve [PATH] MCP SERVER

Run the Model Context Protocol (MCP) server over stdio or SSE HTTP.

Resolves: Connects AI coding agents (Claude, Cursor, Antigravity) to the repository intelligence graph via JSON-RPC standard I/O or persistent SSE HTTP.
Terminal Command
codegraph serve . --transport sse --port 8765
Flags & Options
FlagDescription
--profile <name>Tool profile (core | minimal | agent | developer | full)
--transport, -t <stdio|sse>Transport layer (default: stdio)
--host <str>Host for SSE server (default: 127.0.0.1)
--port, -p <int>Port for SSE server (default: 8765)
Terminal Output
Deterministic Output
CodeGraph MCP server running on http://127.0.0.1:8765/sse (62 tools registered)
codegraph stop [PATH] PROCESS LIFECYCLE

Safely terminate active CodeGraph background processes and release SQLite file locks.

Resolves: Prevents "database is locked" crashes by gracefully signalling MCP servers to close connections before unmounting or updating.
Terminal Command
codegraph stop --json
Flags & Options
FlagDescription
--all, -aStop all CodeGraph processes across all repositories
--timeout <sec>Graceful shutdown timeout before SIGKILL
--jsonOutput machine-readable JSON
Terminal Output
Deterministic Output
{
  "status": "ok",
  "stopped_count": 1,
  "stale_cleaned_count": 0
}
codegraph install [PATH] AGENT ONBOARDING

Idempotently detect and configure AI coding agents.

Resolves: Eliminates manual JSON config editing. Detects Claude Code, Cursor, Antigravity, Cline, and Codex; injects mcpServers and safe marker-bounded instructions.
Terminal Command
codegraph install --yes --target auto --location local
Flags & Options
FlagDescription
--target, -t <auto|all|agent>Target specific agents
--location, -l <local|global>Project (.cursor/mcp.json) vs user global (~/.claude.json)
--yes, -yNon-interactive confirmation
--dry-runPreview changes without writing
Terminal Output
Deterministic Output
Configured Claude Code (CLAUDE.md, .mcp.json)
Configured Cursor (.cursor/mcp.json, .cursorrules)
Configured Antigravity (.agents/mcp_config.json, AGENTS.md)
codegraph search <QUERY> CODE EXPLORATION

Search symbols and text chunks with AST-verified evidence.

Resolves: Combines SQLite FTS5 lexical matching with exact symbol grounding; returns exact file lines, content hashes, and match confidence.
Terminal Command
codegraph search "create_order" -r .
Flags & Options
FlagDescription
--repository, -r <path>Repository path
--top_k <int>Number of results to return (default: 10)
--jsonMachine-readable JSON output
Terminal Output
Deterministic Output
Found 1 symbol match:
  src/app/orders.py:42 function create_order(user_id: int, items: list) -> Order
codegraph routes [PATH] FRAMEWORK INTELLIGENCE

Discover HTTP endpoints with composed router mount prefixes.

Resolves: Finds composite router mounts across FastAPI, Flask, Django, and Express. Handles include_router prefixes and nested mounts statically.
Terminal Command
codegraph routes -r . --limit 3
Flags & Options
FlagDescription
--limit <int>Bounded pagination limit (default: 50)
--offset <int>Pagination offset (default: 0)
--jsonOutput routes as JSON
Terminal Output
Deterministic Output
Found 3 route(s):
  [GET]  /api/v1/health -> health_check (src/api.py:14)
  [POST] /api/v1/orders -> create_order (src/orders.py:42)
  [GET]  /api/v1/users/{id} -> get_user (src/users.py:88)
codegraph trace <SYMBOL> GRAPH TRAVERSAL

Trace a symbol definition, callers, and callees with explicit confidence labels.

Resolves: Traverses AST call graphs multi-hops deep, highlighting exact call sites and distinguishing AST_VERIFIED from dynamic UNKNOWN calls.
Terminal Command
codegraph trace OrderService.create_order -d 2
Flags & Options
FlagDescription
-d, --depth <int>Traversal depth (default: 1)
--jsonOutput call hierarchy as JSON
Terminal Output
Deterministic Output
Symbol: OrderService.create_order (src/services/order.py:28)
  ▲ Callers (1):
    - [AST_VERIFIED] api.create_order_endpoint (src/api.py:52)
  ▼ Callees (2):
    - [AST_VERIFIED] UserRepository.get_by_id (src/db/users.py:15)
    - [AST_VERIFIED] OrderRepository.insert (src/db/orders.py:40)
codegraph context <QUERY> CONTEXT OPTIMIZATION

Compile token-budgeted ContextPacket for an AI agent task.

Resolves: Selects the top high-signal symbols and slices needed for a specific task intent (DEBUG, TRACE, REVIEW) fitting strictly within a token budget.
Terminal Command
codegraph context "fix order validation error" --intent DEBUG
Flags & Options
FlagDescription
--intent <str>Task intent (UNDERSTAND | DEBUG | TRACE | REVIEW | IMPACT)
--max-tokens <int>Token limit (default: 8000)
--jsonOutput serialized ContextPacket
Terminal Output
Deterministic Output
ContextPacket compiled (540 tokens, reduction: 78.4%):
  - 4 confirmed symbols, 2 database tables, 1 covering test
codegraph privacy [PATH] SECURITY & COMPLIANCE

Verify repository privacy boundaries and ensure no sensitive data is indexed.

Resolves: Scans SQLite database to guarantee that .env files, RSA private keys, JWTs, and database credentials have been redacted and never saved.
Terminal Command
codegraph privacy .
Flags & Options
FlagDescription
--jsonOutput privacy audit as JSON
Terminal Output
Deterministic Output
Privacy Audit PASSED: 0 sensitive files indexed, 0 exposed secrets found.
codegraph git-state [PATH] GIT INTELLIGENCE

Track Git branch, HEAD commit, indexed commit, and working-tree modifications.

Resolves: Instantly determines if the CodeGraph index is CLEAN, DIRTY, or STALE relative to working tree and HEAD with sub-millisecond caching.
Terminal Command
codegraph git-state
Flags & Options
FlagDescription
--repository, -r <path>Repository path
--jsonOutput git state as JSON
Terminal Output
Deterministic Output
Git Repository: /path/to/repo
Branch:         main
Current HEAD:   3d71eca
Indexed HEAD:   3d71eca
Freshness:      CLEAN
Working Tree:   0 modified, 0 untracked
codegraph git-diff [base] [head] GIT INTELLIGENCE

Compute structural AST-level difference between Git revisions, commits, or branches.

Resolves: Detects added, removed, and modified functions, classes, and parameter signatures—not merely raw textual line diffs.
Terminal Command
codegraph git-diff HEAD~1 HEAD
Flags & Options
FlagDescription
--branch, -bPerform hierarchical branch architecture comparison
--jsonOutput structural diff as JSON
Terminal Output
Deterministic Output
Structural Git Diff (HEAD~1 -> HEAD):
  Modified Files: 2
  Added Symbols:    3 (OrderValidator.validate_currency, ...)
  Modified Symbols: 1 (PaymentGateway.charge)
  Affected Routes:  1 (POST /api/v1/orders/pay)
codegraph git-impact [base] [head] GIT INTELLIGENCE

Compute deep downstream change impact across callers, callees, framework routes, tests, and DB.

Resolves: Reveals the full blast radius of a Git change before merging, with token-bounded results and an ASCII tree visualization.
Terminal Command
codegraph git-impact --tree
Flags & Options
FlagDescription
--tree, -tDisplay visual impact tree
--depth, -d <int>Max caller traversal depth (default: 2)
--max-results, -m <int>Max items per category (default: 30)
--jsonOutput impact as JSON
Terminal Output
Deterministic Output
Impact Tree for commit 3d71eca:
└── src/services/auth.py (AuthService.verify_token)
    ├── [CALLER] api.routes.auth (login_handler)
    │   └── [ROUTE] POST /api/v1/auth/login
    ├── [DB_WRITER] models.user (update_last_login)
    └── [TEST] tests/test_auth.py::test_verify_token
codegraph git-conflicts [base] [head] GIT INTELLIGENCE

Detect semantic and contract merge conflicts between branches before merge.

Resolves: Flags silent merge conflicts that standard Git merges miss—such as branch A calling a function or route handler that branch B deleted or altered.
Terminal Command
codegraph git-conflicts main feature-payments
Flags & Options
FlagDescription
--repository, -r <path>Repository path
--jsonOutput conflicts as JSON
Terminal Output
Deterministic Output
Semantic Conflict Analysis (main <-> feature-payments):
  [CRITICAL] Branch 'feature-payments' registers route 'POST /api/checkout' pointing to handler 'process_checkout', which was deleted in 'main'.
codegraph check-freshness [TASK] GIT INTELLIGENCE

Validate whether compiled context remains VALID, PARTIALLY_STALE, or STALE against repository changes.

Resolves: Determines whether an AI agent's previously compiled context is still trustworthy without throwing away context when unrelated files changed.
Terminal Command
codegraph check-freshness "refactor payment flow"
Flags & Options
FlagDescription
--repository, -r <path>Repository path
--jsonOutput freshness report as JSON
Terminal Output
Deterministic Output
{
  "status": "VALID",
  "head_commit": "3d71eca",
  "context_files_changed": 0,
  "unrelated_files_changed": 2,
  "recommendation": "SAFE_TO_USE"
}
codegraph symbol-history <SYMBOL> GIT INTELLIGENCE

Trace deterministic symbol evolution across Git history: introduced, modified, moved, renamed, or deleted.

Resolves: Provides compiler-level provenance for any symbol across the commit log using Git rename metadata and stable symbol hashes.
Terminal Command
codegraph symbol-history resolve_target
Flags & Options
FlagDescription
-f, --file <str>File path where symbol is located
-m, --max-commits <int>Max commits to inspect (default: 15)
--jsonOutput symbol history as JSON
Terminal Output
Deterministic Output
Symbol History: resolve_target
  - [INTRODUCED] 3d71eca (feat: add TargetResolver for v2.1)
  - [MODIFIED]   9da7eec (refactor: support Class.method resolution)
  Confidence: AST_VERIFIED
codegraph roblox remotes [PATH] ROBLOX & LUAU

Inspect Roblox Client <-> Server RemoteEvent and RemoteFunction boundaries.

Resolves: Maps FireServer, InvokeServer, OnServerEvent:Connect, and OnServerInvoke across CLIENT_DISPATCHES_REMOTE and SERVER_HANDLES_REMOTE edges without conflating network boundaries with normal function calls.
Terminal Command
codegraph roblox remotes .
Flags & Options
FlagDescription
--jsonOutput RemoteEvent / RemoteFunction boundaries as JSON
Terminal Output
Deterministic Output
Roblox Remotes (2):
  [RemoteEvent] ReplicatedStorage.Remotes.Inventory
    ▲ Client Dispatchers: ClientController:EquipItem (src/client/controller.luau:14) [ROJO_VERIFIED]
    ▼ Server Handlers:    InventoryService:Init (src/server/services/InventoryService.luau:23) [ROJO_VERIFIED]
codegraph roblox modules [PATH] ROBLOX & LUAU

List Rojo DataModel virtual paths mapped to physical Luau files and inspect REQUIRES_MODULE edges.

Resolves: Resolves default.project.json DataModel trees (ReplicatedStorage, ServerScriptService, StarterPlayerScripts), game:GetService(...) aliases, and bounded script.Parent chains with symlink & path-traversal protection.
Terminal Command
codegraph roblox modules .
Flags & Options
FlagDescription
--jsonOutput Rojo virtual-to-physical module mappings and requires as JSON
Terminal Output
Deterministic Output
Rojo Virtual Modules:
  ReplicatedStorage.Shared.Types -> src/shared/Types.luau [ROJO_VERIFIED]
  ServerScriptService.Server.Services.InventoryService -> src/server/services/InventoryService.luau [ROJO_VERIFIED]
codegraph roblox routes [PATH] ROBLOX & LUAU

Trace end-to-end Roblox Client -> Remote -> Server -> Knit/Flamework -> DataStore execution routes.

Resolves: Connects client UI controllers across RemoteEvents/RemoteFunctions into server handlers, Knit/Flamework services, and DataStore/ProfileService persistence entities.
Terminal Command
codegraph roblox routes .
Flags & Options
FlagDescription
--jsonOutput end-to-end Roblox client-to-server routes as JSON
Terminal Output
Deterministic Output
Roblox Client ↔ Server Routes:
  ClientController:EquipItem
    --[CLIENT_DISPATCHES_REMOTE]--> ReplicatedStorage.Remotes.Inventory
    --[SERVER_HANDLES_REMOTE]-----> InventoryService:Init
    --[WRITES_PERSISTENCE]--------> persistence.roblox.datastore.PlayerInventory_v1
codegraph dead-code [PATH] HEALTH & FRESHNESS

Detect uncalled dead symbols, zombie HTTP routes, and orphaned database tables.

Resolves: Identifies functions/classes with zero static callers and zero runtime invocations, HTTP endpoints unreached at runtime, and database tables with zero readers or writers.
Terminal Command
codegraph dead-code . --json
Flags & Options
FlagDescription
--repository, -r <path>Repository path
--max-symbols, -m <int>Max dead symbols to display (default: 50)
--jsonOutput raw JSON report
Terminal Output
Deterministic Output
CodeGraph Dead Code & Zombie Route Report for my-app:
  Runtime Telemetry: PRESENT
  Total Flagged:     7
    Dead Symbols:    4
    Zombie Routes:   2
    Orphaned Tables: 1
codegraph otel-listen [PATH] RUNTIME TELEMETRY

Run embedded OpenTelemetry (OTLP/HTTP) trace receiver streaming into .codegraph.sqlite3.

Resolves: Receives standard OTLP/HTTP /v1/traces spans over port 4318, decompressing gzip and reconciling runtime call graphs into SQLite without external collector infrastructure.
Terminal Command
codegraph otel-listen --port 4318
Flags & Options
FlagDescription
--port, -p <int>Listening port (default: 4318)
--host, -h <str>Listening host (default: 127.0.0.1)
--repository, -r <path>Repository path
Terminal Output
Deterministic Output
CodeGraph OTLP HTTP Receiver listening on http://127.0.0.1:4318/v1/traces
Export traces using: export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318
[OTLP] Ingested trace batch: 12 spans -> 8 runtime graph edges
codegraph lsp [PATH] AGENT ONBOARDING

Run Language Server Protocol (LSP) server over stdio for IDE integration.

Resolves: Integrates CodeGraph intelligence directly into VS Code, Neovim, and Helix via standard LSP JSON-RPC (definitions, references, document symbols, and blast radius CodeLens).
Terminal Command
codegraph lsp .
Flags & Options
FlagDescription
--repository, -r <path>Repository path
Terminal Output
Deterministic Output
[CodeGraph LSP] JSON-RPC stdio server listening for client requests (pid=45210)
codegraph refactor patch <PATCH_FILE> CORE LIFECYCLE

Atomically preview or apply multi-file semantic patches with pre-flight syntax validation and rollback.

Resolves: Enables AI agents to apply transactional multi-file edits with 0 disk mutations on dry run, target string verification, syntax validation (Python, Luau, JS, TS, JSON), and automatic manifest rollback on failure.
Terminal Command
codegraph refactor patch patch_spec.json --dry-run
Flags & Options
FlagDescription
--dry-run, -dPreview patch diff and affected symbols without modifying disk
--repository, -r <path>Repository path
--jsonOutput patch transaction result as JSON
Terminal Output
Deterministic Output
{
  "status": "APPLIED",
  "files_modified": 2,
  "hunks_applied": 3,
  "rollback_manifest": ".codegraph/rollback_manifest.json"
}
codegraph pr-review [base] [head] GIT INTELLIGENCE

Generate semantic PR review evaluating structural diffs, contract breaks, and tests.

Resolves: Detects broken caller contracts, modified HTTP routes without tests, and deleted symbols between branches with actionable Markdown report.
Terminal Command
codegraph pr-review main HEAD
Flags & Options
FlagDescription
--output-file, -o <path>Write markdown review to file
--jsonOutput structured JSON report
Terminal Output
Deterministic Output
## 🔍 CodeGraph Semantic PR Review
Verdict: 🟢 APPROVED
Files Changed: 2 | Symbols Modified: 1 | Affected Routes: 1
codegraph generate-tests <TARGET> CODE EXPLORATION

Generate production-ready test scaffolding with fixtures and dependency mocks.

Resolves: Inspects symbol signatures, callees, and database models to generate immediately runnable test code (pytest, jest, testez).
Terminal Command
codegraph generate-tests process_payment -f pytest
Flags & Options
FlagDescription
--framework, -f <str>Target framework (pytest, jest, testez)
--output-file, -o <path>Save generated test suite to file
--jsonOutput structured JSON scaffold
Terminal Output
Deterministic Output
Generated pytest Test Scaffold for process_payment:
  Target: src/services/payment.py
  Detected Mocks: DB_SESSION via database.query
codegraph federate scan [WORKSPACE_ROOT] ARCHITECTURE

Discover and catalog federated repositories in a multi-repo microservice workspace.

Resolves: Maps repository boundaries, symbols, routes, and SQLite database paths across microservices.
Terminal Command
codegraph federate scan .
Flags & Options
FlagDescription
--jsonOutput structured JSON report
Terminal Output
Deterministic Output
Federated Workspace: /workspace
Discovered Repositories (3):
  - [users-service] Symbols: 450 | Routes: 12
  - [orders-service] Symbols: 820 | Routes: 18
codegraph federate routes [WORKSPACE_ROOT] ARCHITECTURE

Resolve cross-repository HTTP and RPC service-to-service links across microservices.

Resolves: Matches frontend/client HTTP fetch calls to downstream microservice routes across repository boundaries.
Terminal Command
codegraph federate routes .
Flags & Options
FlagDescription
--jsonOutput structured JSON links
Terminal Output
Deterministic Output
Cross-Repository Route Links:
  [STATIC_VERIFIED] frontend:src/api.ts (fetchUsers) -> users-service:src/api.py (list_users)
codegraph memory store --title ... --resolution ... HEALTH & FRESHNESS

Store agent debugging trajectory or architectural decision into persistent memory.

Resolves: Records root cause, symptoms, and resolution in local FTS5 SQLite index so agents do not repeat past mistakes.
Terminal Command
codegraph memory store -t "Fixed Auth Skew" -r "Added clock leeway" -c BUG_FIX
Flags & Options
FlagDescription
--title, -t <str>Summary of debugging session
--resolution, -r <str>Applied fix or architectural decision
--category, -c <str>BUG_FIX, ARCHITECTURE_DECISION, TEST_PATTERN
--symptoms, -s <str>Observed error trace or symptom
Terminal Output
Deterministic Output
Stored Agent Memory Record [mem_4a81b92c]:
  Category: BUG_FIX
  Title: Fixed Auth Skew
codegraph memory search <QUERY> HEALTH & FRESHNESS

Search past agent debugging memories and decisions using FTS5 BM25 ranking.

Resolves: Recalls past bug investigations and fixes instantly before an agent spends cycles debugging known issues.
Terminal Command
codegraph memory search "auth token expired"
Flags & Options
FlagDescription
--category, -c <str>Filter by category
--limit, -l <int>Max records (default: 5)
--jsonOutput structured JSON
Terminal Output
Deterministic Output
Found 1 Agent Memory Record(s) for "auth token expired":
  [BUG_FIX] Fixed Auth Skew (Relevance: 0.95)
  Resolution: Added clock leeway

Scaling Benchmarks

Empirically measured scaling metrics across codebases from 10,000 to over 1,000,000 lines of code.

Scale Cold Index Time Warm Re-index Query Latency Database Size Memory Footprint
Small (10k LOC)0.42 s0.08 s12 ms2.4 MB< 35 MB
Medium (100k LOC)2.85 s0.31 s24 ms18.2 MB< 85 MB
Large (500k LOC)11.40 s1.15 s42 ms76.5 MB< 180 MB
Monorepo (1M+ LOC)23.10 s2.40 s58 ms152.0 MB< 320 MB
Scaling Benchmark
Throughput scaling across codebase sizes
Performance Comparison
Retrieval latency: SQLite WAL + FTS5 vs Vector DBs
Navigate with mouse or Esc to close CodeGraph MCP Search