mcp-gitlab-usage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMCP GitLab Usage
MCP GitLab 使用指南
Binding rules for GitLab MCP tool invocation. Tool schemas and detailed flows live in references — read them before calling tools.
GitLab MCP工具调用的约束规则。工具架构和详细流程请参考相关文档——调用工具前请先阅读。
Harness discovery
Harness 发现
See . For GitLab product config (status labels, project ids), read when it exists.
../../ns-harness/references/harness-discovery.md{product_root}/docs/context/gitlab-sync-config.md请参阅。对于GitLab产品配置(状态标签、项目ID),请在存在时阅读该文档。
../../ns-harness/references/harness-discovery.md{product_root}/docs/context/gitlab-sync-config.mdFIRST ACTION (critical)
首要操作(至关重要)
When the human asks for requirements, planning, or issues in GitLab:
- Your first action must be with inferred arguments. Do not output planning text, RF suggestions, or issue descriptions before a tool response.
start_execution_planning - If MCP tools are unavailable: Say exactly that GitLab MCP is not available in this context. Do not output payloads that cannot be executed.
当用户在GitLab中请求需求、规划或Issue相关操作时:
- 你的首要操作必须是调用并传入推断的参数。在获取工具响应前,请勿输出规划文本、RF建议或Issue描述。
start_execution_planning - **若MCP工具不可用:**明确告知当前环境中GitLab MCP不可用。请勿输出无法执行的负载内容。
First access and version check
首次访问与版本检查
When connecting to a GitLab MCP server that exposes :
get_mcp_gitlab_skill- Call with only.
check_version: true - Compare server version to any local MCP skill copy if present.
- Call with only when missing or versions differ.
for_update: true - Do not pass and
check_versiontogether.for_update
当连接到暴露接口的GitLab MCP服务器时:
get_mcp_gitlab_skill- 仅传入调用该接口。
check_version: true - 若存在本地MCP技能副本,将服务器版本与本地版本进行对比。
- 仅当本地版本缺失或版本不一致时,传入调用该接口。
for_update: true - 请勿同时传入和
check_version参数。for_update
Mandatory practices
强制规范
- Always pass — never call tools with empty required fields.
arguments - Read tool schema before each unfamiliar call.
- Never shortcut planning — run the full MCP flow; do not return "payloads for you to apply."
- Project discovery: → send path to MCP → use numeric
git remote get-url originafter human confirms full trio (project_id,id,name).path_with_namespace
- 始终传入参数——调用工具时切勿留空必填字段。
arguments - 调用不熟悉的工具前,请先阅读工具架构。
- 切勿跳过规划流程——执行完整的MCP流程;请勿返回“供你自行应用的负载内容”。
- **项目发现:**执行→ 将路径发送给MCP → 在用户确认完整三元组(
git remote get-url origin、id、name)后,使用数字格式的path_with_namespace。project_id
Confirmation gates (non-negotiable)
确认环节(不可协商)
Cannot be inferred from context:
| Flag | Set |
|---|---|
| Human says yes to validating requirements |
| Human confirms all project trios (main, backend, frontend) |
| Human says yes to "Should I create the issues in GitLab?" |
A broad request ("do everything") is not confirmation.
无法从上下文推断确认信息:
| 标志 | 仅在以下情况后设置为 |
|---|---|
| 用户确认要验证需求时 |
| 用户确认所有项目三元组(主项目、后端项目、前端项目)时 |
| 用户对“我是否应在GitLab中创建这些Issue?”回答“是”时 |
宽泛的请求(如“全部搞定”)不视为确认。
Execution sync (status labels)
执行同步(状态标签)
Three-step cycle per issue — never skip the middle step:
status_backlog → status_in_progress → status_doneRead label names from or discover via . Full flow: .
gitlab-sync-config.mdlist_project_labelsreferences/flows.mdSOURCE_BRANCHns-execution-gitlab-issuedevelop../ns-execution-gitlab-issue/references/source-branch-resolution.md每个Issue需遵循三步循环——切勿跳过中间步骤:
status_backlog → status_in_progress → status_done请从中读取标签名称,或通过接口查询。完整流程请参阅。
gitlab-sync-config.mdlist_project_labelsreferences/flows.md**Issue执行的:**由的第1步确定——里程碑/版本发现,强制使用作为 fallback(详见)。将任务委托给该技能时,请勿随意选择基础分支。
SOURCE_BRANCHns-execution-gitlab-issuedevelop../ns-execution-gitlab-issue/references/source-branch-resolution.mdDelivery report
交付报告
- Confirm issue target (+
project_idor URL).issue_iid - Summarize diff vs agreed base branch.
- with
add_issue_comment.internal: true
- 确认Issue目标(+
project_id或URL)。issue_iid - 总结与约定基准分支的差异。
- 调用并设置
add_issue_comment。internal: true
Related skills
相关技能
- Board sync during implementation: (do not duplicate status sync rules here).
ns-gitlab-board-sync - Issue execution workflow: .
ns-execution-gitlab-issue
- 实施期间的看板同步:(此处请勿重复状态同步规则)。
ns-gitlab-board-sync - Issue执行工作流:。
ns-execution-gitlab-issue
References
参考文档
| File | When to read |
|---|---|
| Before any tool call — required args and examples |
| Planning, issue creation, execution sync, delivery report |
| SDD planning gates |
| |
| 文件 | 阅读时机 |
|---|---|
| 任何工具调用前——包含必填参数和示例 |
| 规划、Issue创建、执行同步、交付报告时 |
| SDD规划环节时 |
| |
Error handling — STOP
错误处理——立即停止
On or similar hard MCP errors: stop all GitLab operations, inform the human, wait for guidance. No workarounds.
Plan limit exceeded当出现或类似的MCP严重错误时:停止所有GitLab操作,告知用户,等待指导。请勿尝试变通方法。
Plan limit exceeded