Ask who calls what. Get file:line answers.
codegraph parses Python, Java, TypeScript and JavaScript with Tree-sitter, resolves names into an embedded graph database and answers callers, callees, impact and search for people and coding agents. Every result is a symbol plus a citation you can open. No LLM sits in the answer path.
pip install "codegraph[mcp] @ git+https://github.com/muhib-karim/codegraph"
Python 3.11 or 3.12 · MIT licence · indexing never executes repository code
The graph, live in your browser
This is a real index of the project's own test fixtures (162 symbols and 126 edges across four languages), exported to JSON at build time. Pick a symbol: the panel answers the same questions as the CLI, from the same edges.
Loading the sample index…
Quickstart
- Install into a virtual environment (Python 3.11+).
python3 -m venv .venv && . .venv/bin/activate pip install "codegraph[mcp] @ git+https://github.com/muhib-karim/codegraph" - Index a repository. The graph lands in
.codegraph/inside it.codegraph index path/to/repo - Ask. Rows are tab-separated: citation, symbol, kind, confidence, then depth or the definition.
exact means a static binding under the resolver's rules; heuristic marks a unique-name guess for an untyped receiver. Neither proves runtime behaviour.
tests/fixtures/web when this page was built$ codegraph callers make
src/app.ts:11 main function exact 1 src/app.ts:10
src/view.tsx:4 Badge function exact 1 src/view.tsx:3
$ codegraph callees main
src/app.ts:11 make function exact src/app.ts:6
src/app.ts:12 Registry class exact src/registry.ts:3
src/app.ts:13 Registry.add method exact src/registry.ts:6
src/app.ts:14 Ring class exact src/shapes.ts:23
src/app.ts:14 double function exact src/util.ts:7
src/app.ts:15 Registry.size method exact src/registry.ts:10
src/app.ts:15 Base.describe method heuristic src/shapes.ts:8
src/app.ts:15 Circle.area method exact src/shapes.ts:18
$ codegraph impact src/util.ts --depth 2
src/app.ts:7 make function exact 1 src/app.ts:6
src/app.ts:11 main function exact 2 src/app.ts:10
src/app.ts:14 main function exact 1 src/app.ts:10
src/view.tsx:4 Badge function exact 2 src/view.tsx:3
$ codegraph search area --kind method
src/shapes.ts:2 Shape.area method exact
src/shapes.ts:6 Base.area method exact
src/shapes.ts:18 Circle.area method exact
Give your coding agent the graph
codegraph mcp serves the index read-only over stdio with the official MCP SDK. Paths outside the indexed repository are refused, responses are paged, and every row keeps its citation and confidence.
Claude Code
claude mcp add codegraph -- /abs/.venv/bin/codegraph mcp --repo /abs/repo
Codex CLI · ~/.codex/config.toml
[mcp_servers.codegraph]
command = "/abs/.venv/bin/codegraph"
args = ["mcp", "--repo", "/abs/repo"]
- search
- symbols by name substring, exact matches first
- callers
- incoming calls and value references
- callees
- direct outgoing calls with target definitions
- impact
- what a change to a symbol or file can reach
- find_symbol
- definitions for a name or full id
- inherits
- descendants or ancestors
- dead_code
- unused candidates, never proof
- index_status
- coverage and staleness by SHA-256
Benchmark
Three pinned public repositories, cloned and indexed on the GitHub-hosted Linux runner by the benchmark CI job. The numbers below are copied from one run, unchanged.
| Repository | Files | Lines | Symbols | Edges | Index s | Peak MB | callers ms | callees ms | impact ms | search ms |
|---|---|---|---|---|---|---|---|---|---|---|
requestsPython · v2.32.3 | 36 | 11,209 | 928 | 946 | 0.41 | 124 | 4.91 | 4.12 | 15.28 | 2.83 |
zodTypeScript · v3.23.8 | 170 | 30,994 | 1,717 | 7,275 | 0.87 | 127 | 8.32 | 8.06 | 14.01 | 2.14 |
gsonJava · gson-parent-2.11.0 | 249 | 53,021 | 5,757 | 27,395 | 1.51 | 156 | 116.26 | 21.23 | 181.14 | 6.98 |
Measured on: GitHub Actions runner, ubuntu24 20261018.339.1, Linux 7.0.0-1017-azure, x86_64, 4 CPUs, Python 3.12.15; 2026-10-22; codegraph 1.1.0, commit b3daafac4283, run 39707970318. Query times are medians of 20 runs after a warm-up.