The order it expects is check the cache, refresh, then analyse — a cached clone goes stale, and analysis built on a stale copy is analysis of the wrong code. Two levers keep large repositories workable: a max_tokens ceiling on the repository map, and scoping it to named files or directories so you can map one package instead of the whole tree.
A codebase-analysis server that caches repositories locally and answers structural questions about them, so an assistant can understand a project before touching it.
- clone_repo pulls a GitHub repository or a local codebase into the server's cache and starts building the repository map straight away
- list_remote_branches shows what a remote actually has before you clone — worth it when the default branch is not main
- list_cached_repository_branches tells you whether it is already cached, and refresh_repo brings a stale copy up to date before you analyse it
- get_source_repo_map returns a semantic map — file hierarchy, functions, classes and methods, and the relationships between them — scoped to files or directories, with a max_tokens ceiling
- get_repo_structure returns the tree with optional file listings, restricted to the directories you name
- get_repo_critical_files ranks files by complexity-based importance, optionally showing the metrics behind the ranking
- get_repo_documentation gathers READMEs, API documentation, design documents, user guides and installation instructions
- get_repo_file_content reads one file or lists a directory inside the cached repository
Uv on the machine — the server runs as uvx code-understanding-mcp-server, or from a virtual environment created with uv venv. No credentials for public repositories; GITHUB_PERSONAL_ACCESS_TOKEN unlocks private ones and lifts GitHub's rate limits. Arguments tune the cache: --cache-dir moves it from ~/.cache/mcp-code-understanding and --max-cached-repos changes how many are kept (default 10). --transport selects stdio or sse, with --port for the SSE case (default 3001). The author has tested macOS and Linux; Windows is unverified.
One command — uvx code-understanding-mcp-server
