repo-map-mcp
repo-map-mcp
MCP 服务器,用于维护一个自更新的、逐文件的仓库 JSON 索引(目录、文件名、说明、函数名、时间戳),这样智能体就可以查询“哪些内容可能相关”,而不用 grep 或遍历整个仓库。
文件探索和路径标注在本地完成;描述和文件用途由智能体来提供,这样能获得更好的上下文。
安装
uv syncRelated MCP server: Moxie Docs MCP
工具
index_repository(root_path, force=False)— 遍历root_path(尊重.gitignore和硬编码排除项),对每个文件计算哈希,为变更过的文件重新解析函数名,并更新<root_path>/.repo-index/index.json处的磁盘索引。返回一个摘要字符串。get_repo_map(root_path, dir_prefix=None)— 返回 JSON 索引,可选择限定到某个子目录。search_files(root_path, query)— 对文件名、描述和函数名进行子串匹配。get_stale_files(root_path)— 返回设置了descriptionStale标志的文件及其函数名,以便调用方智能体在无需打开文件的情况下编写描述。set_description(root_path, path, description)— 将描述写回索引并移除该文件的 stale 标志。
支持函数提取的语言:Python、JavaScript、TypeScript、TSX、Java、Rust。其他文件类型也会被建立索引,其中函数为 funcs: []。
要求:
Python
uv
运行
uv run repo-map-mcp在 stdio 上运行 — 把它添加到 MCP 客户端配置(例如 Claude Code)中,将 command 指向 uv run repo-map-mcp(cwd 设为当前目录,或者使用绝对路径)。
测试
uv run pytest -q
uv run python3 scripts/smoke_client.py # end-to-end tool call smoke testAvailable Tools
5 toolsget_repo_mapA
Return the JSON repo index for root_path, optionally scoped to dir_prefix. Call this before exploring.
Inputs: root_path (required), dir_prefix. Returns: result
get_stale_filesB
Return files in root_path's index whose description is stale (funcs changed), with their funcs.
Inputs: root_path (required). Returns: result
index_repositoryB
Walk root_path, hash/parse changed files, update the .repo-index/index.json map. Returns a summary.
Inputs: root_path (required), force. Returns: result
search_filesA
Substring search over fileName/description/funcs in the repo index for root_path.
Inputs: query (required), root_path (required). Returns: result
set_descriptionB
Write a one-line description for path in root_path's index and clear its stale flag.
Inputs: path (required), root_path (required), description (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct responsibility: setting descriptions, indexing, fetching the map, searching, and retrieving stale files. No overlap or ambiguity exists between them.
All tools follow a consistent snake_case verb_noun pattern (set_description, index_repository, get_repo_map, search_files, get_stale_files). Predictable and uniform.
5 tools is a well-scoped size for a focused repository indexing server. Each tool earns its place with a clear role, no redundancy.
The tool surface covers the core workflow: indexing, description management, retrieval, search, and staleness detection. No obvious gaps; the lifecycle is fully addressed.
Maintenance
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Codebase memory for AI coding agents: files, lines, callers and tests for any public GitHub repo.
Code-map tools for AI agents: see a repo's structure first, then edit only what matters.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to intelligently navigate and understand codebases by providing instant file descriptions, semantic search, and context-aware recommendations, eliminating the need to repeatedly scan files.135 PyPI23MIT
- AlicenseNot gradedqualityCmaintenanceIndexes GitHub repositories and provides living documentation context to coding agents, enabling them to ground work in actual repository conventions and propose doc updates.233 npm2MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables agentic coding tools to maintain a living, in-repo model of intent, architecture, and code, with deterministic indexing, bidirectional linking, and continuous drift detection for task-scoped context and reconciliation.MIT