@zereight/mcp-gitlab 1.0.21 → 1.0.23
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 +90 -6
- package/build/index.js +138 -1
- package/build/schemas.js +88 -3
- package/package.json +4 -4
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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,11 @@ 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,
|
|
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,
|
|
13
|
+
// Discussion Schemas
|
|
14
|
+
GitLabDiscussionNoteSchema, // Added
|
|
15
|
+
GitLabDiscussionSchema, UpdateMergeRequestNoteSchema, // Added
|
|
16
|
+
ListMergeRequestDiscussionsSchema, } from "./schemas.js";
|
|
13
17
|
/**
|
|
14
18
|
* Read version from package.json
|
|
15
19
|
*/
|
|
@@ -417,6 +421,51 @@ async function createMergeRequest(projectId, options) {
|
|
|
417
421
|
const data = await response.json();
|
|
418
422
|
return GitLabMergeRequestSchema.parse(data);
|
|
419
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* List merge request discussion items
|
|
426
|
+
* 병합 요청 토론 목록 조회
|
|
427
|
+
*
|
|
428
|
+
* @param {string} projectId - The ID or URL-encoded path of the project
|
|
429
|
+
* @param {number} mergeRequestIid - The IID of a merge request
|
|
430
|
+
* @returns {Promise<GitLabDiscussion[]>} List of discussions
|
|
431
|
+
*/
|
|
432
|
+
async function listMergeRequestDiscussions(projectId, mergeRequestIid) {
|
|
433
|
+
const url = new URL(`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/merge_requests/${mergeRequestIid}/discussions`);
|
|
434
|
+
const response = await fetch(url.toString(), {
|
|
435
|
+
headers: DEFAULT_HEADERS,
|
|
436
|
+
});
|
|
437
|
+
await handleGitLabError(response);
|
|
438
|
+
const data = await response.json();
|
|
439
|
+
// Ensure the response is parsed as an array of discussions
|
|
440
|
+
return z.array(GitLabDiscussionSchema).parse(data);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Modify an existing merge request thread note
|
|
444
|
+
* 병합 요청 토론 노트 수정
|
|
445
|
+
*
|
|
446
|
+
* @param {string} projectId - The ID or URL-encoded path of the project
|
|
447
|
+
* @param {number} mergeRequestIid - The IID of a merge request
|
|
448
|
+
* @param {string} discussionId - The ID of a thread
|
|
449
|
+
* @param {number} noteId - The ID of a thread note
|
|
450
|
+
* @param {string} body - The new content of the note
|
|
451
|
+
* @param {boolean} [resolved] - Resolve/unresolve state
|
|
452
|
+
* @returns {Promise<GitLabDiscussionNote>} The updated note
|
|
453
|
+
*/
|
|
454
|
+
async function updateMergeRequestNote(projectId, mergeRequestIid, discussionId, noteId, body, resolved) {
|
|
455
|
+
const url = new URL(`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/merge_requests/${mergeRequestIid}/discussions/${discussionId}/notes/${noteId}`);
|
|
456
|
+
const payload = { body };
|
|
457
|
+
if (resolved !== undefined) {
|
|
458
|
+
payload.resolved = resolved;
|
|
459
|
+
}
|
|
460
|
+
const response = await fetch(url.toString(), {
|
|
461
|
+
method: "PUT",
|
|
462
|
+
headers: DEFAULT_HEADERS,
|
|
463
|
+
body: JSON.stringify(payload),
|
|
464
|
+
});
|
|
465
|
+
await handleGitLabError(response);
|
|
466
|
+
const data = await response.json();
|
|
467
|
+
return GitLabDiscussionNoteSchema.parse(data);
|
|
468
|
+
}
|
|
420
469
|
/**
|
|
421
470
|
* Create or update a file in a GitLab project
|
|
422
471
|
* 파일 생성 또는 업데이트
|
|
@@ -960,6 +1009,55 @@ async function deleteLabel(projectId, labelId) {
|
|
|
960
1009
|
// Handle errors
|
|
961
1010
|
await handleGitLabError(response);
|
|
962
1011
|
}
|
|
1012
|
+
/**
|
|
1013
|
+
* List all projects in a GitLab group
|
|
1014
|
+
*
|
|
1015
|
+
* @param {z.infer<typeof ListGroupProjectsSchema>} options - Options for listing group projects
|
|
1016
|
+
* @returns {Promise<GitLabProject[]>} Array of projects in the group
|
|
1017
|
+
*/
|
|
1018
|
+
async function listGroupProjects(options) {
|
|
1019
|
+
const url = new URL(`${GITLAB_API_URL}/groups/${encodeURIComponent(options.group_id)}/projects`);
|
|
1020
|
+
// Add optional parameters to URL
|
|
1021
|
+
if (options.include_subgroups)
|
|
1022
|
+
url.searchParams.append('include_subgroups', 'true');
|
|
1023
|
+
if (options.search)
|
|
1024
|
+
url.searchParams.append('search', options.search);
|
|
1025
|
+
if (options.order_by)
|
|
1026
|
+
url.searchParams.append('order_by', options.order_by);
|
|
1027
|
+
if (options.sort)
|
|
1028
|
+
url.searchParams.append('sort', options.sort);
|
|
1029
|
+
if (options.page)
|
|
1030
|
+
url.searchParams.append('page', options.page.toString());
|
|
1031
|
+
if (options.per_page)
|
|
1032
|
+
url.searchParams.append('per_page', options.per_page.toString());
|
|
1033
|
+
if (options.archived !== undefined)
|
|
1034
|
+
url.searchParams.append('archived', options.archived.toString());
|
|
1035
|
+
if (options.visibility)
|
|
1036
|
+
url.searchParams.append('visibility', options.visibility);
|
|
1037
|
+
if (options.with_issues_enabled !== undefined)
|
|
1038
|
+
url.searchParams.append('with_issues_enabled', options.with_issues_enabled.toString());
|
|
1039
|
+
if (options.with_merge_requests_enabled !== undefined)
|
|
1040
|
+
url.searchParams.append('with_merge_requests_enabled', options.with_merge_requests_enabled.toString());
|
|
1041
|
+
if (options.min_access_level !== undefined)
|
|
1042
|
+
url.searchParams.append('min_access_level', options.min_access_level.toString());
|
|
1043
|
+
if (options.with_programming_language)
|
|
1044
|
+
url.searchParams.append('with_programming_language', options.with_programming_language);
|
|
1045
|
+
if (options.starred !== undefined)
|
|
1046
|
+
url.searchParams.append('starred', options.starred.toString());
|
|
1047
|
+
if (options.statistics !== undefined)
|
|
1048
|
+
url.searchParams.append('statistics', options.statistics.toString());
|
|
1049
|
+
if (options.with_custom_attributes !== undefined)
|
|
1050
|
+
url.searchParams.append('with_custom_attributes', options.with_custom_attributes.toString());
|
|
1051
|
+
if (options.with_security_reports !== undefined)
|
|
1052
|
+
url.searchParams.append('with_security_reports', options.with_security_reports.toString());
|
|
1053
|
+
const response = await fetch(url.toString(), {
|
|
1054
|
+
method: "GET",
|
|
1055
|
+
headers: DEFAULT_HEADERS,
|
|
1056
|
+
});
|
|
1057
|
+
await handleGitLabError(response);
|
|
1058
|
+
const projects = await response.json();
|
|
1059
|
+
return GitLabProjectSchema.array().parse(projects);
|
|
1060
|
+
}
|
|
963
1061
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
964
1062
|
return {
|
|
965
1063
|
tools: [
|
|
@@ -1028,6 +1126,16 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1028
1126
|
description: "Create a new note (comment) to an issue or merge request",
|
|
1029
1127
|
inputSchema: zodToJsonSchema(CreateNoteSchema),
|
|
1030
1128
|
},
|
|
1129
|
+
{
|
|
1130
|
+
name: "list_merge_request_discussions",
|
|
1131
|
+
description: "List discussion items for a merge request",
|
|
1132
|
+
inputSchema: zodToJsonSchema(ListMergeRequestDiscussionsSchema),
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
name: "update_merge_request_note",
|
|
1136
|
+
description: "Modify an existing merge request thread note",
|
|
1137
|
+
inputSchema: zodToJsonSchema(UpdateMergeRequestNoteSchema),
|
|
1138
|
+
},
|
|
1031
1139
|
{
|
|
1032
1140
|
name: "list_issues",
|
|
1033
1141
|
description: "List issues in a GitLab project with filtering options",
|
|
@@ -1118,6 +1226,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1118
1226
|
description: "Delete a label from a project",
|
|
1119
1227
|
inputSchema: zodToJsonSchema(DeleteLabelSchema),
|
|
1120
1228
|
},
|
|
1229
|
+
{
|
|
1230
|
+
name: "list_group_projects",
|
|
1231
|
+
description: "List projects in a GitLab group with filtering options",
|
|
1232
|
+
inputSchema: zodToJsonSchema(ListGroupProjectsSchema),
|
|
1233
|
+
},
|
|
1121
1234
|
],
|
|
1122
1235
|
};
|
|
1123
1236
|
});
|
|
@@ -1215,6 +1328,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1215
1328
|
],
|
|
1216
1329
|
};
|
|
1217
1330
|
}
|
|
1331
|
+
case "update_merge_request_note": {
|
|
1332
|
+
const args = UpdateMergeRequestNoteSchema.parse(request.params.arguments);
|
|
1333
|
+
const note = await updateMergeRequestNote(args.project_id, args.merge_request_iid, args.discussion_id, args.note_id, args.body, args.resolved // Pass resolved if provided
|
|
1334
|
+
);
|
|
1335
|
+
return {
|
|
1336
|
+
content: [{ type: "text", text: JSON.stringify(note, null, 2) }],
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1218
1339
|
case "get_merge_request": {
|
|
1219
1340
|
const args = GetMergeRequestSchema.parse(request.params.arguments);
|
|
1220
1341
|
const mergeRequest = await getMergeRequest(args.project_id, args.merge_request_iid);
|
|
@@ -1241,6 +1362,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1241
1362
|
],
|
|
1242
1363
|
};
|
|
1243
1364
|
}
|
|
1365
|
+
case "list_merge_request_discussions": {
|
|
1366
|
+
const args = ListMergeRequestDiscussionsSchema.parse(request.params.arguments);
|
|
1367
|
+
const discussions = await listMergeRequestDiscussions(args.project_id, args.merge_request_iid);
|
|
1368
|
+
return {
|
|
1369
|
+
content: [
|
|
1370
|
+
{ type: "text", text: JSON.stringify(discussions, null, 2) },
|
|
1371
|
+
],
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1244
1374
|
case "list_namespaces": {
|
|
1245
1375
|
const args = ListNamespacesSchema.parse(request.params.arguments);
|
|
1246
1376
|
const url = new URL(`${GITLAB_API_URL}/namespaces`);
|
|
@@ -1414,6 +1544,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1414
1544
|
content: [{ type: "text", text: JSON.stringify({ status: "success", message: "Label deleted successfully" }, null, 2) }],
|
|
1415
1545
|
};
|
|
1416
1546
|
}
|
|
1547
|
+
case "list_group_projects": {
|
|
1548
|
+
const args = ListGroupProjectsSchema.parse(request.params.arguments);
|
|
1549
|
+
const projects = await listGroupProjects(args);
|
|
1550
|
+
return {
|
|
1551
|
+
content: [{ type: "text", text: JSON.stringify(projects, null, 2) }],
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1417
1554
|
default:
|
|
1418
1555
|
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
1419
1556
|
}
|
package/build/schemas.js
CHANGED
|
@@ -6,6 +6,10 @@ export const GitLabAuthorSchema = z.object({
|
|
|
6
6
|
date: z.string(),
|
|
7
7
|
});
|
|
8
8
|
// Namespace related schemas
|
|
9
|
+
// Base schema for project-related operations
|
|
10
|
+
const ProjectParamsSchema = z.object({
|
|
11
|
+
project_id: z.string().describe("Project ID or URL-encoded path"), // Changed from owner/repo to match GitLab API
|
|
12
|
+
});
|
|
9
13
|
export const GitLabNamespaceSchema = z.object({
|
|
10
14
|
id: z.number(),
|
|
11
15
|
name: z.string(),
|
|
@@ -324,10 +328,71 @@ export const GitLabMergeRequestSchema = z.object({
|
|
|
324
328
|
squash: z.boolean().optional(),
|
|
325
329
|
labels: z.array(z.string()).optional(),
|
|
326
330
|
});
|
|
327
|
-
//
|
|
328
|
-
const
|
|
329
|
-
|
|
331
|
+
// Discussion related schemas
|
|
332
|
+
export const GitLabDiscussionNoteSchema = z.object({
|
|
333
|
+
id: z.number(),
|
|
334
|
+
type: z.enum(["DiscussionNote", "DiffNote", "Note"]).nullable(), // Allow null type for regular notes
|
|
335
|
+
body: z.string(),
|
|
336
|
+
attachment: z.any().nullable(), // Can be string or object, handle appropriately
|
|
337
|
+
author: GitLabUserSchema,
|
|
338
|
+
created_at: z.string(),
|
|
339
|
+
updated_at: z.string(),
|
|
340
|
+
system: z.boolean(),
|
|
341
|
+
noteable_id: z.number(),
|
|
342
|
+
noteable_type: z.enum(["Issue", "MergeRequest", "Snippet", "Commit", "Epic"]),
|
|
343
|
+
project_id: z.number().optional(), // Optional for group-level discussions like Epics
|
|
344
|
+
noteable_iid: z.number().nullable(),
|
|
345
|
+
resolvable: z.boolean().optional(),
|
|
346
|
+
resolved: z.boolean().optional(),
|
|
347
|
+
resolved_by: GitLabUserSchema.nullable().optional(),
|
|
348
|
+
resolved_at: z.string().nullable().optional(),
|
|
349
|
+
position: z.object({
|
|
350
|
+
base_sha: z.string(),
|
|
351
|
+
start_sha: z.string(),
|
|
352
|
+
head_sha: z.string(),
|
|
353
|
+
old_path: z.string(),
|
|
354
|
+
new_path: z.string(),
|
|
355
|
+
position_type: z.enum(["text", "image", "file"]),
|
|
356
|
+
old_line: z.number().nullable(),
|
|
357
|
+
new_line: z.number().nullable(),
|
|
358
|
+
line_range: z.object({
|
|
359
|
+
start: z.object({
|
|
360
|
+
line_code: z.string(),
|
|
361
|
+
type: z.enum(["new", "old"]),
|
|
362
|
+
old_line: z.number().nullable(),
|
|
363
|
+
new_line: z.number().nullable(),
|
|
364
|
+
}),
|
|
365
|
+
end: z.object({
|
|
366
|
+
line_code: z.string(),
|
|
367
|
+
type: z.enum(["new", "old"]),
|
|
368
|
+
old_line: z.number().nullable(),
|
|
369
|
+
new_line: z.number().nullable(),
|
|
370
|
+
}),
|
|
371
|
+
}).nullable().optional(), // For multi-line diff notes
|
|
372
|
+
width: z.number().optional(), // For image diff notes
|
|
373
|
+
height: z.number().optional(), // For image diff notes
|
|
374
|
+
x: z.number().optional(), // For image diff notes
|
|
375
|
+
y: z.number().optional(), // For image diff notes
|
|
376
|
+
}).optional(),
|
|
330
377
|
});
|
|
378
|
+
export const GitLabDiscussionSchema = z.object({
|
|
379
|
+
id: z.string(),
|
|
380
|
+
individual_note: z.boolean(),
|
|
381
|
+
notes: z.array(GitLabDiscussionNoteSchema),
|
|
382
|
+
});
|
|
383
|
+
// Input schema for listing merge request discussions
|
|
384
|
+
export const ListMergeRequestDiscussionsSchema = ProjectParamsSchema.extend({
|
|
385
|
+
merge_request_iid: z.number().describe("The IID of a merge request"),
|
|
386
|
+
});
|
|
387
|
+
// Input schema for updating a merge request discussion note
|
|
388
|
+
export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|
389
|
+
merge_request_iid: z.number().describe("The IID of a merge request"),
|
|
390
|
+
discussion_id: z.string().describe("The ID of a thread"),
|
|
391
|
+
note_id: z.number().describe("The ID of a thread note"),
|
|
392
|
+
body: z.string().describe("The content of the note or reply"),
|
|
393
|
+
resolved: z.boolean().optional().describe("Resolve or unresolve the note"), // Optional based on API docs
|
|
394
|
+
});
|
|
395
|
+
// API Operation Parameter Schemas
|
|
331
396
|
export const CreateOrUpdateFileSchema = ProjectParamsSchema.extend({
|
|
332
397
|
file_path: z.string().describe("Path where to create/update the file"),
|
|
333
398
|
content: z.string().describe("Content of the file"),
|
|
@@ -597,3 +662,23 @@ export const DeleteLabelSchema = z.object({
|
|
|
597
662
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
598
663
|
label_id: z.union([z.number(), z.string()]).describe("The ID or title of a project's label"),
|
|
599
664
|
});
|
|
665
|
+
// Group projects schema
|
|
666
|
+
export const ListGroupProjectsSchema = z.object({
|
|
667
|
+
group_id: z.string().describe("Group ID or path"),
|
|
668
|
+
include_subgroups: z.boolean().optional().describe("Include projects from subgroups"),
|
|
669
|
+
search: z.string().optional().describe("Search term to filter projects"),
|
|
670
|
+
order_by: z.enum(['name', 'path', 'created_at', 'updated_at', 'last_activity_at']).optional().describe("Field to sort by"),
|
|
671
|
+
sort: z.enum(['asc', 'desc']).optional().describe("Sort direction"),
|
|
672
|
+
page: z.number().optional().describe("Page number"),
|
|
673
|
+
per_page: z.number().optional().describe("Number of results per page"),
|
|
674
|
+
archived: z.boolean().optional().describe("Filter for archived projects"),
|
|
675
|
+
visibility: z.enum(["public", "internal", "private"]).optional().describe("Filter by project visibility"),
|
|
676
|
+
with_issues_enabled: z.boolean().optional().describe("Filter projects with issues feature enabled"),
|
|
677
|
+
with_merge_requests_enabled: z.boolean().optional().describe("Filter projects with merge requests feature enabled"),
|
|
678
|
+
min_access_level: z.number().optional().describe("Filter by minimum access level"),
|
|
679
|
+
with_programming_language: z.string().optional().describe("Filter by programming language"),
|
|
680
|
+
starred: z.boolean().optional().describe("Filter by starred projects"),
|
|
681
|
+
statistics: z.boolean().optional().describe("Include project statistics"),
|
|
682
|
+
with_custom_attributes: z.boolean().optional().describe("Include custom attributes"),
|
|
683
|
+
with_security_reports: z.boolean().optional().describe("Include security reports")
|
|
684
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zereight/mcp-gitlab",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
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
|
|
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.
|
|
33
|
+
"zod": "^3.24.2"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|