@zereight/mcp-gitlab 1.0.20 → 1.0.22

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.md CHANGED
@@ -174,12 +174,96 @@ env GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token GITLAB_API_URL=your_gitlab_ap
174
174
  - `body` (string): Note content
175
175
  - Returns: Details of the created note
176
176
 
177
- | **`list_projects`** | List accessible projects with rich filtering options 📊 | • Search/filtering: `search`, `owned`, `membership`, `archived`, `visibility`<br>• Features filtering: `with_issues_enabled`, `with_merge_requests_enabled`<br>• Sorting: `order_by`, `sort`<br>• Access control: `min_access_level`<br>• Pagination: `page`, `per_page`, `simple` | Array of projects |
178
- | **`list_labels`** | List all labels for a project with filtering options 🏷️ | • `project_id` (string): Project ID or path<br>• `with_counts` (optional): Include issue and merge request counts<br>• `include_ancestor_groups` (optional): Include ancestor groups<br>• `search` (optional): Filter labels by keyword | Array of labels |
179
- | **`get_label`** | Get a single label from a project 🏷️ | • `project_id` (string): Project ID or path<br>• `label_id` (number/string): Label ID or name<br>• `include_ancestor_groups` (optional): Include ancestor groups | Label details |
180
- | **`create_label`** | Create a new label in a project 🏷️➕ | • `project_id` (string): Project ID or path<br>• `name` (string): Label name<br>• `color` (string): Color in hex format (e.g., "#FF0000")<br>• `description` (optional): Label description<br>• `priority` (optional): Label priority | Created label details |
181
- | **`update_label`** | Update an existing label in a project 🏷️✏️ | • `project_id` (string): Project ID or path<br>• `label_id` (number/string): Label ID or name<br>• `new_name` (optional): New label name<br>• `color` (optional): New color in hex format<br>• `description` (optional): New description<br>• `priority` (optional): New priority | Updated label details |
182
- | **`delete_label`** | Delete a label from a project 🏷️❌ | • `project_id` (string): Project ID or path<br>• `label_id` (number/string): Label ID or name | Success message |
177
+ 14. `list_projects`
178
+ - List accessible projects with rich filtering options 📊
179
+ - Inputs:
180
+ - Search/filtering:
181
+ - `search`
182
+ - `owned`
183
+ - `membership`
184
+ - `archived`
185
+ - `visibility`
186
+ - Features filtering:
187
+ - `with_issues_enabled`
188
+ - `with_merge_requests_enabled`
189
+ - Sorting:
190
+ - `order_by`
191
+ - `sort`
192
+ - Access control:
193
+ - `min_access_level`
194
+ - Pagination:
195
+ - `page`
196
+ - `per_page`
197
+ - `simple`
198
+ - Returns: Array of projects
199
+ 15. `list_labels`
200
+ - List all labels for a project with filtering options 🏷️
201
+ - Inputs:
202
+ - `project_id` (string): Project ID or path
203
+ - `with_counts` (optional): Include issue and merge request counts
204
+ - `include_ancestor_groups` (optional): Include ancestor groups
205
+ - `search` (optional): Filter labels by keyword
206
+ - Returns: Array of labels
207
+ 16. `get_label`
208
+ - Get a single label from a project
209
+ - Inputs:
210
+ - `project_id` (string): Project ID or path
211
+ - `label_id` (number/string): Label ID or name
212
+ - `include_ancestor_groups` (optional): Include ancestor groups
213
+ - Returns: label details
214
+ 17. `create_label`
215
+ - Create a new label in an object 🏷️➕
216
+ - Inputs:
217
+ - `project_id` (string): Project ID or path
218
+ - `name` (string): Label name
219
+ - `color` (string): Color in hex format (e.g., "#FF0000")
220
+ - `description` (optional): Label description
221
+ - `priority` (optional): Label priority
222
+ - Returns: Created label details
223
+ 18. `update_label`
224
+ - Update an existing label in a project 🏷️✏️
225
+ - Inputs:
226
+ - `project_id` (string): Project ID or path
227
+ - `label_id` (number/string): Label ID or name
228
+ - `new_name` (optional): New label name
229
+ - `color` (optional): New color in hex format
230
+ - `description` (optional): New description
231
+ - `priority` (optional): New priority
232
+ - Returns: Updated label details
233
+ 19. `delete_label`
234
+ - Delete a label from a project 🏷️❌
235
+ - Inputs:
236
+ - `project_id` (string): Project ID or path
237
+ - `label_id` (number/string): Label ID or name
238
+ - Returns: Success message
239
+
240
+ 14. `list_group_projects`
241
+
242
+ - List all projects in a GitLab group. 📂
243
+ - Inputs:
244
+ - `group_id` (string): Project ID or namespace/project_path
245
+ - Filtering options:
246
+ - `include_subgroups` (optional boolean): Include projects from subgroups
247
+ - `search` (optional string): Search term to filter projects
248
+ - `archived` (optional boolean): Filter for archived projects
249
+ - `visibility` (optional string): Filter by project visibility (public/internal/private)
250
+ - `with_programming_language` (optional string): Filter by programming language
251
+ - `starred` (optional boolean): Filter by starred projects
252
+ - Feature filtering:
253
+ - `with_issues_enabled` (optional boolean): Filter projects with issues feature enabled
254
+ - `with_merge_requests_enabled` (optional boolean): Filter projects with merge requests feature enabled
255
+ - `min_access_level` (optional number): Filter by minimum access level
256
+ - Pagination:
257
+ - `page` (optional number): Page number
258
+ - `per_page` (optional number): Results per page
259
+ - Sorting:
260
+ - `order_by` (optional string): Field to sort by
261
+ - `sort` (optional string): Sort direction (asc/desc)
262
+ - Additional data:
263
+ - `statistics` (optional boolean): Include project statistics
264
+ - `with_custom_attributes` (optional boolean): Include custom attributes
265
+ - `with_security_reports` (optional boolean): Include security reports
266
+ - Returns: List of projects
183
267
 
