CodebaseCartographer
Local, evidence-backed codebase intelligence for safer changes.

CodebaseCartographer is a local Model Context Protocol (MCP) server and command-line tool for understanding an unfamiliar repository before changing it. It statically parses supported source files, builds a graph of modules, classes, functions, imports, and resolved local calls, and supplements that graph with local Git history when available.
It gives an MCP client such as Codex concrete repository evidence for questions like:
- What calls this function, and what does it call?
- Which modules and tests are likely affected by a proposed change?
- Where are the dependency cycles, highly connected files, or likely orphan modules?
- Who has changed this area recently, and which files tend to change with it?
CodebaseCartographer does not execute the repository it analyzes or make application-level network calls. Analysis, Git inspection, and optional caching all happen on the local machine.
Why use it
Reading files one at a time is slow and makes it easy to miss indirect dependencies. CodebaseCartographer creates a structured, inspectable starting point before a plan or edit is made.
For example, before changing PaymentService.process_refund, you can ask an MCP client to trace its callers and callees, identify related modules, inspect local Git context, and recommend tests. The response is based on the graph and reports its coverage and uncertainty, rather than presenting a guess as a fact.
The result is useful for:
- Change planning: estimate the static blast radius of a function or module change.
- Repository onboarding: identify key modules, boundaries, ownership, and hotspots without manually opening every file.
- Architecture review: surface candidate cycles, bottlenecks, tightly coupled modules, dead functions, large classes, and orphan files.
- Incident investigation: locate definitions and trace static relationships around an error, component, or code path.
How it works
flowchart LR
repo_source["Approved local repository"] --> static_parser["Static parser"]
repo_source --> git_history["Local Git history"]
static_parser --> evidence_map["Code graph with coverage and provenance"]
git_history --> evidence_map
evidence_map --> mcp_interface["Local MCP server or CLI"]
mcp_interface --> consumer["Developer or MCP client"]
The graph is static evidence, not runtime proof. Framework wiring, reflection, dependency injection, dynamic imports, and dynamic dispatch can be unresolved. CodebaseCartographer preserves that distinction in its results: unresolved and ambiguous mean it could not prove a single local target, not that a relationship does not exist.
Requirements
- Python 3.11 or newer
pipx for the recommended installation method
- Git is optional, but enables Git context, hotspot analysis, co-change data, and safe cache reuse
Install
Install the runtime
If needed, install pipx and make its application directory available on your PATH:
python -m pip install --user pipx
python -m pipx ensurepath
Open a new terminal, install CodebaseCartographer, and verify that the MCP launcher is available:
pipx install "git+https://github.com/vikky781/codebase-cartographer.git"
python -c "import shutil; assert shutil.which('cartographer-mcp'), 'cartographer-mcp is not on PATH'"
For local development, clone the repository and install the development extras:
git clone https://github.com/vikky781/codebase-cartographer.git
cd codebase-cartographer
python -m pip install -e ".[dev]"
Install the Codex plugin
Add this repository as a Codex plugin marketplace, restart the desktop app, then install Codebase Cartographer Local from Plugins:
codex plugin marketplace add vikky781/codebase-cartographer --ref main
codex plugin marketplace list
The plugin launches the installed cartographer-mcp executable over local standard input/output. If the desktop host does not inherit your PATH, configure the MCP server with the launcher’s absolute path. See local MCP setup and troubleshooting for Codex, Claude Code, and Antigravity configuration details.
Quick start
Start a fresh MCP-client session for the repository you want to inspect, then ask it to analyze an absolute path:
Use CodebaseCartographer to analyze this repository:
C:\absolute\path\to\my-repository
First summarize coverage and warnings. Then explain the architecture,
the most important modules, and what I should inspect before making changes.