@zereight/mcp-gitlab 2.1.49 → 2.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -80,7 +80,7 @@ npm install -g @zereight/mcp-gitlab
80
80
 
81
81
  예시는 기존 `mcp-gitlab`보다 충돌 가능성이 낮은 `zereight-mcp-gitlab` 별칭을 사용합니다. MCP 클라이언트가 찾지 못하면 `which zereight-mcp-gitlab`의 절대 경로를 사용하세요.
82
82
 
83
- 전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.1.48`처럼 직전 안정 버전(문서가 권장하는 버전)으로 고정하세요. 항상 최신 버전을 원하면 `npx -y @zereight/mcp-gitlab@latest`를 사용하세요. 새 버전이 나오면 서버가 시작 시 stderr로 알려줍니다(`GITLAB_DISABLE_VERSION_CHECK=true`로 비활성화 가능).
83
+ 전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.1.49`처럼 직전 안정 버전(문서가 권장하는 버전)으로 고정하세요. 항상 최신 버전을 원하면 `npx -y @zereight/mcp-gitlab@latest`를 사용하세요. 새 버전이 나오면 서버가 시작 시 stderr로 알려줍니다(`GITLAB_DISABLE_VERSION_CHECK=true`로 비활성화 가능).
84
84
 
85
85
  #### CLI 인자 사용하기(환경 변수 문제가 있는 클라이언트용)
86
86
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GitLab MCP Server
2
2
 