184
268
  ## Environment Variable Configuration
185
269
 
package/build/index.js CHANGED
@@ -9,7 +9,7 @@ import { fileURLToPath } from "url";
9
9
  import { dirname } from "path";
10
10
  import fs from "fs";
11
11
  import path from "path";
12
- import { GitLabForkSchema, GitLabReferenceSchema, GitLabRepositorySchema, GitLabIssueSchema, GitLabMergeRequestSchema, GitLabContentSchema, GitLabCreateUpdateFileResponseSchema, GitLabSearchResponseSchema, GitLabTreeSchema, GitLabCommitSchema, GitLabNamespaceSchema, GitLabNamespaceExistsResponseSchema, GitLabProjectSchema, CreateOrUpdateFileSchema, SearchRepositoriesSchema, CreateRepositorySchema, GetFileContentsSchema, PushFilesSchema, CreateIssueSchema, CreateMergeRequestSchema, ForkRepositorySchema, CreateBranchSchema, GitLabMergeRequestDiffSchema, GetMergeRequestSchema, GetMergeRequestDiffsSchema, UpdateMergeRequestSchema, ListIssuesSchema, GetIssueSchema, UpdateIssueSchema, DeleteIssueSchema, GitLabIssueLinkSchema, GitLabIssueWithLinkDetailsSchema, ListIssueLinksSchema, GetIssueLinkSchema, CreateIssueLinkSchema, DeleteIssueLinkSchema, ListNamespacesSchema, GetNamespaceSchema, VerifyNamespaceSchema, GetProjectSchema, ListProjectsSchema, ListLabelsSchema, GetLabelSchema, CreateLabelSchema, UpdateLabelSchema, DeleteLabelSchema, CreateNoteSchema, } from "./schemas.js";
12
+ import { GitLabForkSchema, GitLabReferenceSchema, GitLabRepositorySchema, GitLabIssueSchema, GitLabMergeRequestSchema, GitLabContentSchema, GitLabCreateUpdateFileResponseSchema, GitLabSearchResponseSchema, GitLabTreeSchema, GitLabCommitSchema, GitLabNamespaceSchema, GitLabNamespaceExistsResponseSchema, GitLabProjectSchema, CreateOrUpdateFileSchema, SearchRepositoriesSchema, CreateRepositorySchema, GetFileContentsSchema, PushFilesSchema, CreateIssueSchema, CreateMergeRequestSchema, ForkRepositorySchema, CreateBranchSchema, GitLabMergeRequestDiffSchema, GetMergeRequestSchema, GetMergeRequestDiffsSchema, UpdateMergeRequestSchema, ListIssuesSchema, GetIssueSchema, UpdateIssueSchema, DeleteIssueSchema, GitLabIssueLinkSchema, GitLabIssueWithLinkDetailsSchema, ListIssueLinksSchema, GetIssueLinkSchema, CreateIssueLinkSchema, DeleteIssueLinkSchema, ListNamespacesSchema, GetNamespaceSchema, VerifyNamespaceSchema, GetProjectSchema, ListProjectsSchema, ListLabelsSchema, GetLabelSchema, CreateLabelSchema, UpdateLabelSchema, DeleteLabelSchema, CreateNoteSchema, ListGroupProjectsSchema, } from "./schemas.js";
13
13
  /**
14
14
  * Read version from package.json
15
15
  */
