codemap
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CodeMap AI
Call graph analyzer for understanding code impact and execution flows - built for Claude Code
Stop guessing what breaks when you change code. CodeMap builds a call graph of your Python, TypeScript and JavaScript code. It tells you, and Claude, which functions, endpoints and services depend on what you are about to change.
Call graph: functions, classes and methods, and who calls whom across files. Follows imports, aliases, re-exports,
tsconfigpaths, Python packages,self/this/superand typed variables.Impact of your changes:
codemap impactcompares your working tree with the last commit and reports:changed functions and their callers
affected HTTP endpoints
removed calls (security checks flagged)
imports removed while still used
returned fields that callers still read
Docker Compose services whose entry point changed
Claude Code integration: an MCP server with
codemap_impact,codemap_callersandcodemap_trace_flow, so Claude can look up the real callers instead of guessing.Visualization:
codemap visualizeopens an interactive graph of the impact in your browser.Framework aware: FastAPI routes and
Depends(), MongoDB-style calls, React components used in JSX.Fast and local: incremental, hash-based re-indexing into a SQLite file in
.codemap/. Nothing leaves your machine.
Requirements
Node.js 20 or newer
git (optional, needed for precise change detection in
codemap impact)macOS or Linux (tested in CI). Windows is not tested yet; reports are welcome.
CodeMap uses native modules (
tree-sitter,better-sqlite3). Prebuilt binaries cover the common platforms; elsewhere npm compiles them, which needs Python and a C/C++ toolchain.
Related MCP server: engram-serve
Installation
# Run it without installing
npx codemap-ai init
# Or install it globally (provides the `codemap` and `codemap-ai` commands)
npm install -g codemap-aiQuick start
cd your-project
# 1. Index the project and register the MCP server for Claude Code
npx codemap-ai init
# 2. Before opening a PR: what do my uncommitted changes affect?
npx codemap-ai impact
# 3. See it as a graph in the browser
npx codemap-ai visualizeThen ask Claude things like:
"What would break if I change
authenticate_user?""Who calls
get_user_permissions?""Show me the call path from
handle_checkouttosave_order."
Add .codemap/ to your .gitignore: the index is local to each checkout.
Commands
All commands take an optional project path (default: the current directory).
codemap init [path]
Indexes the whole project and registers the MCP server in the project's
.mcp.json (Claude Code's project-scoped configuration). Other servers in
that file are kept. Claude Code asks you to approve the server the next time
it starts in this project.
Option | |
| Glob patterns to index (default: all supported source files) |
| Glob patterns to skip (default: |
| Do not touch |
| Re-initialize an already initialized project |
codemap index [path]
Builds or updates the index. Only files whose content changed are re-parsed; deleted files are removed from the index. Include/exclude patterns given here are remembered for later runs.
Option | |
| Re-parse every file |
| As for |
codemap reindex [path]
Rebuilds the index from scratch (same as index --force). Accepts --include
and --exclude.
codemap impact [path]
Analyzes your uncommitted changes (staged, unstaged and untracked files) against the last commit.
CodeMap Impact Analysis
✔ Detected 1 modified file
Modified Files:
• auth.py
Changed Functions:
• get_user (auth.py:5)
Impact Analysis:
get_user:
2 direct callers
• profile (api.py:8)
• name (api.py:14)
Affected HTTP Endpoints:
• GET /name
• GET /profile
🚨 Removed Function Calls:
CRITICAL: validate_token()
Removed from: get_user() (was line 6)
File: auth.py
⚠️ ORPHANED: No longer called anywhere!
Impact: 3 dependent functions
Risk Assessment:
CRITICAL - 3 components affectedWhat it reports:
Changed functions: functions whose code differs from the last commit (also added and deleted ones), with their direct callers.
Affected HTTP endpoints: FastAPI routes handled by a changed function or one of its direct callers.
Removed function calls: calls a function no longer makes. They are flagged when the callee is no longer called anywhere ("orphaned") or looks security-related (
validate_*,*auth*,check_permission...).Import problems: an import that was removed while the name is still used. Unused imports are shown with
--verbose.Data-flow changes: a field a function stopped returning (from a returned dict/object literal) that one of its callers still reads, e.g.
user["email"].Docker services: if a changed file is the entry point of a Docker Compose service, that service and every service that depends on it.
Risk level:
LOW,MEDIUM,HIGHorCRITICAL.
Option | |
| Show callers, impacted functions and unused imports in detail |
| Print the full result as JSON (for scripts and CI) |
| Exit with code 2 when the risk is at least |
Without git, or before the first commit, changes are detected by comparing file hashes with the index, and only changed files are reported.
impact looks at uncommitted changes, so it fits best before you commit or
push. For example, in a git pre-commit hook:
npx codemap-ai impact --fail-on criticalcodemap visualize [path]
Runs the impact analysis and opens an interactive view in your browser:
a sidebar of affected functions grouped by file
a call graph with changed functions at the bottom and their callers above, colored by severity
a detail popup with callers and callees; click one to jump to it
The server listens on 127.0.0.1 only. Stop it with Ctrl+C.
Option | |
| Port for the local server (default |
| Do not open a browser (useful over SSH) |
| Passed to the analysis |
codemap mcp-server
Starts the MCP server on stdio. You do not normally run this yourself; Claude
Code starts it. The project root is --path, otherwise $CLAUDE_PROJECT_DIR,
otherwise the current directory.
Claude Code integration
codemap init adds this to .mcp.json in your project:
{
"mcpServers": {
"codemap": {
"type": "stdio",
"command": "npx",
"args": ["-y", "codemap-ai", "mcp-server", "--path", "${CLAUDE_PROJECT_DIR:-.}"]
}
}
}You can commit .mcp.json to share the setup with your team (each person
still runs codemap init or codemap index to build their own index). To
register the server only for yourself instead, skip that step and run:
claude mcp add codemap -- npx -y codemap-ai mcp-serverMCP tools
Tool | Arguments | Returns |
|
| Direct callers, everything that transitively calls it, affected files and HTTP endpoints, a risk level |
|
| Every function that calls it, with file and line |
|
| The shortest call path between two functions |
If several functions share a name, the answer says so and lists them; pass
file (relative to the project root) to pick one. Re-run codemap index
after larger changes so the answers stay current. codemap impact updates
the index for the files you changed.
Supported languages
Functions & methods | Classes & inheritance | Imports | Calls across files | Type-based method calls | |
Python ( | ✅ | ✅ | ✅ absolute, relative, packages, aliases, | ✅ | ✅ annotations, |
TypeScript ( | ✅ incl. arrow functions, class fields, object namespaces | ✅ | ✅ ESM, re-exports, barrels, | ✅ | ✅ annotations, |
JavaScript ( | ✅ incl. | ✅ | ✅ ESM and CommonJS | ✅ | ✅ |
Framework detection:
FastAPI: route decorators (
@router.post("/orders"),@app.get(...)) andDepends(...)(also insideAnnotated[...]).React: components used in JSX count as calls.
MongoDB:
collection.find_one(...)-style operations are recorded.
Limits
CodeMap does static analysis. It does not follow:
dynamic calls (
getattr,obj[name]())callbacks passed as values
dependency-injection containers
calls into libraries
When it cannot tell which function a call refers to, it leaves the call
unresolved instead of guessing. The "call resolution rate" printed by
index therefore counts library calls too, and is expected to be well below
100%. See docs/ARCHITECTURE.md for details.
Programmatic use
import { FlowStorage, FlowBuilder, DEFAULT_CONFIG, analyzeImpact } from "codemap-ai";
const storage = new FlowStorage("/path/to/project/.codemap/graph.db");
await new FlowBuilder(storage, {
rootPath: "/path/to/project",
include: DEFAULT_CONFIG.include!,
exclude: DEFAULT_CONFIG.exclude!,
forceReindex: false,
}).build();
const [fn] = storage.findSymbols("authenticate_user");
console.log(storage.getResolvedCallers(fn.id));
storage.close();
const impact = await analyzeImpact({ path: "/path/to/project" });
console.log(impact.riskLevel, impact.changedFunctions);Configuration and data
The index lives in
.codemap/graph.db(SQLite) in the project root;visualizealso writes.codemap/impact.json. Delete the folder at any time to start over.Files larger than 200 KB are skipped.
Indexes written by older versions of CodeMap are rebuilt automatically by
indexandimpact. Until then, the MCP tools ask you to runnpx codemap-ai reindexinstead of answering from the old index.
Troubleshooting
"Not initialized": run npx codemap-ai init (or index) in the project first.
impact says "No changes detected": it compares against the last commit.
Check git status. Committed changes are not "uncommitted changes".
Claude does not see the tools:
Check that
.mcp.jsonin the project contains thecodemapserver.Restart Claude Code in that project and approve the server when asked.
Run
claude mcp listto check its status.
npm install fails while building better-sqlite3 or tree-sitter:
use a supported Node.js version (20 or newer, even-numbered releases are best
supported). If there is no prebuilt binary for your platform, install a C/C++
toolchain (Xcode Command Line Tools, build-essential, or Visual Studio Build
Tools).
A call is missing from the graph: it may be dynamic or go through a library (see Limits). Please open an issue with a small example.
Contributing
Contributions are welcome! See CONTRIBUTING.md for the development setup, how to run the tests, and how to add a language. Please report bugs at https://github.com/svhozt/codemap-ai/issues.
License
Copyright 2026 Sahan Nishshanka.
Licensed under the Apache License, Version 2.0; see also NOTICE. Releases up to and including 3.8.0 were published under the MIT License.
Links
Changelog: CHANGELOG.md
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Ask who calls a route, what a change breaks or who reads a field, across a system's repos.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Every employee asks your codebase from Claude, without access to it. Statistics on each developer.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI coding assistants to query a read-only, locally indexed code graph for who-calls a function, what a function calls, call chains, and where configuration keys are defined or read, returning path:line citations with calibrated confidence and stale-index flags.9MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to query a local structural code graph, inspect relationships and impact, and retrieve focused project context before reading full files.24 npmMIT
- AlicenseAqualityCmaintenanceEnables Claude Code and other MCP clients to query a local, explainable knowledge graph of a codebase: answering questions, explaining symbols, tracing paths between them, and computing blast-radius impact, with every edge backed by file:line evidence. Read-only and fully offline — no network calls, telemetry, or runtime dependencies.51MIT
- AlicenseAqualityBmaintenanceEnables Claude and Claude Code to scan local repositories, generate interactive architecture maps, and trace transitive callers to assess change impact.359 npm1MIT