@zereight/mcp-gitlab 1.0.39 → 1.0.40
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 +21 -20
- package/build/index.js +47 -1
- package/build/schemas.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -98,24 +98,25 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
|
|
98
98
|
20. `update_issue` - Update an issue in a GitLab project
|
|
99
99
|
21. `delete_issue` - Delete an issue from a GitLab project
|
|
100
100
|
22. `list_issue_links` - List all issue links for a specific issue
|
|
101
|
-
23. `
|
|
102
|
-
24. `
|
|
103
|
-
25. `
|
|
104
|
-
26. `
|
|
105
|
-
27. `
|
|
106
|
-
28. `
|
|
107
|
-
29. `
|
|
108
|
-
30. `
|
|
109
|
-
31. `
|
|
110
|
-
32. `
|
|
111
|
-
33. `
|
|
112
|
-
34. `
|
|
113
|
-
35. `
|
|
114
|
-
36. `
|
|
115
|
-
37. `
|
|
116
|
-
38. `
|
|
117
|
-
39. `
|
|
118
|
-
40. `
|
|
119
|
-
41. `
|
|
120
|
-
42. `
|
|
101
|
+
23. `list_issue_discussions` - List discussions for an issue in a GitLab project
|
|
102
|
+
24. `get_issue_link` - Get a specific issue link
|
|
103
|
+
25. `create_issue_link` - Create an issue link between two issues
|
|
104
|
+
26. `delete_issue_link` - Delete an issue link
|
|
105
|
+
27. `list_namespaces` - List all namespaces available to the current user
|
|
106
|
+
28. `get_namespace` - Get details of a namespace by ID or path
|
|
107
|
+
29. `verify_namespace` - Verify if a namespace path exists
|
|
108
|
+
30. `get_project` - Get details of a specific project
|
|
109
|
+
31. `list_projects` - List projects accessible by the current user
|
|
110
|
+
32. `list_labels` - List labels for a project
|
|
111
|
+
33. `get_label` - Get a single label from a project
|
|
112
|
+
34. `create_label` - Create a new label in a project
|
|
113
|
+
35. `update_label` - Update an existing label in a project
|
|
114
|
+
36. `delete_label` - Delete a label from a project
|
|
115
|
+
37. `list_group_projects` - List projects in a GitLab group with filtering options
|
|
116
|
+
38. `list_wiki_pages` - List wiki pages in a GitLab project
|
|
117
|
+
39. `get_wiki_page` - Get details of a specific wiki page
|
|
118
|
+
40. `create_wiki_page` - Create a new wiki page in a GitLab project
|
|
119
|
+
41. `update_wiki_page` - Update an existing wiki page in a GitLab project
|
|
120
|
+
42. `delete_wiki_page` - Delete a wiki page from a GitLab project
|
|
121
|
+
43. `get_repository_tree` - Get the repository tree for a GitLab project (list files and directories)
|
|
121
122
|
<!-- TOOLS-END -->
|
package/build/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { dirname } from "path";
|
|
|
13
13
|
import fs from "fs";
|
|
14
14
|
import path from "path";
|
|
15
15
|
import { URL } from "url";
|
|
16
|
-
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, CreateMergeRequestThreadSchema, ListGroupProjectsSchema, ListWikiPagesSchema, GetWikiPageSchema, CreateWikiPageSchema, UpdateWikiPageSchema, DeleteWikiPageSchema, GitLabWikiPageSchema,
|
|
16
|
+
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, ListIssueDiscussionsSchema, GetIssueLinkSchema, CreateIssueLinkSchema, DeleteIssueLinkSchema, ListNamespacesSchema, GetNamespaceSchema, VerifyNamespaceSchema, GetProjectSchema, ListProjectsSchema, ListLabelsSchema, GetLabelSchema, CreateLabelSchema, UpdateLabelSchema, DeleteLabelSchema, CreateNoteSchema, CreateMergeRequestThreadSchema, ListGroupProjectsSchema, ListWikiPagesSchema, GetWikiPageSchema, CreateWikiPageSchema, UpdateWikiPageSchema, DeleteWikiPageSchema, GitLabWikiPageSchema,
|
|
17
17
|
// Discussion Schemas
|
|
18
18
|
GitLabDiscussionNoteSchema, // Added
|
|
19
19
|
GitLabDiscussionSchema, UpdateMergeRequestNoteSchema, // Added
|
|
@@ -196,6 +196,11 @@ const allTools = [
|
|
|
196
196
|
description: "List all issue links for a specific issue",
|
|
197
197
|
inputSchema: zodToJsonSchema(ListIssueLinksSchema),
|
|
198
198
|
},
|
|
199
|
+
{
|
|
200
|
+
name: "list_issue_discussions",
|
|
201
|
+
description: "List discussions for an issue in a GitLab project",
|
|
202
|
+
inputSchema: zodToJsonSchema(ListIssueDiscussionsSchema),
|
|
203
|
+
},
|
|
199
204
|
{
|
|
200
205
|
name: "get_issue_link",
|
|
201
206
|
description: "Get a specific issue link",
|
|
@@ -307,6 +312,7 @@ const readOnlyTools = [
|
|
|
307
312
|
"list_issues",
|
|
308
313
|
"get_issue",
|
|
309
314
|
"list_issue_links",
|
|
315
|
+
"list_issue_discussions",
|
|
310
316
|
"get_issue_link",
|
|
311
317
|
"list_namespaces",
|
|
312
318
|
"get_namespace",
|
|
@@ -733,6 +739,38 @@ async function listMergeRequestDiscussions(projectId, mergeRequestIid) {
|
|
|
733
739
|
// Ensure the response is parsed as an array of discussions
|
|
734
740
|
return z.array(GitLabDiscussionSchema).parse(data);
|
|
735
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* List discussions for an issue
|
|
744
|
+
*
|
|
745
|
+
* @param {string} projectId - The ID or URL-encoded path of the project
|
|
746
|
+
* @param {number} issueIid - The internal ID of the project issue
|
|
747
|
+
* @param {Object} options - Pagination and sorting options
|
|
748
|
+
* @returns {Promise<GitLabDiscussion[]>} List of issue discussions
|
|
749
|
+
*/
|
|
750
|
+
async function listIssueDiscussions(projectId, issueIid, options = {}) {
|
|
751
|
+
projectId = decodeURIComponent(projectId); // Decode project ID
|
|
752
|
+
const url = new URL(`${GITLAB_API_URL}/projects/${encodeURIComponent(projectId)}/issues/${issueIid}/discussions`);
|
|
753
|
+
// Add query parameters for pagination and sorting
|
|
754
|
+
if (options.page) {
|
|
755
|
+
url.searchParams.append("page", options.page.toString());
|
|
756
|
+
}
|
|
757
|
+
if (options.per_page) {
|
|
758
|
+
url.searchParams.append("per_page", options.per_page.toString());
|
|
759
|
+
}
|
|
760
|
+
if (options.sort) {
|
|
761
|
+
url.searchParams.append("sort", options.sort);
|
|
762
|
+
}
|
|
763
|
+
if (options.order_by) {
|
|
764
|
+
url.searchParams.append("order_by", options.order_by);
|
|
765
|
+
}
|
|
766
|
+
const response = await fetch(url.toString(), {
|
|
767
|
+
...DEFAULT_FETCH_CONFIG,
|
|
768
|
+
});
|
|
769
|
+
await handleGitLabError(response);
|
|
770
|
+
const data = await response.json();
|
|
771
|
+
// Parse the response as an array of discussions
|
|
772
|
+
return z.array(GitLabDiscussionSchema).parse(data);
|
|
773
|
+
}
|
|
736
774
|
/**
|
|
737
775
|
* Modify an existing merge request thread note
|
|
738
776
|
* 병합 요청 토론 노트 수정
|
|
@@ -1872,6 +1910,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1872
1910
|
content: [{ type: "text", text: JSON.stringify(links, null, 2) }],
|
|
1873
1911
|
};
|
|
1874
1912
|
}
|
|
1913
|
+
case "list_issue_discussions": {
|
|
1914
|
+
const args = ListIssueDiscussionsSchema.parse(request.params.arguments);
|
|
1915
|
+
const { project_id, issue_iid, ...options } = args;
|
|
1916
|
+
const discussions = await listIssueDiscussions(project_id, issue_iid, options);
|
|
1917
|
+
return {
|
|
1918
|
+
content: [{ type: "text", text: JSON.stringify(discussions, null, 2) }],
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1875
1921
|
case "get_issue_link": {
|
|
1876
1922
|
const args = GetIssueLinkSchema.parse(request.params.arguments);
|
|
1877
1923
|
const link = await getIssueLink(args.project_id, args.issue_iid, args.issue_link_id);
|
package/build/schemas.js
CHANGED
|
@@ -691,6 +691,14 @@ export const ListIssueLinksSchema = z.object({
|
|
|
691
691
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
692
692
|
issue_iid: z.number().describe("The internal ID of a project's issue"),
|
|
693
693
|
});
|
|
694
|
+
export const ListIssueDiscussionsSchema = z.object({
|
|
695
|
+
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
696
|
+
issue_iid: z.number().describe("The internal ID of the project issue"),
|
|
697
|
+
page: z.number().optional().describe("Page number for pagination"),
|
|
698
|
+
per_page: z.number().optional().describe("Number of items per page"),
|
|
699
|
+
sort: z.enum(["asc", "desc"]).optional().describe("Return issue discussions sorted in ascending or descending order"),
|
|
700
|
+
order_by: z.enum(["created_at", "updated_at"]).optional().describe("Return issue discussions ordered by created_at or updated_at fields"),
|
|
701
|
+
});
|
|
694
702
|
export const GetIssueLinkSchema = z.object({
|
|
695
703
|
project_id: z.string().describe("Project ID or URL-encoded path"),
|
|
696
704
|
issue_iid: z.number().describe("The internal ID of a project's issue"),
|