@@ -960,6 +960,55 @@ async function deleteLabel(projectId, labelId) {
960
960
  // Handle errors
961
961
  await handleGitLabError(response);
962
962
  }
963
+ /**
964
+ * List all projects in a GitLab group
965
+ *
966
+ * @param {z.infer<typeof ListGroupProjectsSchema>} options - Options for listing group projects
967
+ * @returns {Promise<GitLabProject[]>} Array of projects in the group
968
+ */
969
+ async function listGroupProjects(options) {
970
+ const url = new URL(`${GITLAB_API_URL}/groups/${encodeURIComponent(options.group_id)}/projects`);
971
+ // Add optional parameters to URL
972
+ if (options.include_subgroups)
973
+ url.searchParams.append('include_subgroups', 'true');
974
+ if (options.search)
975
+ url.searchParams.append('search', options.search);
976
+ if (options.order_by)
977
+ url.searchParams.append('order_by', options.order_by);
978
+ if (options.sort)
979
+ url.searchParams.append('sort', options.sort);
980
+ if (options.page)
981
+ url.searchParams.append('page', options.page.toString());
982
+ if (options.per_page)
983
+ url.searchParams.append('per_page', options.per_page.toString());
984
+ if (options.archived !== undefined)
985
+ url.searchParams.append('archived', options.archived.toString());
986
+ if (options.visibility)
987
+ url.searchParams.append('visibility', options.visibility);
988
+ if (options.with_issues_enabled !== undefined)
989
+ url.searchParams.append('with_issues_enabled', options.with_issues_enabled.toString());
990
+ if (options.with_merge_requests_enabled !== undefined)
991
+ url.searchParams.append('with_merge_requests_enabled', options.with_merge_requests_enabled.toString());
992
+ if (options.min_access_level !== undefined)
993
+ url.searchParams.append('min_access_level', options.min_access_level.toString());
994
+ if (options.with_programming_language)
995
+ url.searchParams.append('with_programming_language', options.with_programming_language);
996
+ if (options.starred !== undefined)
997
+ url.searchParams.append('starred', options.starred.toString());
998
+ if (options.statistics !== undefined)
999
+ url.searchParams.append('statistics', options.statistics.toString());
1000
+ if (options.with_custom_attributes !== undefined)
1001
+ url.searchParams.append('with_custom_attributes', options.with_custom_attributes.toString());
1002
+ if (options.with_security_reports !== undefined)
1003
+ url.searchParams.append('with_security_reports', options.with_security_reports.toString());
1004
+ const response = await fetch(url.toString(), {
1005
+ method: "GET",
1006
+ headers: DEFAULT_HEADERS,
1007
+ });
1008
+ await handleGitLabError(response);
1009
+ const projects = await response.json();
1010
+ return GitLabProjectSchema.array().parse(projects);
1011
+ }
963
1012
  server.setRequestHandler(ListToolsRequestSchema, async () => {
964
1013
  return {
965
1014
  tools: [
@@ -1118,6 +1167,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
1118
1167
  description: "Delete a label from a project",
1119
1168
  inputSchema: zodToJsonSchema(DeleteLabelSchema),
1120
1169
  },
1170
+ {
1171
+ name: "list_group_projects",
1172
+ description: "List projects in a GitLab group with filtering options",
1173
+ inputSchema: zodToJsonSchema(ListGroupProjectsSchema),
1174
+ },
1121
1175
  ],
1122
1176
  };
1123
1177
  });
@@ -1414,6 +1468,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1414
1468
  content: [{ type: "text", text: JSON.stringify({ status: "success", message: "Label deleted successfully" }, null, 2) }],
1415
1469
  };
1416
1470
  }