3
- [![MCP Toplist](https://mcptoplist.com/badge/io.github.zereight%2Fgitlab-mcp.svg)](https://mcptoplist.com/server/io.github.zereight%2Fgitlab-mcp)
3
+ [![MCP Toplist](https://mcptoplist.com/badge/io.github.zereight%2Fgitlab-mcp.svg)](https://mcptoplist.com/server/io.github.zereight%2Fgitlab-mcp) [![mcpindex](https://mcpindex.ai/api/v1/badge/io-github-zereight-gitlab-mcp)](https://mcpindex.ai/server/io-github-zereight-gitlab-mcp)
4
4
 
5
5
  [English](./README.md) | [한국어](./README.ko.md) | [简体中文](./README.zh-CN.md)
6
6
 
@@ -82,7 +82,7 @@ npm install -g @zereight/mcp-gitlab
82
82
 
83
83
  The examples use `zereight-mcp-gitlab`, a less collision-prone alias for the legacy `mcp-gitlab` binary. If your MCP client cannot find it, use the absolute path from `which zereight-mcp-gitlab`.
84
84
 
85
- No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.1.48`. If you always want the newest release, use `npx -y @zereight/mcp-gitlab@latest` instead. The server prints a notice to stderr on startup when a newer version is available (disable with `GITLAB_DISABLE_VERSION_CHECK=true`).
85
+ No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.1.49`. If you always want the newest release, use `npx -y @zereight/mcp-gitlab@latest` instead. The server prints a notice to stderr on startup when a newer version is available (disable with `GITLAB_DISABLE_VERSION_CHECK=true`).
86
86
 
87
87
  #### Using CLI Arguments (for clients with env var issues)
88
88
 
package/README.zh-CN.md CHANGED
@@ -80,7 +80,7 @@ npm install -g @zereight/mcp-gitlab
80
80
 
81
81
  示例使用 `zereight-mcp-gitlab`,这是比旧的 `mcp-gitlab` 更不容易冲突的别名。如果 MCP 客户端找不到它,请使用 `which zereight-mcp-gitlab` 输出的绝对路径。
82
82
 
83
- 如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.1.48`。如果始终想使用最新版本,请改用 `npx -y @zereight/mcp-gitlab@latest`。有新版本发布时,服务器会在启动时通过 stderr 提示(可用 `GITLAB_DISABLE_VERSION_CHECK=true` 关闭)。
83
+ 如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.1.49`。如果始终想使用最新版本,请改用 `npx -y @zereight/mcp-gitlab@latest`。有新版本发布时,服务器会在启动时通过 stderr 提示(可用 `GITLAB_DISABLE_VERSION_CHECK=true` 关闭)。
84
84
 
85
85
  #### 使用 CLI 参数(适用于环境变量有问题的客户端)
86
86
 
package/build/schemas.js CHANGED
@@ -1160,6 +1160,7 @@ export const GitLabMergeRequestSchema = z.object({
1160
1160
  updated_at: z.string(),
1161
1161
  merged_at: z.string().nullable(),
1162
1162
  closed_at: z.string().nullable(),
1163
+ sha: z.string().optional().describe("SHA of the head commit in the source branch"),
1163
1164
  merge_commit_sha: z.string().nullable(),
1164
1165
  merge_user: GitLabUserSchema.nullable()
1165
1166
  .optional()
@@ -1773,6 +1774,10 @@ export const UpdateMergeRequestSchema = MergeRequestParamsSchema.extend({
1773
1774
  });
1774
1775
  export const MergeMergeRequestSchema = ProjectParamsSchema.extend({
1775
1776
  merge_request_iid: z.coerce.string().optional().describe("The IID of a merge request"),
1777
+ sha: z
1778
+ .string()
1779
+ .optional()
1780
+ .describe("SHA of the source-branch HEAD from get_merge_request (`sha` or `diff_refs.head_sha`). If provided, GitLab merges only when HEAD still matches. GitLab 19.2+ groups may require this (Require a commit SHA on the merge requests API)."),
1776
1781
  auto_merge: z.coerce
1777
1782
  .boolean()
1778
1783
  .optional()
@@ -0,0 +1,75 @@
1
+ import { describe, it } from "node:test";
2
+ import assert from "node:assert";
3
+ import { GitLabMergeRequestSchema, MergeMergeRequestSchema } from "../schemas.js";
4
+ const HEAD_SHA = "e82eb4a098e32c796079ca3915e07487fc4db24c";
5
+ const PROJECT_ID = "group/project";
6
+ const MERGE_REQUEST_IID = "42";
7
+ function mergeArgs(overrides = {}) {
8
+ return {
9
+ project_id: PROJECT_ID,
10
+ merge_request_iid: MERGE_REQUEST_IID,
11
+ ...overrides,
12
+ };
13
+ }
14
+ function mergeRequest(overrides = {}) {
15
+ return {
16
+ id: "1001",
17
+ iid: MERGE_REQUEST_IID,
18
+ project_id: "123",
19
+ title: "Add milestone exposure",
20
+ description: "Expose MR milestone",
21
+ state: "opened",
22
+ author: {
23
+ id: "1",
24
+ username: "octocat",
25
+ name: "Octo Cat",
26
+ avatar_url: null,
27
+ web_url: "https://gitlab.example.com/octocat",
28
+ },
29
+ assignees: [],
30
+ reviewers: [],
31
+ source_branch: "feature/milestone",
32
+ target_branch: "main",
33
+ web_url: "https://gitlab.example.com/group/project/-/merge_requests/42",
34
+ created_at: "2026-05-07T00:00:00.000Z",
35
+ updated_at: "2026-05-07T00:00:00.000Z",
36
+ merged_at: null,
37
+ closed_at: null,
38
+ merge_commit_sha: null,
39
+ ...overrides,
40
+ };
41
+ }
42
+ describe("When parsing merge_merge_request arguments", () => {
43
+ describe("with sha provided", () => {
44
+ it("should keep sha on the parsed object", () => {
45
+ const parsed = MergeMergeRequestSchema.parse(mergeArgs({ sha: HEAD_SHA }));
46
+ assert.strictEqual(parsed.sha, HEAD_SHA);
47
+ });
48
+ });
49
+ describe("with sha omitted", () => {
50
+ it("should parse and leave sha undefined", () => {
51
+ const parsed = MergeMergeRequestSchema.parse(mergeArgs());
52
+ assert.strictEqual(parsed.sha, undefined);
53
+ });
54
+ });
55
+ describe("with an unknown extra field", () => {
56
+ it("should strip the unknown field", () => {
57
+ const parsed = MergeMergeRequestSchema.parse(mergeArgs({ not_a_schema_field: "drop-me" }));
58
+ assert.equal("not_a_schema_field" in parsed, false);
59
+ });
60
+ });
61
+ });
62
+ describe("When parsing a GitLab merge request response", () => {
63
+ describe("with sha present", () => {
64
+ it("should keep sha instead of stripping it", () => {
65
+ const parsed = GitLabMergeRequestSchema.parse(mergeRequest({ sha: HEAD_SHA }));
66
+ assert.strictEqual(parsed.sha, HEAD_SHA);
67
+ });
68
+ });
69
+ describe("with sha omitted", () => {
70
+ it("should accept the payload", () => {
71
+ const parsed = GitLabMergeRequestSchema.parse(mergeRequest());
72
+ assert.strictEqual(parsed.sha, undefined);
73
+ });
74
+ });
75
+ });
@@ -1,5 +1,5 @@
1
1
  const TOOL_GUIDANCE = {
2
- merge_merge_request: "Use this only after checking the merge request approval, conflict, and pipeline state; use `approve_merge_request` to approve rather than merge. The operation changes repository state and may squash commits, schedule auto-merge, or delete the source branch, so it requires merge permission and returns GitLab's merge result or a mergeability error.",
2
+ merge_merge_request: "Use this only after checking the merge request approval, conflict, and pipeline state; use `approve_merge_request` to approve rather than merge. The operation changes repository state and may squash commits, schedule auto-merge, or delete the source branch, so it requires merge permission and returns GitLab's merge result or a mergeability error. Pass `sha` from `get_merge_request` (`sha` or `diff_refs.head_sha`); GitLab 19.2+ groups may reject merges without it.",
3
3
  approve_merge_request: "Use this to record an approval on an existing merge request; it does not merge the request or change its source branch. The operation changes review state, may require re-authentication or approval permission, and returns the updated approval result or a permission/state error.",
4
4
  unapprove_merge_request: "Use this to remove the current user's approval from an existing merge request; use `merge_merge_request` only when you intend to merge. The operation changes review state and requires approval permission, and GitLab returns the updated result or an error when the request or approval is unavailable.",
5
5
  get_merge_request_approval_state: "Use this to inspect approval rules and approvers before deciding whether a merge request can be merged; use `approve_merge_request` to change approval state. It is read-only and returns the approval-state response, while missing requests, unsupported GitLab versions, and permission failures are reported as errors.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "2.1.49",
3
+ "version": "2.1.50",
4
4
  "mcpName": "io.github.zereight/gitlab-mcp",
5
5
  "description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
6
6
  "keywords": [