npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iflow-mcp/chntif-mcp-gitlab-workflow

v0.1.2

Published

GitLab MCP: supports creating issues from requirements or modifying code and submitting merge requests from existing issues, while also providing a set of atomic GitLab API tools for issue-driven development.

Readme

mcp-gitlab-workflow

English | 简体中文

mcp-gitlab-workflow 是一个面向 GitLab Issue 开发的 MCP Server。

它可以基于一段需求或一个现有 Issue,自动串起一条规范化开发链路:需求解析、创建 Issue、拉取分支、修改代码、创建 MR、回填 Issue。同时也提供一组 GitLab API 原子化工具,用于自定义编排和精细控制。

1. 核心能力

  • workflow_*:将常见的需求到交付流程整合为单个工具调用
  • gitlab_*:GitLab 原子 API 工具,适合自定义编排与精细控制

Issue 目标项目和代码交付目标项目通过 WORKFLOW_ISSUE_PROJECT_IDWORKFLOW_CODE_PROJECT_ID 配置。完整配置见下方环境变量章节。

Workflow 工具

  • workflow_requirement_to_issue:分析需求并创建 Issue
  • workflow_review_mr_post_comment:审查指定 MR 并发布评论
  • workflow_issue_to_delivery:基于已有 Issue 完成分支 -> 代码修改 -> MR -> Issue 评论 -> Issue Log
  • workflow_requirement_to_delivery:从需求开始完成完整交付流程

GitLab 原子工具

Issue 类工具默认回落到 WORKFLOW_ISSUE_PROJECT_ID,代码和 MR 类工具默认回落到 WORKFLOW_CODE_PROJECT_ID

  • 用户与标签:gitlab_get_current_usergitlab_list_labelsgitlab_create_labelgitlab_update_labelgitlab_delete_label
  • Issue:gitlab_create_issuegitlab_get_issuegitlab_get_issue_notesgitlab_add_issue_commentgitlab_get_issue_images
  • 仓库:gitlab_create_branchgitlab_get_filegitlab_commit_filesgitlab_upload_project_file
  • MR:gitlab_get_merge_requestgitlab_get_mr_notesgitlab_create_merge_requestgitlab_create_mr_notegitlab_get_mr_changesgitlab_approve_mrgitlab_unapprove_mr

2. 使用示例

workflow_requirement_to_delivery 为例。为了让 LLM 更稳定地选择目标 workflow,建议在提示词中显式写出 tool 名称,或者封装为自定义指令 / skill。

输入

使用 workflow_requirement_to_delivery 添加论坛互动功能

效果

该流程可以自动完成:

需求解析 -> 创建 Issue -> 拉取分支 -> 修改代码 -> MR -> 回填 Issue

image-1

(1) Issue 创建

Issue创建

(2) 基于 issue 修改代码并提交 MR

MR

(3) Issue 评论

issue评论

(4) 本地 issue-log.md

issue-log.md

通过这条流程,开发者可以将一个需求或分配给自己的 Issue 直接交给 agent,自动完成面向 Issue 的开发交付。

3. 配置

3.1 使用 NPX

{
  "mcpServers": {
    "gitlab-workflow": {
      "command": "npx",
      "args": ["-y", "@chntif/mcp-gitlab-workflow"],
      "env": {
        "GITLAB_TOKEN": "YOUR_TOKEN",
        "GITLAB_API_BASE_URL": "https://gitlab.com/api/v4",
        "WORKFLOW_ISSUE_PROJECT_ID": "82346102",
        "WORKFLOW_ISSUE_PROJECT_PATH": "tchen1690/test",
        "WORKFLOW_CODE_PROJECT_ID": "82346102",
        "WORKFLOW_CODE_PROJECT_PATH": "tchen1690/test",
        "WORKFLOW_BASE_BRANCH": "develop",
        "WORKFLOW_TARGET_BRANCH": "develop",
        "WORKFLOW_LOCAL_REMOTE_NAME": "origin"
      }
    }
  }
}

3.2 Codex

(1) 在终端中添加

codex mcp add gitlab-workflow \
  --env GITLAB_TOKEN=YOUR_TOKEN \
  --env GITLAB_API_BASE_URL=https://gitlab.com/api/v4 \
  --env WORKFLOW_ISSUE_PROJECT_ID=80376102 \
  --env WORKFLOW_ISSUE_PROJECT_PATH=tchen1690/test \
  --env WORKFLOW_CODE_PROJECT_ID=80376102 \
  --env WORKFLOW_CODE_PROJECT_PATH=tchen1690/test \
  --env WORKFLOW_BASE_BRANCH=develop \
  --env WORKFLOW_TARGET_BRANCH=develop \
  --env WORKFLOW_LOCAL_REMOTE_NAME=origin \
  -- npx -y @chntif/mcp-gitlab-workflow

(2) 或直接写入 config.toml

[mcp_servers.gitlab-workflow]
command = "npx"
args = ["-y", "@chntif/mcp-gitlab-workflow"]

[mcp_servers.gitlab-workflow.env]
GITLAB_TOKEN = "YOUR_TOKEN"
GITLAB_API_BASE_URL = "https://gitlab.com/api/v4"
WORKFLOW_ISSUE_PROJECT_ID = "80376102"
WORKFLOW_ISSUE_PROJECT_PATH = "tchen1690/test"
WORKFLOW_CODE_PROJECT_ID = "80376102"
WORKFLOW_CODE_PROJECT_PATH = "tchen1690/test"
WORKFLOW_BASE_BRANCH = "develop"
WORKFLOW_TARGET_BRANCH = "develop"
WORKFLOW_LOCAL_REMOTE_NAME = "origin"

