repo_clone
Clones repository code to enable test impact analysis by monitoring code changes. Supports full branch initialization or incremental merge request updates.
Instructions
克隆监控仓库的代码到本地。可用于初始化(首次拉取分支代码)或更新全量代码,也可增量拉取 MR。
定位方式(二选一):
name = 克隆单个仓库
module = 克隆该模块下的所有仓库(按 repoType 各自归位)
克隆模式(通过 mode 参数控制):
mode=full — 全量克隆分支代码(初始化 / 强制覆盖更新)
mode=incremental — 增量克隆 MR:sinceDate 拉取日期后合入的 MR / sinceMrId 拉取指定 MR 后合入的 MR
存储路径(由 repoType 决定):
frontend → Repository/Frontend repository/{repo-name}/
backend → Repository/Backend repository/{repo-name}/
行为模式(自动判断,无需用户干预):
stdio transport → 本地模式:MCP Server 直接执行 git clone
http transport → 远程模式:返回结构化 git 指令,由客户端在自己本地执行 远程模式下可通过 clientBaseDir 指定客户端本地存储路径
增量模式前提:
仓库必须配置了 repoType
需要平台支持 MR 查询(GitHub / Generic 需 mrApiTemplate)
local 平台仅支持 sinceDate 模式
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | 仓库别名(与 module 二选一) | |
| module | No | 模块名(与 name 二选一) | |
| mode | Yes | 克隆模式:full(全量)/ incremental(增量 MR) | |
| sinceDate | No | ISO 日期(如 2026-06-13)。incremental 模式下拉取该日期后合入的 MR | |
| sinceMrId | No | 基线 MR/PR ID。incremental 模式下拉取该 MR 后合入的所有 MR(不含自身) | |
| force | No | 强制覆盖已存在的目录(默认 false) | |
| clientBaseDir | No | 客户端代码存储根目录(仅 http transport 有效)。 |