1471
+ case "list_group_projects": {
1472
+ const args = ListGroupProjectsSchema.parse(request.params.arguments);
1473
+ const projects = await listGroupProjects(args);
1474
+ return {
1475
+ content: [{ type: "text", text: JSON.stringify(projects, null, 2) }],
1476
+ };
1477
+ }
1417
1478
  default:
1418
1479
  throw new Error(`Unknown tool: ${request.params.name}`);
1419
1480
  }
package/build/schemas.js CHANGED
@@ -303,7 +303,7 @@ export const GitLabMergeRequestSchema = z.object({
303
303
  assignees: z.array(GitLabUserSchema).optional(),
304
304
  source_branch: z.string(),
305
305
  target_branch: z.string(),
306
- diff_refs: GitLabMergeRequestDiffRefSchema.optional(),
306
+ diff_refs: GitLabMergeRequestDiffRefSchema.nullable().optional(),
307
307
  web_url: z.string(),
308
308
  created_at: z.string(),
309
309
  updated_at: z.string(),
@@ -316,10 +316,10 @@ export const GitLabMergeRequestSchema = z.object({
316
316
  work_in_progress: z.boolean().optional(),
317
317
  blocking_discussions_resolved: z.boolean().optional(),
318
318
  should_remove_source_branch: z.boolean().nullable().optional(),
319
- force_remove_source_branch: z.boolean().optional(),
319
+ force_remove_source_branch: z.boolean().nullable().optional(),
320
320
  allow_collaboration: z.boolean().optional(),
321
321
  allow_maintainer_to_push: z.boolean().optional(),
322
- changes_count: z.string().optional(),
322
+ changes_count: z.string().nullable().optional(),
323
323
  merge_when_pipeline_succeeds: z.boolean().optional(),
324
324
  squash: z.boolean().optional(),
325
325
  labels: z.array(z.string()).optional(),
@@ -597,3 +597,23 @@ export const DeleteLabelSchema = z.object({
597
597
  project_id: z.string().describe("Project ID or URL-encoded path"),
598
598
  label_id: z.union([z.number(), z.string()]).describe("The ID or title of a project's label"),
599
599
  });
600
+ // Group projects schema
601
+ export const ListGroupProjectsSchema = z.object({
602
+ group_id: z.string().describe("Group ID or path"),
603
+ include_subgroups: z.boolean().optional().describe("Include projects from subgroups"),
604
+ search: z.string().optional().describe("Search term to filter projects"),
605
+ order_by: z.enum(['name', 'path', 'created_at', 'updated_at', 'last_activity_at']).optional().describe("Field to sort by"),
606
+ sort: z.enum(['asc', 'desc']).optional().describe("Sort direction"),
607
+ page: z.number().optional().describe("Page number"),
608
+ per_page: z.number().optional().describe("Number of results per page"),
609
+ archived: z.boolean().optional().describe("Filter for archived projects"),
610
+ visibility: z.enum(["public", "internal", "private"]).optional().describe("Filter by project visibility"),
611
+ with_issues_enabled: z.boolean().optional().describe("Filter projects with issues feature enabled"),
612
+ with_merge_requests_enabled: z.boolean().optional().describe("Filter projects with merge requests feature enabled"),
613
+ min_access_level: z.number().optional().describe("Filter by minimum access level"),
614
+ with_programming_language: z.string().optional().describe("Filter by programming language"),
615
+ starred: z.boolean().optional().describe("Filter by starred projects"),
616
+ statistics: z.boolean().optional().describe("Include project statistics"),
617
+ with_custom_attributes: z.boolean().optional().describe("Include custom attributes"),
618
+ with_security_reports: z.boolean().optional().describe("Include security reports")
619
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "MCP server for using the GitLab API",
5
5
  "license": "MIT",
6
6
  "author": "zereight",
@@ -22,7 +22,7 @@
22
22
  "deploy": "npm run build && npm publish"
23
23
  },
24
24
  "dependencies": {
25
- "@modelcontextprotocol/sdk": "1.0.1",
25
+ "@modelcontextprotocol/sdk": "1.8.0",
26
26
  "@types/node-fetch": "^2.6.12",
27
27
  "node-fetch": "^3.3.2",
28
28
  "zod-to-json-schema": "^3.23.5"
@@ -30,6 +30,6 @@
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.13.10",
32
32
  "typescript": "^5.8.2",
33
- "zod": "3.21.4"
33
+ "zod": "^3.24.2"
34
34
  }
35
- }
35
+ }