MCP Repo Mapper

io.github.LovRanRan由 GitHub 账号 LovRanRan 发布v0.1.0更新于 Oct 25, 2026

Deterministic repository structure mapping for onboarding agents.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

一个本地 MCP 服务器,扫描代码仓库并向助手提供文件结构、语言构成、入口点、框架和 Python 依赖图。

可以做什么
扫描仓库路径,返回文件、语言构成、入口点、Python 依赖图和检测到的框架,并找出 Python 导入图中的循环依赖,按文件数和字节数统计各语言,检测 FastAPI、Flask、Django、Express、Spring 等框架,对 Python main、包启动脚本、Dockerfile、Node 入口等候选入口点排序,在扫描工具填充缓存后通过 repo-structure 资源读取缓存的 JSON 扫描结果。
适用场景
适合助手在解释陌生本地代码库的架构之前,先获得一份确定性的结构地图,例如代码上手或依赖审查时。它补充而非替代符号级查询和测试运行类工具。
运行要求
以 stdio 本地进程运行,从 PyPI 包 mcp-repo-mapper 安装并用 uv 启动。只扫描本地文件系统路径,无需账号、API 密钥或环境变量。
安装前请注意
它会读取本地仓库文件,只应指向你愿意暴露给助手会话的代码。依赖分析仅限 Python 且为静态解析,框架检测基于启发式标记,资源缓存为进程内内存缓存,结果可能不完整。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MCP Repo Mapper,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-repo-mapper

mcp-repo-mapper is a FastMCP server for deterministic repository structure mapping. It scans a local codebase and exposes file structure, language counts, Python import dependencies, circular dependency detection, framework detection, entry point candidates, and a cached repo structure resource.

The server does not call an LLM and does not execute user code. It is intended as a grounded structure tool for codebase onboarding agents such as wayfinder.

Codebase Onboarding Stack

mcp-repo-mapper is the structure layer in a three-server MCP tool stack for Project 6 wayfinder, a codebase onboarding agent.

  • mcp-repo-mapper maps repository structure, languages, entry points, framework evidence, and Python dependency edges.
  • mcp-ast-explorer provides symbol-grounded Python definition, signature, reference, call-chain, and class-hierarchy lookups.
  • mcp-test-runner runs local pytest/Jest checks and coverage summaries so agent claims can be verified against execution.

In wayfinder, this server feeds the architecture-mapping step before semantic explanation or test verification begins.

Features

  • scan_repo(path) returns a typed repo scan with files, language breakdown, entry points, Python dependency graph, and detected frameworks.
  • find_circular_deps(path) returns circular dependencies from the static dependency graph.
  • language_breakdown(path) returns language counts by file count and bytes.
  • detect_framework(path) detects FastAPI, Flask, Django, Express, and Spring using registry-based markers.
  • find_entry_points(path) returns ranked entry point candidates such as Python mains, FastAPI apps, package start scripts, Dockerfiles, and Node indexes.
  • repo-structure://{url_hash} returns a cached JSON scan result after a tool call has populated the cache.

Install

bash
uv sync --extra dev

Run the server locally:

bash
uv run mcp-repo-mapper

Development

bash
uv run ruff check .uv run mypyuv run pytest

Resource Flow

Resource reads use a cache populated by tool calls:

  1. Call scan_repo(path) or another scan-backed tool.
  2. Compute the repo hash with the same path.
  3. Read repo-structure://{url_hash}.

The public resource uses repo-structure://... because URL schemes cannot contain underscores.

Scope And Limitations

  • Dependency graph support is currently Python-only and based on static ast parsing.
  • Import graph resolution only records modules that exist inside the scanned repo.
  • Framework detection is heuristic marker matching, not a full build-system analysis.
  • The resource cache is in-memory and process-local.
  • The server scans local filesystem paths only.

License

MIT

来源:README.md,提交 5fe2378

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分