SuperAPI AI Directory

RepoMapper

Dynamic map of chat-related repository files with their function prototypes and related files, ranked by relevance, based on Aider's Repo Map.

Open website

About this tool

RepoMapper is a tool built on Aider's Repo Map feature, designed to generate a map of the codebase within a Git repository, primarily serving LLMs by helping them understand and navigate complex codebases. It can be used either as a command-line tool for on-demand analysis or as an MCP (Model Context Protocol) server to provide continuous repository mapping capabilities to other applications.

Purpose

The core purpose of RepoMapper is to generate a "map" of the codebase, highlighting important files, code definitions, and their relationships, so that LLMs can prioritize the most relevant information within a limited context window.

Main Capabilities

  • Intelligent Code Analysis: Uses Tree-sitter to parse source code and extract function and class definitions.
  • Relevance Ranking: Uses the PageRank algorithm to rank code elements by importance.
  • Token Awareness: Respects token limits to fit within LLM context windows.
  • Caching: Persistent caching to speed up subsequent runs.
  • Multi-language Support: Supports Python, JavaScript, TypeScript, Java, C/C++, Go, Rust, etc. (the specific supported languages depend on Tree-sitter grammars).
  • Important File Detection: Automatically identifies and prioritizes important files (such as README, requirements.txt, etc.).

The tool prioritizes files in the following order:

  1. --chat-files: Highest priority, assumed to be the file currently being worked on.
  2. --mentioned-files: High priority, files explicitly mentioned in the current context.
  3. --other-files: Lowest priority, used to provide additional context.

Usage

Basic Usage

Run as a command-line tool; the specific commands and parameters are not provided in the materials.

Advanced Options

Detailed descriptions of advanced options are not provided in the materials.

Running as an MCP Server

RepoMapper can run as an MCP server, using STDIO (standard input/output) for communication, with no additional transport layer configuration required.

Setup steps (using Cline or a similar tool as an example):

  1. Add configuration in the Cline settings file (such as cline_mcp_settings.json), replacing "/absolute/path/to/repomap_server.py" with the actual repomap_server.py file path.
  2. Run the repomap_server.py script, and the server will start and listen for requests via STDIO.
  3. Other applications can use the repo_map tool provided by the server to generate a repository map, and must specify the project_root parameter as the absolute path of the project to be mapped.

Applicable Scenarios

  • Helping LLMs understand and navigate large or complex codebases.
  • Providing continuous repository mapping capabilities to other applications (such as Cline, Roo).
  • Quickly locating important files and code definitions in code analysis and understanding tasks.

Limitations

  • Based on Aider's Repo Map feature, but according to the author, it does not share code.
  • Supported languages depend on Tree-sitter grammars; some languages are listed in the materials, but a complete list is not provided.
  • Specific command-line usage and advanced options are not described in detail in the materials.
  • The cache directory is .repomap.tags.cache.v1/, which is automatically invalidated when files change and can be cleared using --force-refresh .

Dependencies

  • tiktoken: used for token counting for various LLM models.
  • networkx: graph algorithms (PageRank).
  • diskcache: persistent caching.
  • grep-ast: Tree-sitter integration for code parsing.
  • tree-sitter: code parsing framework.
  • pygments: syntax highlighting and lexical analysis.

Updates

July 13, 2025: Removed the project.json dependency and fixed the MCP server, making it easier for LLMs to use with respect to file names.