@zereight/mcp-gitlab 1.0.38 → 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 CHANGED
@@ -14,6 +14,8 @@ GitLab MCP(Model Context Protocol) Server. **Includes bug fixes and improvements
14
14
 
15
15
  When using with the Claude App, you need to set up your API key and URLs directly.
16
16
 
17
+ #### npx
18
+
17
19
  ```json
18
20
  {
19
21
  "mcpServers": {
@@ -24,15 +26,46 @@ When using with the Claude App, you need to set up your API key and URLs directl
24
26
  "GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
25
27
  "GITLAB_API_URL": "your_gitlab_api_url",
26
28
  "GITLAB_READ_ONLY_MODE": "false",
27
- "USE_GITLAB_WIKI":"true"
29
+ "USE_GITLAB_WIKI": "true"
28
30
  }
29
31
  }
30
32
  }
31
33
  }
32
34
  ```
33
35
 
34
- ### Environment Variables
36
+ #### Docker
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "GitLab communication server": {
42
+ "command": "docker",
43
+ "args": [
44
+ "run",
45
+ "-i",
46
+ "--rm",
47
+ "-e",
48
+ "GITLAB_PERSONAL_ACCESS_TOKEN",
49
+ "-e",
50
+ "GITLAB_API_URL",
51
+ "-e",
52
+ "GITLAB_READ_ONLY_MODE",
53
+ "-e",
54
+ "USE_GITLAB_WIKI",
55
+ "nkwd/mcp-gitlab"
56
+ ],
57
+ "env": {
58
+ "GITLAB_PERSONAL_ACCESS": "your_gitlab_token",
59
+ "GITLAB_API_URL": "https://gitlab.com/api/v4", // Optional, for self-hosted GitLab
60
+ "GITLAB_READ_ONLY_MODE": "false",
61
+ "USE_GITLAB_WIKI": "true"
62
+ }
63
+ }
64
+ }
65
+ }
66
+ ```
35
67
 
68
+ ### Environment Variables
36
69
 
37
70
  - `GITLAB_PERSONAL_ACCESS_TOKEN`: Your GitLab personal access token.
38
71
  - `GITLAB_API_URL`: Your GitLab API URL. (Default: `https://gitlab.com/api/v4`)
@@ -42,6 +75,7 @@ When using with the Claude App, you need to set up your API key and URLs directl
42
75
  ## Tools 🛠️
43
76
 
44
77
  +<!-- TOOLS-START -->
78
+
45
79
  1. `create_or_update_file` - Create or update a single file in a GitLab project
46
80
  2. `search_repositories` - Search for GitLab projects
47
81
  3. `create_repository` - Create a new GitLab project
@@ -64,24 +98,25 @@ When using with the Claude App, you need to set up your API key and URLs directl
64
98
  20. `update_issue` - Update an issue in a GitLab project
65
99
  21. `delete_issue` - Delete an issue from a GitLab project
66
100
  22. `list_issue_links` - List all issue links for a specific issue
67
- 23. `get_issue_link` - Get a specific issue link
68
- 24. `create_issue_link` - Create an issue link between two issues
69
- 25. `delete_issue_link` - Delete an issue link
70
- 26. `list_namespaces` - List all namespaces available to the current user
71
- 27. `get_namespace` - Get details of a namespace by ID or path
72
- 28. `verify_namespace` - Verify if a namespace path exists
73
- 29. `get_project` - Get details of a specific project
74
- 30. `list_projects` - List projects accessible by the current user
75
- 31. `list_labels` - List labels for a project
76
- 32. `get_label` - Get a single label from a project
77
- 33. `create_label` - Create a new label in a project
78
- 34. `update_label` - Update an existing label in a project
79
- 35. `delete_label` - Delete a label from a project
80
- 36. `list_group_projects` - List projects in a GitLab group with filtering options
81
- 37. `list_wiki_pages` - List wiki pages in a GitLab project
82
- 38. `get_wiki_page` - Get details of a specific wiki page
83
- 39. `create_wiki_page` - Create a new wiki page in a GitLab project
84
- 40. `update_wiki_page` - Update an existing wiki page in a GitLab project
85
- 41. `delete_wiki_page` - Delete a wiki page from a GitLab project
86
- 42. `get_repository_tree` - Get the repository tree for a GitLab project (list files and directories)
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)
87
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
@@ -101,7 +101,7 @@ export const GitLabRepositorySchema = z.object({
101
101
  jobs_enabled: z.boolean().optional(),
102
102
  snippets_enabled: z.boolean().optional(),
103
103
  can_create_merge_request_in: z.boolean().optional(),
104
- resolve_outdated_diff_discussions: z.boolean().optional(),
104
+ resolve_outdated_diff_discussions: z.boolean().nullable().optional(),
105
105
  shared_runners_enabled: z.boolean().optional(),
106
106
  shared_with_groups: z
107
107
  .array(z.object({
@@ -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"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "MCP server for using the GitLab API",
5
5
  "license": "MIT",
6
6
  "author": "zereight",