3.3 Claude Code

claude mcp add gitlab-workflow \
  -e GITLAB_TOKEN=YOUR_TOKEN \
  -e GITLAB_API_BASE_URL=https://gitlab.com/api/v4 \
  -e WORKFLOW_ISSUE_PROJECT_ID=80376102 \
  -e WORKFLOW_ISSUE_PROJECT_PATH=tchen1690/test \
  -e WORKFLOW_CODE_PROJECT_ID=80376102 \
  -e WORKFLOW_CODE_PROJECT_PATH=tchen1690/test \
  -e WORKFLOW_BASE_BRANCH=develop \
  -e WORKFLOW_TARGET_BRANCH=develop \
  -e WORKFLOW_LOCAL_REMOTE_NAME=origin \
  -- npx -y @chntif/mcp-gitlab-workflow

也可以直接将3.1中配置写入 Claude Code 的配置文件。

3.4 本地启动

{
  "mcpServers": {
    "gitlab-workflow": {
      "command": "node",
      "args": ["/gitlab-workflow-server/dist/src/server.js"],
      "env": {
        "GITLAB_TOKEN": "YOUR_TOKEN",
        "GITLAB_API_BASE_URL": "https://gitlab.com/api/v4",
        "WORKFLOW_ISSUE_PROJECT_ID": "82346102",
        "WORKFLOW_ISSUE_PROJECT_PATH": "tchen1690/test",
        "WORKFLOW_CODE_PROJECT_ID": "82346102",
        "WORKFLOW_CODE_PROJECT_PATH": "tchen1690/test",
        "WORKFLOW_BASE_BRANCH": "develop",
        "WORKFLOW_TARGET_BRANCH": "develop",
        "WORKFLOW_LOCAL_REMOTE_NAME": "origin"
      }
    }
  }
}

3.5 关于 uv/uvx

本项目是 Node.js 包,推荐使用 npx 运行。

4. 环境变量

参数优先级:

tool 参数 -> 用户配置的环境变量 -> 代码内默认值

如果用户没有显式传入 project_id 等参数,tool 会回落到运行时环境变量配置;部分变量同时带有代码内默认值。

| 环境变量 | 作用 | 默认值 | 必需 | | -------------------------------- | ---------------------------------------------------------------- | --------------------------- | ---- | | GITLAB_TOKEN | GitLab API 访问令牌,服务启动和所有 GitLab 操作都依赖它 | 无 | 是 | | GITLAB_API_BASE_URL | GitLab API 基础地址 | https://gitlab.com/api/v4 | 否 | | WORKFLOW_ISSUE_PROJECT_ID | Issue 类工具默认使用的目标项目 ID | 无 | 否 | | WORKFLOW_ISSUE_PROJECT_PATH | Issue 项目路径,用于模板渲染和引用展示 | 无 | 否 | | WORKFLOW_CODE_PROJECT_ID | 仓库、分支、提交、MR 类工具默认使用的目标项目 ID | 无 | 否 | | WORKFLOW_CODE_PROJECT_PATH | 代码项目路径,用于模板、日志和输出展示 | 无 | 否 | | WORKFLOW_BASE_BRANCH | 创建交付分支前默认同步的基线分支 | develop | 否 | | WORKFLOW_TARGET_BRANCH | MR 默认目标分支 | develop | 否 | | WORKFLOW_LOCAL_REMOTE_NAME | 本地 git workflow 默认 remote 名称 | origin | 否 | | WORKFLOW_LABEL | 默认 Issue 标题前缀与兜底标签 | 无 | 否 | | WORKFLOW_ASSIGNEE_USERNAME | Issue / MR 默认指派用户名 | 无 | 否 | | WORKFLOW_ISSUE_LOG_PATH | 本地 issue log 文件路径 | issue-log.md | 否 | | WORKFLOW_UPDATE_ISSUE_LOG | delivery workflow 完成后是否默认更新本地 issue log | true | 否 | | WORKFLOW_DELIVERY_METHOD | delivery workflow 默认执行方式,支持 local_gitremote_api | local_git | 否 | | WORKFLOW_CHECKOUT_LOCAL_BRANCH | remote_api 交付后是否自动同步并切换到目标分支 | false | 否 | | WORKFLOW_LOCK_ISSUE_PROJECT_ID | 锁定允许访问的 Issue 项目 ID,防止误操作其他仓库 | 无 | 否 | | WORKFLOW_LOCK_CODE_PROJECT_ID | 锁定允许访问的代码项目 ID,防止误操作其他仓库 | 无 | 否 |

推荐配置

  • GITLAB_TOKENGITLAB_API_BASE_URL:连接 GitLab 的必需配置
  • WORKFLOW_ISSUE_PROJECT_IDWORKFLOW_CODE_PROJECT_ID:定义 issue 项目和代码项目,可以是同一个
  • WORKFLOW_ISSUE_PROJECT_PATHWORKFLOW_CODE_PROJECT_PATH:提升引用展示效果,但不是必需
  • WORKFLOW_BASE_BRANCHWORKFLOW_TARGET_BRANCH:应与团队分支规范保持一致
  • WORKFLOW_LOCAL_REMOTE_NAME:通常为 origin

如果某次操作的目标与默认环境变量不同,显式传入 tool 参数会覆盖环境变量配置。

5. License

MIT