Skip to main content
Glama
repomap-mcp

repomap-mcp

by mi7chal

repomap-mcp

Local stdio Model Context Protocol (MCP) server for Aider's AST Tree-sitter and PageRank repository mapping.

Deterministic, offline, zero API keys. Generates concise code skeletons to orient LLMs within token budgets.

Setup

Add to your MCP client config (Claude Desktop, Cursor, Cline):

{
  "mcpServers": {
    "repomap": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/repomap-mcp", "repomap-mcp"]
    }
  }
}

Or run directly from GitHub without cloning:

{
  "mcpServers": {
    "repomap": {
      "command": "uv",
      "args": [
        "run",
        "--from",
        "git+https://github.com/mi7chal/repomap-mcp",
        "repomap-mcp"
      ]
    }
  }
}

Related MCP server: codebase-rag

Tools

get_repo_map

Returns a PageRank-ranked code skeleton fitting within max_map_tokens, prefixed with coverage telemetry.

  • root_path (string, default: "."): Target directory (scopes candidate files; "." maps entire repo).

  • include_tests (bool, default: false): Include unit tests and tests/ directories.

  • types_only (bool, default: false): Filter to type definitions (structs, classes, interfaces, enums).

  • focus_files (list[string]): Currently active/edited files to bias PageRank towards.

  • other_files (list[string]): Explicit file list. Defaults to scoped discovered files.

  • mentioned_idents (list[string]): Symbol names to prioritize.

  • max_map_tokens (int, default: 2048): Max token budget.

  • force_refresh (bool, default: false): Invalidate tag cache.

  • auto_focus_git (bool, default: true): Automatically detect and bias ranking towards git modified/untracked files.

get_tags

Extracts Tree-sitter definitions and references for a specific file.

  • file_path (string): Target source file.

  • root_path (string, default: "."): Repository or target directory.

Cache

  • Git repos: .git/repomap-mcp/cache (natively ignored by git, zero root pollution).

  • Non-git / read-only: ~/.cache/repomap-mcp/tags-<hash>.

  • Override: REPOMAP_CACHE_DIR environment variable.

Development

uv run pytest
uv run prek run --all-files

AI Transparency

This project was developed with AI assistance.

License

Apache License 2.0. Derived from Aider by Paul Gauthier. See LICENSE and NOTICE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables LLMs to efficiently navigate large codebases by providing surgical access to specific code symbols via semantic search and call-graph queries.
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLM agents to efficiently understand and navigate a codebase by providing semantic search over symbols and a reference graph, replacing expensive grep/glob calls with structured tools like definition lookup, caller/callee queries, and change-impact analysis.
      4
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI agents to explore a repository by querying a pre-built structural knowledge graph of symbols and their relationships — definitions, callers, callees, blast radius, and file-level impact — instead of grepping and reading files. This cuts the tokens spent on code exploration by roughly 96–99% while running entirely on local SQLite with tree-sitter parsing.
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables AI agents to retrieve precise structural and semantic context from codebases using hybrid search across 166+ languages. Supports offline/local operation and automatic fallback for resilient, token-efficient code understanding.
      17 PyPI
      12
      Apache 2.0