@zereight/mcp-gitlab 2.3.7-next.136 → 2.3.7-next.138
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 +2 -2
- package/README.md +256 -255
- package/README.pt-BR.md +2 -2
- package/README.zh-CN.md +2 -2
- package/build/index.js +58 -7
- package/build/schemas.js +85 -0
- package/build/tools/registry.js +10 -1
- package/build/tools/tool-descriptions.js +3 -2
- package/build/utils/url.js +30 -6
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -36,7 +36,7 @@ PAT, OAuth, 읽기 전용 모드, 동적 API URL, 원격 인증을 지원하며
|
|
|
36
36
|
|
|
37
37
|
### 왜 이 GitLab MCP를 사용하나요?
|
|
38
38
|
|
|
39
|
-
- **
|
|
39
|
+
- **277개 도구: toolset 275개 + `execute_graphql` + `discover_tools`** — 작은 toolset으로 시작하고, 런타임에 카테고리 활성화
|
|
40
40
|
- **MR 2단계 리뷰** — `list_merge_request_changed_files` → 배치 `get_merge_request_file_diff`
|
|
41
41
|
- **Agent Skill 내장** — `skills/gitlab-mcp/` 워크플로우 가이드
|
|
42
42
|
- **유연한 인증** — Personal Access Token, 로컬 OAuth2 브라우저 플로우, MCP OAuth 프록시, 요청별 원격 인증
|
|
@@ -50,7 +50,7 @@ PAT, OAuth, 읽기 전용 모드, 동적 API URL, 원격 인증을 지원하며
|
|
|
50
50
|
| | @zereight/mcp-gitlab | GitLab MCP A (커뮤니티 CQRS형) | GitLab 공식 MCP 서버 |
|
|
51
51
|
| --------------- | ---------------------------------------------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
52
|
| **적합한 경우** | AI 에이전트 워크플로우 | 엔터프라이즈 멀티 인스턴스 / 그룹형 도구 | GitLab에 내장, 별도 설치 없음 |
|
|
53
|
-
| **도구 모델** |
|
|
53
|
+
| **도구 모델** | 277개 도구: toolset 275개 + `execute_graphql` + `discover_tools` | ~50–60개 `browse_*` / `manage_*` 그룹 도구 | HTTP 헤더로 고르는 toolset |
|
|
54
54
|
| **MR 리뷰** | 2단계 배치 diff | 서버마다 다름 | `get_merge_request`에 diffs |
|
|
55
55
|
| **Node.js** | >=18.17 | 보통 >=24 | stdio는 `mcp-remote`, Node.js 20+ |
|
|
56
56
|
| **라이선스** | MIT | 서버마다 다름 | GitLab의 일부 |
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ Supports PAT, OAuth, read-only mode, dynamic API URLs, and remote authorization
|
|
|
41
41
|
|
|
42
42
|
### Why use this GitLab MCP?
|
|
43
43
|
|
|
44
|
-
- **
|
|
44
|
+
- **277 tools: 275 in toolsets + `execute_graphql` + `discover_tools`** — start with a small toolset; activate more at runtime without CQRS-style grouping
|
|
45
45
|
- **MR 2-step review** — `list_merge_request_changed_files` → batched `get_merge_request_file_diff`
|
|
46
46
|
- **Agent Skill built in** — workflow guidance in `skills/gitlab-mcp/`
|
|
47
47
|
- **Flexible auth** — Personal Access Token, local OAuth2 browser flow, MCP OAuth proxy, and per-request remote authorization
|
|
@@ -55,7 +55,7 @@ Supports PAT, OAuth, read-only mode, dynamic API URLs, and remote authorization
|
|
|
55
55
|
| | @zereight/mcp-gitlab | GitLab MCP A (community CQRS-style) | GitLab official MCP server |
|
|
56
56
|
| -------------- | ----------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
57
57
|
| **Best for** | AI agent workflows | Enterprise multi-instance / grouped tools | Built into GitLab, no separate install |
|
|
58
|
-
| **Tool model** |
|
|
58
|
+
| **Tool model** | 277 tools: 275 in toolsets + `execute_graphql` + `discover_tools` | ~50–60 grouped `browse_*` / `manage_*` tools | Toolsets chosen with an HTTP header |
|
|
59
59
|
| **MR review** | 2-step batched diff | Varies | `get_merge_request` with diffs |
|
|
60
60
|
| **Node.js** | >=18.17 | Often >=24 | Node.js 20+ for stdio via `mcp-remote` |
|
|
61
61
|
| **License** | MIT | Varies | Part of GitLab |
|
|
@@ -686,259 +686,260 @@ Register the skill directory in your AI client to get optimal tool usage guidanc
|
|
|
686
686
|
21. `list_protected_branches` - List protected branches in a project, supports search filter
|
|
687
687
|
22. `get_protected_branch` - Get details of a single protected branch (access levels, force push settings)
|
|
688
688
|
23. `protect_branch` - Protect a repository branch (set push/merge/unprotect access levels)
|
|
689
|
-
24. `
|
|
690
|
-
25. `
|
|
691
|
-
26. `
|
|
692
|
-
27. `
|
|
693
|
-
28. `
|
|
694
|
-
29. `
|
|
695
|
-
30. `
|
|
696
|
-
31. `
|
|
697
|
-
32. `
|
|
698
|
-
33. `
|
|
699
|
-
34. `
|
|
700
|
-
35. `
|
|
701
|
-
36. `
|
|
702
|
-
37. `
|
|
703
|
-
38. `
|
|
704
|
-
39. `
|
|
705
|
-
40. `
|
|
706
|
-
41. `
|
|
707
|
-
42. `
|
|
708
|
-
43. `
|
|
709
|
-
44. `
|
|
710
|
-
45. `
|
|
711
|
-
46. `
|
|
712
|
-
47. `
|
|
713
|
-
48. `
|
|
714
|
-
49. `
|
|
715
|
-
50. `
|
|
716
|
-
51. `
|
|
717
|
-
52. `
|
|
718
|
-
53. `
|
|
719
|
-
54. `
|
|
720
|
-
55. `
|
|
721
|
-
56. `
|
|
722
|
-
57. `
|
|
723
|
-
58. `
|
|
724
|
-
59. `
|
|
725
|
-
60. `
|
|
726
|
-
61. `
|
|
727
|
-
62. `
|
|
728
|
-
63. `
|
|
729
|
-
64. `
|
|
730
|
-
65. `
|
|
731
|
-
66. `
|
|
732
|
-
67. `
|
|
733
|
-
68. `
|
|
734
|
-
69. `
|
|
735
|
-
70. `
|
|
736
|
-
71. `
|
|
737
|
-
72. `
|
|
738
|
-
73. `
|
|
739
|
-
74. `
|
|
740
|
-
75. `
|
|
741
|
-
76. `
|
|
742
|
-
77. `
|
|
743
|
-
78. `
|
|
744
|
-
79. `
|
|
745
|
-
80. `
|
|
746
|
-
81. `
|
|
747
|
-
82. `
|
|
748
|
-
83. `
|
|
749
|
-
84. `
|
|
750
|
-
85. `
|
|
751
|
-
86. `
|
|
752
|
-
87. `
|
|
753
|
-
88. `
|
|
754
|
-
89. `
|
|
755
|
-
90. `
|
|
756
|
-
91. `
|
|
757
|
-
92. `
|
|
758
|
-
93. `
|
|
759
|
-
94. `
|
|
760
|
-
95. `
|
|
761
|
-
96. `
|
|
762
|
-
97. `
|
|
763
|
-
98. `
|
|
764
|
-
99. `
|
|
765
|
-
100. `
|
|
766
|
-
101. `
|
|
767
|
-
102. `
|
|
768
|
-
103. `
|
|
769
|
-
104. `
|
|
770
|
-
105. `
|
|
771
|
-
106. `
|
|
772
|
-
107. `
|
|
773
|
-
108. `
|
|
774
|
-
109. `
|
|
775
|
-
110. `
|
|
776
|
-
111. `
|
|
777
|
-
112. `
|
|
778
|
-
113. `
|
|
779
|
-
114. `
|
|
780
|
-
115. `
|
|
781
|
-
116. `
|
|
782
|
-
117. `
|
|
783
|
-
118. `
|
|
784
|
-
119. `
|
|
785
|
-
120. `
|
|
786
|
-
121. `
|
|
787
|
-
122. `
|
|
788
|
-
123. `
|
|
789
|
-
124. `
|
|
790
|
-
125. `
|
|
791
|
-
126. `
|
|
792
|
-
127. `
|
|
793
|
-
128. `
|
|
794
|
-
129. `
|
|
795
|
-
130. `
|
|
796
|
-
131. `
|
|
797
|
-
132. `
|
|
798
|
-
133. `
|
|
799
|
-
134. `
|
|
800
|
-
135. `
|
|
801
|
-
136. `
|
|
802
|
-
137. `
|
|
803
|
-
138. `
|
|
804
|
-
139. `
|
|
805
|
-
140. `
|
|
806
|
-
141. `
|
|
807
|
-
142. `
|
|
808
|
-
143. `
|
|
809
|
-
144. `
|
|
810
|
-
145. `
|
|
811
|
-
146. `
|
|
812
|
-
147. `
|
|
813
|
-
148. `
|
|
814
|
-
149. `
|
|
815
|
-
150. `
|
|
816
|
-
151. `
|
|
817
|
-
152. `
|
|
818
|
-
153. `
|
|
819
|
-
154. `
|
|
820
|
-
155. `
|
|
821
|
-
156. `
|
|
822
|
-
157. `
|
|
823
|
-
158. `
|
|
824
|
-
159. `
|
|
825
|
-
160. `
|
|
826
|
-
161. `
|
|
827
|
-
162. `
|
|
828
|
-
163. `
|
|
829
|
-
164. `
|
|
830
|
-
165. `
|
|
831
|
-
166. `
|
|
832
|
-
167. `
|
|
833
|
-
168. `
|
|
834
|
-
169. `
|
|
835
|
-
170. `
|
|
836
|
-
171. `
|
|
837
|
-
172. `
|
|
838
|
-
173. `
|
|
839
|
-
174. `
|
|
840
|
-
175. `
|
|
841
|
-
176. `
|
|
842
|
-
177. `
|
|
843
|
-
178. `
|
|
844
|
-
179. `
|
|
845
|
-
180. `
|
|
846
|
-
181. `
|
|
847
|
-
182. `
|
|
848
|
-
183. `
|
|
849
|
-
184. `
|
|
850
|
-
185. `
|
|
851
|
-
186. `
|
|
852
|
-
187. `
|
|
853
|
-
188. `
|
|
854
|
-
189. `
|
|
855
|
-
190. `
|
|
856
|
-
191. `
|
|
857
|
-
192. `
|
|
858
|
-
193. `
|
|
859
|
-
194. `
|
|
860
|
-
195. `
|
|
861
|
-
196. `
|
|
862
|
-
197. `
|
|
863
|
-
198. `
|
|
864
|
-
199. `
|
|
865
|
-
200. `
|
|
866
|
-
201. `
|
|
867
|
-
202. `
|
|
868
|
-
203. `
|
|
869
|
-
204. `
|
|
870
|
-
205. `
|
|
871
|
-
206. `
|
|
872
|
-
207. `
|
|
873
|
-
208. `
|
|
874
|
-
209. `
|
|
875
|
-
210. `
|
|
876
|
-
211. `
|
|
877
|
-
212. `
|
|
878
|
-
213. `
|
|
879
|
-
214. `
|
|
880
|
-
215. `
|
|
881
|
-
216. `
|
|
882
|
-
217. `
|
|
883
|
-
218. `
|
|
884
|
-
219. `
|
|
885
|
-
220. `
|
|
886
|
-
221. `
|
|
887
|
-
222. `
|
|
888
|
-
223. `
|
|
889
|
-
224. `
|
|
890
|
-
225. `
|
|
891
|
-
226. `
|
|
892
|
-
227. `
|
|
893
|
-
228. `
|
|
894
|
-
229. `
|
|
895
|
-
230. `
|
|
896
|
-
231. `
|
|
897
|
-
232. `
|
|
898
|
-
233. `
|
|
899
|
-
234. `
|
|
900
|
-
235. `
|
|
901
|
-
236. `
|
|
902
|
-
237. `
|
|
903
|
-
238. `
|
|
904
|
-
239. `
|
|
905
|
-
240. `
|
|
906
|
-
241. `
|
|
907
|
-
242. `
|
|
908
|
-
243. `
|
|
909
|
-
244. `
|
|
910
|
-
245. `
|
|
911
|
-
246. `
|
|
912
|
-
247. `
|
|
913
|
-
248. `
|
|
914
|
-
249. `
|
|
915
|
-
250. `
|
|
916
|
-
251. `
|
|
917
|
-
252. `
|
|
918
|
-
253. `
|
|
919
|
-
254. `
|
|
920
|
-
255. `
|
|
921
|
-
256. `
|
|
922
|
-
257. `
|
|
923
|
-
258. `
|
|
924
|
-
259. `
|
|
925
|
-
260. `
|
|
926
|
-
261. `
|
|
927
|
-
262. `
|
|
928
|
-
263. `
|
|
929
|
-
264. `
|
|
930
|
-
265. `
|
|
931
|
-
266. `
|
|
932
|
-
267. `
|
|
933
|
-
268. `
|
|
934
|
-
269. `
|
|
935
|
-
270. `
|
|
936
|
-
271. `
|
|
937
|
-
272. `
|
|
938
|
-
273. `
|
|
939
|
-
274. `
|
|
940
|
-
275. `
|
|
941
|
-
276. `
|
|
689
|
+
24. `update_protected_branch` - Update an existing protected branch rule in place (access levels, force push, code owner approval)
|
|
690
|
+
25. `unprotect_branch` - Remove protection from a previously protected branch
|
|
691
|
+
26. `update_default_branch` - Change the default branch of a project
|
|
692
|
+
27. `get_merge_request` - Get details of a merge request (merge_request_iid or source_branch required). Set include_summaries=true for deployment/commit/approval summaries
|
|
693
|
+
28. `get_merge_request_diffs` - Get the changes/diffs of a merge request (merge_request_iid or source_branch required)
|
|
694
|
+
29. `list_merge_request_changed_files` - List changed file paths in a merge request without diff content (merge_request_iid or source_branch required)
|
|
695
|
+
30. `list_merge_request_diffs` - List merge request diffs with pagination (merge_request_iid or source_branch required)
|
|
696
|
+
31. `get_merge_request_file_diff` - Get diffs for specific files from a merge request (merge_request_iid or source_branch required)
|
|
697
|
+
32. `list_merge_request_versions` - List all versions of a merge request
|
|
698
|
+
33. `get_merge_request_version` - Get a specific version of a merge request
|
|
699
|
+
34. `get_branch_diffs` - Get diffs between two branches or commits
|
|
700
|
+
35. `update_merge_request` - Update a merge request (merge_request_iid or source_branch required)
|
|
701
|
+
36. `create_note` - Create a new note (comment) to an issue or merge request
|
|
702
|
+
37. `create_merge_request_thread` - Create a new thread on a merge request
|
|
703
|
+
38. `resolve_merge_request_thread` - Resolve a thread on a merge request
|
|
704
|
+
39. `mr_discussions` - List discussion items for a merge request
|
|
705
|
+
40. `get_merge_request_discussion` - Get a single discussion item for a merge request
|
|
706
|
+
41. `delete_merge_request_discussion_note` - Delete a discussion note on a merge request
|
|
707
|
+
42. `update_merge_request_discussion_note` - Update a discussion note on a merge request
|
|
708
|
+
43. `create_merge_request_discussion_note` - Add a new discussion note to an existing merge request thread
|
|
709
|
+
44. `create_merge_request_note` - Add a new note to a merge request
|
|
710
|
+
45. `delete_merge_request_note` - Delete an existing merge request note
|
|
711
|
+
46. `get_merge_request_note` - Get a specific note for a merge request
|
|
712
|
+
47. `get_merge_request_notes` - List notes for a merge request
|
|
713
|
+
48. `update_merge_request_note` - Modify an existing merge request note
|
|
714
|
+
49. `get_draft_note` - Get a single draft note from a merge request
|
|
715
|
+
50. `list_draft_notes` - List draft notes for a merge request
|
|
716
|
+
51. `create_draft_note` - Create a draft note for a merge request
|
|
717
|
+
52. `update_draft_note` - Update an existing draft note
|
|
718
|
+
53. `delete_draft_note` - Delete a draft note
|
|
719
|
+
54. `publish_draft_note` - Publish a single draft note
|
|
720
|
+
55. `bulk_publish_draft_notes` - Publish all draft notes for a merge request. Optionally sets reviewer_state and posts a summary note (GitLab 19.2+). Can set reviewer_state even with no drafts.
|
|
721
|
+
56. `list_merge_request_emoji_reactions` - List all emoji reactions on a merge request
|
|
722
|
+
57. `list_merge_request_note_emoji_reactions` - List all emoji reactions on a merge request note. Pass discussion_id for discussion thread replies.
|
|
723
|
+
58. `create_merge_request_emoji_reaction` - Add an emoji reaction to a merge request (e.g. thumbsup, rocket, eyes)
|
|
724
|
+
59. `delete_merge_request_emoji_reaction` - Remove an emoji reaction from a merge request
|
|
725
|
+
60. `create_merge_request_note_emoji_reaction` - Add an emoji reaction to a merge request note. Pass discussion_id for discussion thread replies.
|
|
726
|
+
61. `delete_merge_request_note_emoji_reaction` - Remove an emoji reaction from a merge request note. Pass discussion_id for discussion thread replies.
|
|
727
|
+
62. `update_issue_note` - Modify an existing issue thread note
|
|
728
|
+
63. `create_issue_note` - Add a note to an issue, optionally replying to a discussion thread
|
|
729
|
+
64. `list_issue_emoji_reactions` - List all emoji reactions on an issue
|
|
730
|
+
65. `list_issue_note_emoji_reactions` - List all emoji reactions on an issue note. Pass discussion_id for discussion thread replies.
|
|
731
|
+
66. `create_issue_emoji_reaction` - Add an emoji reaction to an issue (e.g. thumbsup, rocket, eyes)
|
|
732
|
+
67. `delete_issue_emoji_reaction` - Remove an emoji reaction from an issue
|
|
733
|
+
68. `create_issue_note_emoji_reaction` - Add an emoji reaction to an issue note. Pass discussion_id for discussion thread replies.
|
|
734
|
+
69. `delete_issue_note_emoji_reaction` - Remove an emoji reaction from an issue note. Pass discussion_id for discussion thread replies.
|
|
735
|
+
70. `list_issues` - List issues (default: created by current user; use scope='all' for all)
|
|
736
|
+
71. `my_issues` - List issues assigned to the authenticated user
|
|
737
|
+
72. `get_issue` - Get details of a specific issue. Returns the issue with a slim nested milestone by default; set full_response=true for the complete milestone object
|
|
738
|
+
73. `update_issue` - Update an issue. Returns a slim confirmation by default; set full_response=true for the complete updated issue object
|
|
739
|
+
74. `update_issue_description_patch` - Apply a patch (search/replace or unified diff) to an issue description. Reduces token usage by allowing small changes without sending the full description. Supports dry_run to preview changes and create_note to summarize updates.
|
|
740
|
+
75. `delete_issue` - Delete an issue
|
|
741
|
+
76. `list_todos` - List GitLab to-do items for the current user
|
|
742
|
+
77. `mark_todo_done` - Mark a GitLab to-do item as done
|
|
743
|
+
78. `mark_all_todos_done` - Mark all pending GitLab to-do items as done for the current user
|
|
744
|
+
79. `list_issue_links` - List all issue links for a specific issue
|
|
745
|
+
80. `list_issue_discussions` - List discussions for an issue
|
|
746
|
+
81. `get_issue_link` - Get a specific issue link
|
|
747
|
+
82. `create_issue_link` - Create an issue link between two issues
|
|
748
|
+
83. `delete_issue_link` - Delete an issue link
|
|
749
|
+
84. `list_namespaces` - List all namespaces (users and groups) available to the current user. Filter by kind='group' for groups only.
|
|
750
|
+
85. `get_namespace` - Get details of a namespace (user or group) by ID or path. Groups are namespaces with kind='group'.
|
|
751
|
+
86. `verify_namespace` - Verify if a namespace path exists. Use parent_id to scope the check to a specific parent namespace — required for nested namespaces where the same path may exist under different parents.
|
|
752
|
+
87. `get_project` - Get details of a specific project
|
|
753
|
+
88. `list_projects` - List projects accessible by the current user
|
|
754
|
+
89. `update_project` - Update project settings such as description, visibility, default branch, and feature access levels
|
|
755
|
+
90. `list_project_members` - List members of a GitLab project
|
|
756
|
+
91. `list_group_members` - List members of a GitLab group with optional name or username search
|
|
757
|
+
92. `list_labels` - List labels for a project
|
|
758
|
+
93. `get_label` - Get a single label from a project
|
|
759
|
+
94. `create_label` - Create a new label in a project
|
|
760
|
+
95. `update_label` - Update an existing label in a project
|
|
761
|
+
96. `delete_label` - Delete a label from a project
|
|
762
|
+
97. `list_group_projects` - List projects in a group
|
|
763
|
+
98. `list_wiki_pages` - List wiki pages in a project
|
|
764
|
+
99. `get_wiki_page` - Get details of a specific wiki page
|
|
765
|
+
100. `create_wiki_page` - Create a wiki page in a project
|
|
766
|
+
101. `update_wiki_page` - Update a wiki page in a project
|
|
767
|
+
102. `delete_wiki_page` - Delete a wiki page from a project
|
|
768
|
+
103. `list_group_wiki_pages` - List wiki pages in a group
|
|
769
|
+
104. `get_group_wiki_page` - Get details of a specific group wiki page
|
|
770
|
+
105. `create_group_wiki_page` - Create a wiki page in a group
|
|
771
|
+
106. `update_group_wiki_page` - Update a wiki page in a group
|
|
772
|
+
107. `delete_group_wiki_page` - Delete a wiki page from a group
|
|
773
|
+
108. `get_repository_tree` - List files and directories in a repository
|
|
774
|
+
109. `list_pipelines` - List pipelines with filtering options
|
|
775
|
+
110. `get_pipeline` - Get details of a specific pipeline
|
|
776
|
+
111. `get_pipeline_variables` - Get variables configured for a pipeline
|
|
777
|
+
112. `get_pipeline_test_report` - Get pipeline test report
|
|
778
|
+
113. `get_pipeline_test_report_summary` - Get pipeline test report summary
|
|
779
|
+
114. `delete_pipeline` - Delete a pipeline. Requires the project Owner role, cannot be undone, and does not automatically delete child pipelines.
|
|
780
|
+
115. `update_pipeline_metadata` - Update pipeline metadata
|
|
781
|
+
116. `list_deployments` - List deployments with filtering options
|
|
782
|
+
117. `get_deployment` - Get deployment details, including approval_summary, approvals, and pending_approval_count when GitLab provides them
|
|
783
|
+
118. `create_deployment` - Create a deployment
|
|
784
|
+
119. `update_deployment` - Update a deployment status
|
|
785
|
+
120. `delete_deployment` - Delete a deployment
|
|
786
|
+
121. `list_deployment_merge_requests` - List merge requests shipped with a deployment
|
|
787
|
+
122. `approve_deployment` - Approve or reject a protected-environment deployment
|
|
788
|
+
123. `list_environments` - List environments in a project
|
|
789
|
+
124. `get_environment` - Get details of a specific environment
|
|
790
|
+
125. `update_environment` - Update an environment
|
|
791
|
+
126. `delete_environment` - Delete a stopped environment
|
|
792
|
+
127. `stop_environment` - Stop an environment
|
|
793
|
+
128. `stop_stale_environments` - Stop eligible stale environments; protected environments are excluded and environments are stopped, not deleted
|
|
794
|
+
129. `delete_review_app_environments` - Schedule deletion of stopped review-app environments one week later; dry_run defaults to true and actual scheduling requires dry_run=false
|
|
795
|
+
130. `list_pipeline_triggers` - List project pipeline trigger tokens
|
|
796
|
+
131. `get_pipeline_trigger` - Get a project pipeline trigger
|
|
797
|
+
132. `create_pipeline_trigger` - Create a project pipeline trigger
|
|
798
|
+
133. `update_pipeline_trigger` - Update a project pipeline trigger
|
|
799
|
+
134. `delete_pipeline_trigger` - Delete a project pipeline trigger
|
|
800
|
+
135. `trigger_pipeline` - Trigger a pipeline with a pipeline trigger token
|
|
801
|
+
136. `list_pipeline_jobs` - List all jobs in a specific pipeline
|
|
802
|
+
137. `list_pipeline_trigger_jobs` - List trigger jobs (bridges) in a pipeline
|
|
803
|
+
138. `get_pipeline_job` - Get details of a GitLab pipeline job number
|
|
804
|
+
139. `get_pipeline_job_output` - Get the output/trace of a pipeline job with optional pagination
|
|
805
|
+
140. `validate_ci_lint` - Validate provided GitLab CI/CD YAML content for a project
|
|
806
|
+
141. `validate_project_ci_lint` - Validate an existing .gitlab-ci.yml configuration for a project
|
|
807
|
+
142. `list_ci_catalog_resources` - List GitLab CI/CD Catalog resources/components visible to the user
|
|
808
|
+
143. `get_ci_catalog_resource` - Get details for a GitLab CI/CD Catalog resource, including versions and components
|
|
809
|
+
144. `create_pipeline` - Create a new pipeline for a branch or tag
|
|
810
|
+
145. `retry_pipeline` - Retry a failed or canceled pipeline
|
|
811
|
+
146. `cancel_pipeline` - Cancel a running pipeline
|
|
812
|
+
147. `list_pipeline_schedules` - List pipeline schedules in a project, optionally filtered to active or inactive
|
|
813
|
+
148. `get_pipeline_schedule` - Get details of a specific pipeline schedule, including its variables and last pipeline
|
|
814
|
+
149. `list_pipeline_schedule_pipelines` - List the pipelines that a pipeline schedule has triggered
|
|
815
|
+
150. `create_pipeline_schedule` - Create a new pipeline schedule for a branch or tag
|
|
816
|
+
151. `update_pipeline_schedule` - Update an existing pipeline schedule
|
|
817
|
+
152. `delete_pipeline_schedule` - Delete a pipeline schedule
|
|
818
|
+
153. `play_pipeline_schedule` - Run a pipeline schedule immediately
|
|
819
|
+
154. `take_ownership_pipeline_schedule` - Take ownership of a pipeline schedule
|
|
820
|
+
155. `get_pipeline_schedule_variable` - Get a single variable of a pipeline schedule
|
|
821
|
+
156. `create_pipeline_schedule_variable` - Create a variable for a pipeline schedule
|
|
822
|
+
157. `update_pipeline_schedule_variable` - Update a variable of a pipeline schedule
|
|
823
|
+
158. `delete_pipeline_schedule_variable` - Delete a variable from a pipeline schedule
|
|
824
|
+
159. `play_pipeline_job` - Run a manual pipeline job
|
|
825
|
+
160. `play_pipeline_jobs` - Play multiple manual pipeline jobs sequentially
|
|
826
|
+
161. `retry_pipeline_job` - Retry a failed or canceled pipeline job
|
|
827
|
+
162. `cancel_pipeline_job` - Cancel a running pipeline job
|
|
828
|
+
163. `erase_pipeline_job` - Erase a pipeline job log and artifacts
|
|
829
|
+
164. `wait_for_pipeline` - Wait for a pipeline to reach a terminal status
|
|
830
|
+
165. `wait_for_job` - Wait for a job to reach a terminal status
|
|
831
|
+
166. `list_job_artifacts` - List artifact files in a job's archive
|
|
832
|
+
167. `download_job_artifacts` - Download job artifact archive (zip) and save to a local path
|
|
833
|
+
168. `get_job_artifact_file` - Get content of a single file from a job's artifacts
|
|
834
|
+
169. `list_merge_requests` - List merge requests (without project_id: user's MRs; with project_id: project MRs)
|
|
835
|
+
170. `list_group_merge_requests` - List merge requests across all projects of a group and its subgroups
|
|
836
|
+
171. `list_milestones` - List milestones with filtering options
|
|
837
|
+
172. `get_milestone` - Get details of a specific milestone
|
|
838
|
+
173. `create_milestone` - Create a new milestone
|
|
839
|
+
174. `edit_milestone` - Edit an existing milestone
|
|
840
|
+
175. `delete_milestone` - Delete a milestone
|
|
841
|
+
176. `get_milestone_issue` - Get issues associated with a specific milestone
|
|
842
|
+
177. `get_milestone_merge_requests` - Get merge requests associated with a specific milestone
|
|
843
|
+
178. `promote_milestone` - Promote a milestone to the next stage
|
|
844
|
+
179. `get_milestone_burndown_events` - Get burndown events for a specific milestone
|
|
845
|
+
180. `list_group_milestones` - List group milestones with filtering options
|
|
846
|
+
181. `get_group_milestone` - Get details of a specific group milestone
|
|
847
|
+
182. `create_group_milestone` - Create a new group milestone
|
|
848
|
+
183. `edit_group_milestone` - Edit an existing group milestone
|
|
849
|
+
184. `delete_group_milestone` - Delete a group milestone
|
|
850
|
+
185. `get_group_milestone_issue` - Get issues associated with a specific group milestone
|
|
851
|
+
186. `get_group_milestone_merge_requests` - Get merge requests associated with a specific group milestone
|
|
852
|
+
187. `get_group_milestone_burndown_events` - Get burndown events for a specific group milestone
|
|
853
|
+
188. `get_users` - Get GitLab user details by usernames
|
|
854
|
+
189. `get_user` - Get user details by ID
|
|
855
|
+
190. `whoami` - Get current authenticated user details
|
|
856
|
+
191. `list_commits` - List repository commits with filtering options
|
|
857
|
+
192. `get_commit` - Get details of a specific commit
|
|
858
|
+
193. `get_commit_diff` - Get changes/diffs of a specific commit
|
|
859
|
+
194. `get_file_blame` - Get git blame for a file at a given ref. Each entry maps a contiguous range of source lines to the commit that last changed them (id, author, authored_date, message). Use range_start/range_end to limit blame to specific lines.
|
|
860
|
+
195. `list_commit_statuses` - List statuses for a commit
|
|
861
|
+
196. `create_commit_status` - Create or update the status of a commit
|
|
862
|
+
197. `list_group_iterations` - List group iterations with filtering options
|
|
863
|
+
198. `upload_markdown` - Upload a file for use in markdown content
|
|
864
|
+
199. `download_attachment` - Download an uploaded file from a project (images returned as base64; other files, or images with local_path, are saved as new files under the download directory)
|
|
865
|
+
200. `health_check` - Verify server status and authentication. Always reports the MCP server version (mcp_server_version). When authenticated, also reports the GitLab instance version from GET /api/v4/version (version, revision, enterprise). Version lookup failures do not fail the health check — those fields are omitted.
|
|
866
|
+
201. `list_events` - List events for the authenticated user (before/after: YYYY-MM-DD)
|
|
867
|
+
202. `get_project_events` - List events for a project (before/after: YYYY-MM-DD)
|
|
868
|
+
203. `list_releases` - List all releases for a project
|
|
869
|
+
204. `get_release` - Get a release by tag name
|
|
870
|
+
205. `create_release` - Create a new release
|
|
871
|
+
206. `update_release` - Update an existing release
|
|
872
|
+
207. `delete_release` - Delete a release (does not delete the tag)
|
|
873
|
+
208. `create_release_evidence` - Create release evidence (Premium/Ultimate)
|
|
874
|
+
209. `download_release_asset` - Download a release asset file by direct asset path
|
|
875
|
+
210. `list_tags` - List repository tags for a project
|
|
876
|
+
211. `get_tag` - Get a repository tag by name
|
|
877
|
+
212. `create_tag` - Create a new repository tag
|
|
878
|
+
213. `delete_tag` - Delete a repository tag
|
|
879
|
+
214. `get_tag_signature` - Get the X.509 signature of a signed tag (404 if unsigned)
|
|
880
|
+
215. `list_protected_tags` - List protected tags in a project
|
|
881
|
+
216. `get_protected_tag` - Get details of a single protected tag or wildcard (create access levels)
|
|
882
|
+
217. `protect_tag` - Protect a repository tag or wildcard (set who can create it)
|
|
883
|
+
218. `unprotect_tag` - Remove protection from a previously protected tag or wildcard
|
|
884
|
+
219. `get_work_item` - Get a work item with full details including status, hierarchy, type, and widgets
|
|
885
|
+
220. `list_work_items` - List work items with filters (type, state, search, assignees, labels)
|
|
886
|
+
221. `create_work_item` - Create a work item (issue, task, incident, epic, etc.) with full field support
|
|
887
|
+
222. `update_work_item` - Update a work item (title, description, labels, assignees, state, parent, custom fields, etc.)
|
|
888
|
+
223. `convert_work_item_type` - Convert a work item to a different type
|
|
889
|
+
224. `list_work_item_statuses` - List available statuses for a work item type (Premium/Ultimate)
|
|
890
|
+
225. `list_custom_field_definitions` - List custom field definitions for a work item type
|
|
891
|
+
226. `move_work_item` - Move a work item to a different project
|
|
892
|
+
227. `list_work_item_notes` - List notes and discussions on a work item
|
|
893
|
+
228. `create_work_item_note` - Add a note to a work item (supports Markdown, internal notes, threads)
|
|
894
|
+
229. `list_work_item_emoji_reactions` - List all emoji reactions on a work item
|
|
895
|
+
230. `list_work_item_note_emoji_reactions` - List all emoji reactions on a work item note (comment, thread, or thread reply)
|
|
896
|
+
231. `create_work_item_emoji_reaction` - Add an emoji reaction to a work item (e.g. thumbsup, rocket, eyes)
|
|
897
|
+
232. `delete_work_item_emoji_reaction` - Remove an emoji reaction from a work item
|
|
898
|
+
233. `create_work_item_note_emoji_reaction` - Add an emoji reaction to a work item note (comment, thread, or thread reply)
|
|
899
|
+
234. `delete_work_item_note_emoji_reaction` - Remove an emoji reaction from a work item note (comment, thread, or thread reply)
|
|
900
|
+
235. `get_timeline_events` - List timeline events for an incident
|
|
901
|
+
236. `create_timeline_event` - Create a timeline event on an incident
|
|
902
|
+
237. `list_webhooks` - List webhooks for a project or group
|
|
903
|
+
238. `create_webhook` - Create a webhook on a project or group
|
|
904
|
+
239. `update_webhook` - Update an existing project or group webhook
|
|
905
|
+
240. `delete_webhook` - Delete a project or group webhook
|
|
906
|
+
241. `list_webhook_events` - List recent webhook events (past 7 days)
|
|
907
|
+
242. `get_webhook_event` - Get full details of a specific webhook event
|
|
908
|
+
243. `search_code` - Search for code across all projects (requires advanced search or Zoekt)
|
|
909
|
+
244. `search_project_code` - Search for code within a specific project (requires advanced search or Zoekt)
|
|
910
|
+
245. `search_group_code` - Search for code within a specific group (requires advanced search or Zoekt)
|
|
911
|
+
246. `list_project_variables` - List CI/CD variables for a project
|
|
912
|
+
247. `get_project_variable` - Get a single CI/CD variable from a project
|
|
913
|
+
248. `create_project_variable` - Create a CI/CD variable for a project
|
|
914
|
+
249. `update_project_variable` - Update an existing CI/CD variable in a project
|
|
915
|
+
250. `delete_project_variable` - Delete a CI/CD variable from a project
|
|
916
|
+
251. `list_group_variables` - List CI/CD variables for a group
|
|
917
|
+
252. `get_group_variable` - Get a single CI/CD variable from a group
|
|
918
|
+
253. `create_group_variable` - Create a CI/CD variable for a group
|
|
919
|
+
254. `update_group_variable` - Update an existing CI/CD variable in a group
|
|
920
|
+
255. `delete_group_variable` - Delete a CI/CD variable from a group
|
|
921
|
+
256. `get_dependency_proxy_settings` - Get dependency proxy settings for a group
|
|
922
|
+
257. `update_dependency_proxy_settings` - Update dependency proxy settings for a group (enable/disable, credentials for authenticated Docker Hub pulls)
|
|
923
|
+
258. `list_dependency_proxy_blobs` - List cached dependency proxy blobs for a group
|
|
924
|
+
259. `purge_dependency_proxy_cache` - Schedule purge of all cached dependency proxy blobs for a group
|
|
925
|
+
260. `list_project_vulnerabilities` - List vulnerabilities for a project with optional state, severity, and report type filters (GraphQL-backed, cursor pagination)
|
|
926
|
+
261. `get_vulnerability` - Get full details of a specific vulnerability
|
|
927
|
+
262. `dismiss_vulnerability` - Dismiss a vulnerability with a reason (acceptable_risk, false_positive, used_in_tests, mitigating_control, not_applicable) and optional comment
|
|
928
|
+
263. `confirm_vulnerability` - Confirm a vulnerability as a real finding requiring remediation
|
|
929
|
+
264. `orbit_query` - Execute a GitLab Orbit graph query over the indexed SDLC knowledge graph
|
|
930
|
+
265. `orbit_get_schema` - Fetch the current GitLab Orbit graph schema (node and edge types)
|
|
931
|
+
266. `orbit_get_status` - Check GitLab Orbit indexing status for the enabled scope
|
|
932
|
+
267. `orbit_list_tools` - List the MCP tool definitions exposed by GitLab Orbit
|
|
933
|
+
268. `list_snippets` - List snippets — project snippets when project_id is given, otherwise personal snippets
|
|
934
|
+
269. `get_snippet` - Get a snippet's metadata. Set include_content=true to also fetch the raw file content.
|
|
935
|
+
270. `create_snippet` - Create a snippet — project-scoped when project_id is given, otherwise a personal snippet. Requires title plus either file_name + content (single file) or files[] (multi-file); the two shapes cannot be mixed.
|
|
936
|
+
271. `update_snippet` - Update an existing snippet (provide at least one field to change). For multi-file edits — renames, deletions, additions — pass files[] with action (create/update/delete/move) and previous_path. The file_name + content shortcut still works for single-file content replacement.
|
|
937
|
+
272. `delete_snippet` - Delete a snippet
|
|
938
|
+
273. `list_project_runners` - List runners available to a project (type, status, paused, tag_list). Omits registration and authentication tokens.
|
|
939
|
+
274. `get_runner` - Get a runner's tag_list, run_untagged, locked, and access_level. When a project allowlist is active, the runner must be available to an allowed project. Omits registration and authentication tokens.
|
|
940
|
+
275. `rebase_merge_request` - Rebase the source branch of a merge request onto its target branch
|
|
941
|
+
276. `gitlab_api_request` - Send one GitLab REST call under /api/v4. Enabled only when GITLAB_TOOLSETS lists api. Readonly allows GET; modify rejects DELETE.
|
|
942
|
+
277. `discover_tools` - Discover and activate additional tool categories for this session. Available categories: core, merge_requests, issues, repositories, branches, projects, labels, ci, groups, pipelines, milestones, wiki, releases, tags, snippets, users, workitems, webhooks, search, variables, dependency_proxy, vulnerabilities, orbit. Already-active categories are listed in the response.
|
|
942
943
|
|
|
943
944
|
<!-- TOOLS-END -->
|
|
944
945
|
|
package/README.pt-BR.md
CHANGED
|
@@ -36,7 +36,7 @@ Suporta PAT, OAuth, modo somente leitura, URLs de API dinâmicas e autorização
|
|
|
36
36
|
|
|
37
37
|
### Por que usar este GitLab MCP?
|
|
38
38
|
|
|
39
|
-
- **
|
|
39
|
+
- **277 ferramentas: 275 em toolsets + `execute_graphql` + `discover_tools`** — comece com um toolset pequeno e ative mais categorias em tempo de execução
|
|
40
40
|
- **Revisão de MR em 2 etapas** — `list_merge_request_changed_files` → `get_merge_request_file_diff` em lote
|
|
41
41
|
- **Agent Skill integrado** — orientação de workflows em `skills/gitlab-mcp/`
|
|
42
42
|
- **Autenticação flexível** — Personal Access Token, fluxo OAuth2 local no navegador, proxy MCP OAuth e autorização remota por requisição
|
|
@@ -50,7 +50,7 @@ Suporta PAT, OAuth, modo somente leitura, URLs de API dinâmicas e autorização
|
|
|
50
50
|
| | @zereight/mcp-gitlab | GitLab MCP A (comunidade, estilo CQRS) | Servidor MCP oficial do GitLab |
|
|
51
51
|
| ------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
52
|
| **Mais indicado para** | Workflows de agentes de IA | Múltiplas instâncias corporativas / ferramentas agrupadas | Integrado ao GitLab, sem instalação separada |
|
|
53
|
-
| **Modelo de ferramentas** |
|
|
53
|
+
| **Modelo de ferramentas** | 277 ferramentas: 275 em toolsets + `execute_graphql` + `discover_tools` | ~50–60 ferramentas agrupadas `browse_*` / `manage_*` | Toolsets escolhidos por cabeçalho HTTP |
|
|
54
54
|
| **Revisão de MR** | Diff em lote em 2 etapas | Varia | `get_merge_request` com diffs |
|
|
55
55
|
| **Node.js** | >=18.17 | Frequentemente >=24 | Node.js 20+ para stdio via `mcp-remote` |
|
|
56
56
|
| **Licença** | MIT | Varia | Parte do GitLab |
|
package/README.zh-CN.md
CHANGED
|
@@ -36,7 +36,7 @@ read -rs GITLAB_PERSONAL_ACCESS_TOKEN && export GITLAB_PERSONAL_ACCESS_TOKEN
|
|
|
36
36
|
|
|
37
37
|
### 为什么使用这个 GitLab MCP?
|
|
38
38
|
|
|
39
|
-
- **
|
|
39
|
+
- **277 个工具:toolset 中 275 个 + `execute_graphql` + `discover_tools`** — 从小型 toolset 开始,运行时按需激活类别
|
|
40
40
|
- **MR 两步审查** — `list_merge_request_changed_files` → 批量 `get_merge_request_file_diff`
|
|
41
41
|
- **内置 Agent Skill** — `skills/gitlab-mcp/` 工作流指南
|
|
42
42
|
- **认证灵活** — Personal Access Token、本地 OAuth2 浏览器流程、MCP OAuth 代理、按请求远程授权
|
|
@@ -50,7 +50,7 @@ read -rs GITLAB_PERSONAL_ACCESS_TOKEN && export GITLAB_PERSONAL_ACCESS_TOKEN
|
|
|
50
50
|
| | @zereight/mcp-gitlab | GitLab MCP A(社区 CQRS 型) | GitLab 官方 MCP 服务器 |
|
|
51
51
|
| ------------ | -------------------------------------------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
52
|
| **更适合** | AI 代理工作流 | 企业多实例 / 分组工具 | 内置于 GitLab,无需单独安装 |
|
|
53
|
-
| **工具模型** |
|
|
53
|
+
| **工具模型** | 277 个工具:toolset 中 275 个 + `execute_graphql` + `discover_tools` | ~50–60 个 `browse_*` / `manage_*` 分组工具 | 用 HTTP 头选择 toolset |
|
|
54
54
|
| **MR 审查** | 两步批量 diff | 因服务器而异 | `get_merge_request` 带 diffs |
|
|
55
55
|
| **Node.js** | >=18.17 | 通常 >=24 | stdio 经 `mcp-remote`,需要 Node.js 20+ |
|
|
56
56
|
| **许可证** | MIT | 因服务器而异 | GitLab 的一部分 |
|
package/build/index.js
CHANGED
|
@@ -94,7 +94,7 @@ import { listMcpResources, listMcpResourceTemplates, readMcpResource, } from "./
|
|
|
94
94
|
import { getMcpPrompt, listMcpPrompts } from "./server/mcp-prompts.js";
|
|
95
95
|
import { isInitializationRequestBody, isUnauthenticatedDiscoveryRequestBody, readAcceptHeader, readMcpSessionIdHeader, redactSessionIdForLog, } from "./server/request-helpers.js";
|
|
96
96
|
export { readMcpSessionIdHeader } from "./server/request-helpers.js";
|
|
97
|
-
import {
|
|
97
|
+
import { apiUrlUserinfoWarning, commaSplitHint, configuredApiUrlErrors, encodeGitLabPath, encodeGitLabPathSegment, invalidListEntryError, isCleartextRemoteUrl, normalizeGitLabApiUrl, parseConfiguredGitLabApiUrls, } from "./utils/url.js";
|
|
98
98
|
import { estimateMergeCommitCount, filterDiffsByPatterns, openSafeOutputWriteStream, resolveDownloadRoot, readSafeExistingFile, summarizeWebhookEvents, } from "./utils/helpers.js";
|
|
99
99
|
import { graphqlQueryContainsWriteOperation, graphqlQueryContainsDeleteOperation, } from "./utils/graphql-query.js";
|
|
100
100
|
import { resolveNestedWikiUpdateTitle } from "./utils/wiki-title.js";
|
|
@@ -122,7 +122,7 @@ import { createListedToolsCache, decorateToolsForList, } from "./tools/listed-to
|
|
|
122
122
|
import { isExcludedBySlimProfile, shouldApplySlimToolProfile } from "./tools/tool-profile.js";
|
|
123
123
|
import { shouldCompactToolResult } from "./utils/compact-tool-allowlist.js";
|
|
124
124
|
import { BulkPublishDraftNotesSchema, CancelPipelineJobSchema, ErasePipelineJobSchema, CancelPipelineSchema, CreateBranchSchema, CreateDraftNoteSchema, CreateIssueLinkSchema, CreateIssueNoteSchema, CreateIssueSchema, CreateIssueEmojiReactionSchema, CreateIssueNoteEmojiReactionSchema, ListIssueEmojiReactionsSchema, ListIssueNoteEmojiReactionsSchema, CreateLabelSchema, // Added
|
|
125
|
-
CreateMergeRequestNoteSchema, CreateMergeRequestDiscussionNoteSchema, CreateMergeRequestEmojiReactionSchema, CreateMergeRequestNoteEmojiReactionSchema, ListMergeRequestEmojiReactionsSchema, ListMergeRequestNoteEmojiReactionsSchema, CreateMergeRequestSchema, CreateMergeRequestThreadSchema, CreateNoteSchema, CreateCommitStatusSchema, CreateOrUpdateFileSchema, CreatePipelineSchema, CreateProjectMilestoneSchema, CreateGroupMilestoneSchema, CreateRepositorySchema, CreateGroupSchema, CreateWikiPageSchema, CreateGroupWikiPageSchema, DeleteBranchSchema, GetProtectedBranchSchema, ListProtectedBranchesSchema, ProtectBranchSchema, UnprotectBranchSchema, UpdateDefaultBranchSchema, DeleteDraftNoteSchema, DeleteGroupMilestoneSchema, DeleteGroupWikiPageSchema, DeleteIssueLinkSchema, DeleteIssueSchema, DeleteIssueEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, DeleteLabelSchema, DeleteProjectMilestoneSchema, DeleteWikiPageSchema, DeleteMergeRequestNoteSchema, DeleteMergeRequestEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, EditProjectMilestoneSchema, EditGroupMilestoneSchema, ForkRepositorySchema, GetBranchDiffsSchema, GetBranchSchema, GetCommitDiffSchema, GetCommitSchema, GetFileBlameSchema, GitLabBlameEntrySchema, GetDraftNoteSchema, GetFileContentsSchema, GetIssueLinkSchema, GetIssueSchema, GetLabelSchema, GetMergeRequestDiffsSchema, GetMergeRequestSchema, GetMilestoneBurndownEventsSchema, GetMilestoneIssuesSchema, GetMilestoneMergeRequestsSchema, GetGroupMilestoneSchema, GetGroupMilestoneIssuesSchema, GetGroupMilestoneMergeRequestsSchema, GetGroupMilestoneBurndownEventsSchema, GetDeploymentSchema, CreateDeploymentSchema, UpdateDeploymentSchema, DeploymentApprovalSchema, ListDeploymentMergeRequestsSchema, GetEnvironmentSchema, UpdateEnvironmentSchema, StopEnvironmentSchema, StopStaleEnvironmentsSchema, DeleteReviewAppEnvironmentsSchema, PipelineTriggerIdSchema, ListPipelineTriggersSchema, CreatePipelineTriggerSchema, UpdatePipelineTriggerSchema, TriggerPipelineSchema, GetNamespaceSchema, GitLabCiLintResultSchema, GetPipelineJobOutputSchema, PipelineJobControlSchema, GetPipelineSchema, GetPipelineVariablesSchema, UpdatePipelineMetadataSchema, DeletePipelineSchema, PipelineReportSchema, WaitForPipelineSchema, WaitForPipelineJobSchema, PlayPipelineJobsSchema, GetProjectMilestoneSchema, GetProjectSchema, GetRepositoryTreeSchema, GetUsersSchema, GetUserSchema, GitLabUserFullSchema, WhoAmISchema, GitLabCurrentUserSchema, GetWikiPageSchema, GitLabCommitSchema, GitLabCommitStatusSchema, GitLabCompareResultSchema, GitLabContentSchema, GitLabCreateUpdateFileResponseSchema, GitLabDiffSchema,
|
|
125
|
+
CreateMergeRequestNoteSchema, CreateMergeRequestDiscussionNoteSchema, CreateMergeRequestEmojiReactionSchema, CreateMergeRequestNoteEmojiReactionSchema, ListMergeRequestEmojiReactionsSchema, ListMergeRequestNoteEmojiReactionsSchema, CreateMergeRequestSchema, CreateMergeRequestThreadSchema, CreateNoteSchema, CreateCommitStatusSchema, CreateOrUpdateFileSchema, CreatePipelineSchema, CreateProjectMilestoneSchema, CreateGroupMilestoneSchema, CreateRepositorySchema, CreateGroupSchema, CreateWikiPageSchema, CreateGroupWikiPageSchema, DeleteBranchSchema, GetProtectedBranchSchema, ListProtectedBranchesSchema, ProtectBranchSchema, UpdateProtectedBranchSchema, UnprotectBranchSchema, UpdateDefaultBranchSchema, DeleteDraftNoteSchema, DeleteGroupMilestoneSchema, DeleteGroupWikiPageSchema, DeleteIssueLinkSchema, DeleteIssueSchema, DeleteIssueEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, DeleteLabelSchema, DeleteProjectMilestoneSchema, DeleteWikiPageSchema, DeleteMergeRequestNoteSchema, DeleteMergeRequestEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, EditProjectMilestoneSchema, EditGroupMilestoneSchema, ForkRepositorySchema, GetBranchDiffsSchema, GetBranchSchema, GetCommitDiffSchema, GetCommitSchema, GetFileBlameSchema, GitLabBlameEntrySchema, GetDraftNoteSchema, GetFileContentsSchema, GetIssueLinkSchema, GetIssueSchema, GetLabelSchema, GetMergeRequestDiffsSchema, GetMergeRequestSchema, GetMilestoneBurndownEventsSchema, GetMilestoneIssuesSchema, GetMilestoneMergeRequestsSchema, GetGroupMilestoneSchema, GetGroupMilestoneIssuesSchema, GetGroupMilestoneMergeRequestsSchema, GetGroupMilestoneBurndownEventsSchema, GetDeploymentSchema, CreateDeploymentSchema, UpdateDeploymentSchema, DeploymentApprovalSchema, ListDeploymentMergeRequestsSchema, GetEnvironmentSchema, UpdateEnvironmentSchema, StopEnvironmentSchema, StopStaleEnvironmentsSchema, DeleteReviewAppEnvironmentsSchema, PipelineTriggerIdSchema, ListPipelineTriggersSchema, CreatePipelineTriggerSchema, UpdatePipelineTriggerSchema, TriggerPipelineSchema, GetNamespaceSchema, GitLabCiLintResultSchema, GetPipelineJobOutputSchema, PipelineJobControlSchema, GetPipelineSchema, GetPipelineVariablesSchema, UpdatePipelineMetadataSchema, DeletePipelineSchema, PipelineReportSchema, WaitForPipelineSchema, WaitForPipelineJobSchema, PlayPipelineJobsSchema, GetProjectMilestoneSchema, GetProjectSchema, GetRepositoryTreeSchema, GetUsersSchema, GetUserSchema, GitLabUserFullSchema, WhoAmISchema, GitLabCurrentUserSchema, GetWikiPageSchema, GitLabCommitSchema, GitLabCommitStatusSchema, GitLabCompareResultSchema, GitLabContentSchema, GitLabCreateUpdateFileResponseSchema, GitLabDiffSchema,
|
|
126
126
|
// Discussion Schemas
|
|
127
127
|
GitLabDiscussionNoteSchema, // Added
|
|
128
128
|
GitLabDiscussionSchema,
|
|
@@ -11332,6 +11332,54 @@ async function handleToolCall(params) {
|
|
|
11332
11332
|
content: [{ type: "text", text: JSON.stringify(data) }],
|
|
11333
11333
|
};
|
|
11334
11334
|
}
|
|
11335
|
+
case "update_protected_branch": {
|
|
11336
|
+
const args = UpdateProtectedBranchSchema.parse(params.arguments);
|
|
11337
|
+
const projectId = decodeURIComponent(args.project_id);
|
|
11338
|
+
const effectiveProjectId = getEffectiveProjectId(projectId);
|
|
11339
|
+
const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(effectiveProjectId)}/protected_branches/${encodeGitLabPathSegment(args.branch_name)}`);
|
|
11340
|
+
const body = {};
|
|
11341
|
+
if (args.allow_force_push !== undefined)
|
|
11342
|
+
body.allow_force_push = args.allow_force_push;
|
|
11343
|
+
if (args.code_owner_approval_required !== undefined)
|
|
11344
|
+
body.code_owner_approval_required = args.code_owner_approval_required;
|
|
11345
|
+
if (args.allowed_to_push?.length)
|
|
11346
|
+
body.allowed_to_push = args.allowed_to_push;
|
|
11347
|
+
if (args.allowed_to_merge?.length)
|
|
11348
|
+
body.allowed_to_merge = args.allowed_to_merge;
|
|
11349
|
+
if (args.allowed_to_unprotect?.length)
|
|
11350
|
+
body.allowed_to_unprotect = args.allowed_to_unprotect;
|
|
11351
|
+
// GitLab docs: keep at least one unprotect grant, or the rule can no longer be
|
|
11352
|
+
// changed or removed. Only requests that destroy an unprotect record pay for this GET.
|
|
11353
|
+
// Best-effort preflight: PATCH has no conditional update, so a change made to the
|
|
11354
|
+
// rule between this GET and the PATCH is not detected.
|
|
11355
|
+
if (args.allowed_to_unprotect?.some(entry => entry._destroy === true)) {
|
|
11356
|
+
const destroyedIds = new Set(args.allowed_to_unprotect
|
|
11357
|
+
.filter(entry => entry._destroy === true)
|
|
11358
|
+
.map(entry => entry.id));
|
|
11359
|
+
const currentResponse = await fetch(url.toString(), {
|
|
11360
|
+
...getFetchConfig(),
|
|
11361
|
+
});
|
|
11362
|
+
await handleGitLabError(currentResponse);
|
|
11363
|
+
const current = GitLabProtectedBranchSchema.parse(await currentResponse.json());
|
|
11364
|
+
// Records without an id cannot be destroyed by id, so they stay.
|
|
11365
|
+
const kept = (current.unprotect_access_levels ?? []).filter(record => record.id === undefined || !destroyedIds.has(record.id)).length;
|
|
11366
|
+
// Entries with an id change an existing record; only entries without one add a grant.
|
|
11367
|
+
const added = args.allowed_to_unprotect.filter(entry => entry._destroy !== true && entry.id === undefined).length;
|
|
11368
|
+
if (kept + added === 0) {
|
|
11369
|
+
throw new ToolInputError(`Refusing to update protected branch '${args.branch_name}': this request would remove every allowed_to_unprotect record, and GitLab advises keeping at least one so the rule can still be changed or removed. Keep one existing record or add a replacement entry in the same request.`);
|
|
11370
|
+
}
|
|
11371
|
+
}
|
|
11372
|
+
const response = await fetch(url.toString(), {
|
|
11373
|
+
...getFetchConfig(),
|
|
11374
|
+
method: "PATCH",
|
|
11375
|
+
body: JSON.stringify(body),
|
|
11376
|
+
});
|
|
11377
|
+
await handleGitLabError(response);
|
|
11378
|
+
const data = GitLabProtectedBranchSchema.parse(await response.json());
|
|
11379
|
+
return {
|
|
11380
|
+
content: [{ type: "text", text: JSON.stringify(data) }],
|
|
11381
|
+
};
|
|
11382
|
+
}
|
|
11335
11383
|
case "unprotect_branch": {
|
|
11336
11384
|
const args = UnprotectBranchSchema.parse(params.arguments);
|
|
11337
11385
|
const projectId = decodeURIComponent(args.project_id);
|
|
@@ -12976,8 +13024,9 @@ function initOAuthClient() {
|
|
|
12976
13024
|
}
|
|
12977
13025
|
if (isCleartextRemoteUrl(GITLAB_API_URL)) {
|
|
12978
13026
|
throw new Error(
|
|
12979
|
-
// The host name only
|
|
12980
|
-
|
|
13027
|
+
// The host name only, from the list GITLAB_API_URL is the first of: a port, or a
|
|
13028
|
+
// whole URL split off by a comma, can be part of a password (see parseConfiguredGitLabApiUrls).
|
|
13029
|
+
`Refusing to send OAuth tokens over cleartext HTTP to http://${CONFIGURED_GITLAB_API_URLS.hostnamesForLog[0]}. ` +
|
|
12981
13030
|
"Use an https:// GITLAB_API_URL (http:// is only allowed for localhost).");
|
|
12982
13031
|
}
|
|
12983
13032
|
oauthClient = createGitLabOAuthClient(GITLAB_API_URL.replace(/\/api\/v4$/, ""));
|
|
@@ -13017,9 +13066,11 @@ async function runServer() {
|
|
|
13017
13066
|
}
|
|
13018
13067
|
});
|
|
13019
13068
|
}
|
|
13020
|
-
// Host names only
|
|
13021
|
-
|
|
13022
|
-
|
|
13069
|
+
// Host names only, decided for the whole list (see parseConfiguredGitLabApiUrls).
|
|
13070
|
+
// GITLAB_API_URL is GITLAB_API_URLS[0], so it is logged the same way.
|
|
13071
|
+
const hostnames = CONFIGURED_GITLAB_API_URLS.hostnamesForLog;
|
|
13072
|
+
logger.info(`Configured GitLab API URLs: ${hostnames.join(", ")}`);
|
|
13073
|
+
logger.info(`Default GitLab API URL: ${hostnames[0]}`);
|
|
13023
13074
|
if (GITLAB_OAUTH_ALLOWED_GROUPS) {
|
|
13024
13075
|
logger.info(`Group access control enabled for: ${GITLAB_OAUTH_ALLOWED_GROUPS.join(", ")}`);
|
|
13025
13076
|
}
|
package/build/schemas.js
CHANGED
|
@@ -2102,6 +2102,87 @@ export const ProtectBranchSchema = z.preprocess(input => {
|
|
|
2102
2102
|
allow_force_push: stringBoolean.describe("Allow force push to the protected branch. Default: false"),
|
|
2103
2103
|
code_owner_approval_required: stringBoolean.describe("Require code owner approval before merging (PREMIUM). Default: false"),
|
|
2104
2104
|
}));
|
|
2105
|
+
// null → undefined, so entries copied from get_protected_branch (user_id: null, ...) still parse.
|
|
2106
|
+
const optionalProtectedBranchRecordId = z.preprocess(val => (val == null ? undefined : val), z.coerce.number().int().positive().optional());
|
|
2107
|
+
// One allowed_to_push / allowed_to_merge / allowed_to_unprotect entry for PATCH.
|
|
2108
|
+
// Add: one of access_level, user_id, group_id, deploy_key_id (push only).
|
|
2109
|
+
// Change an existing record: its id plus the new value. Remove: { id, _destroy: true }.
|
|
2110
|
+
// member_role_id (Ultimate custom roles) is not supported: z.object drops it, so an entry
|
|
2111
|
+
// with only member_role_id fails with "Set one of ...".
|
|
2112
|
+
const protectedBranchAccessEntry = z.object({
|
|
2113
|
+
id: optionalProtectedBranchRecordId.describe("ID of an existing access level record (from get_protected_branch). Required with _destroy; with a new value it changes that record in place."),
|
|
2114
|
+
access_level: z
|
|
2115
|
+
.preprocess(val => (val == null ? undefined : val), protectedBranchAccessLevel.optional())
|
|
2116
|
+
.describe("Role access level (0=No access, 30=Developer, 40=Maintainer, 60=Admin)"),
|
|
2117
|
+
user_id: optionalProtectedBranchRecordId.describe("ID of a user to grant access"),
|
|
2118
|
+
group_id: optionalProtectedBranchRecordId.describe("ID of a group to grant access"),
|
|
2119
|
+
deploy_key_id: optionalProtectedBranchRecordId.describe("ID of a deploy key to grant push access (allowed_to_push only)"),
|
|
2120
|
+
_destroy: stringBoolean.describe("Set true with id to remove that access level record"),
|
|
2121
|
+
});
|
|
2122
|
+
const PROTECTED_BRANCH_ACCESS_FIELDS = [
|
|
2123
|
+
"allowed_to_push",
|
|
2124
|
+
"allowed_to_merge",
|
|
2125
|
+
"allowed_to_unprotect",
|
|
2126
|
+
];
|
|
2127
|
+
export const UpdateProtectedBranchSchema = ProjectParamsSchema.extend({
|
|
2128
|
+
branch_name: z.string().describe("Name or wildcard pattern of the existing protected branch"),
|
|
2129
|
+
allow_force_push: stringBoolean.describe("Allow users who can push to the branch to force push"),
|
|
2130
|
+
code_owner_approval_required: stringBoolean.describe("Require code owner approval before merging. GitLab documents this as Premium/Ultimate"),
|
|
2131
|
+
allowed_to_push: z
|
|
2132
|
+
.array(protectedBranchAccessEntry)
|
|
2133
|
+
.optional()
|
|
2134
|
+
.describe("Push access entries to add, change, or remove. GitLab documents access_level, user_id, and group_id entries as Premium/Ultimate, and deploy_key_id entries as Free from 18.10"),
|
|
2135
|
+
allowed_to_merge: z
|
|
2136
|
+
.array(protectedBranchAccessEntry)
|
|
2137
|
+
.optional()
|
|
2138
|
+
.describe("Merge access entries to add, change, or remove. GitLab documents access_level, user_id, and group_id entries as Premium/Ultimate"),
|
|
2139
|
+
allowed_to_unprotect: z
|
|
2140
|
+
.array(protectedBranchAccessEntry)
|
|
2141
|
+
.optional()
|
|
2142
|
+
.describe("Unprotect access entries to add, change, or remove; 0 is not allowed. GitLab documents access_level, user_id, and group_id entries as Premium/Ultimate"),
|
|
2143
|
+
})
|
|
2144
|
+
.refine(args => args.allow_force_push !== undefined ||
|
|
2145
|
+
args.code_owner_approval_required !== undefined ||
|
|
2146
|
+
PROTECTED_BRANCH_ACCESS_FIELDS.some(field => (args[field]?.length ?? 0) > 0), { message: "Provide at least one protected branch setting to update" })
|
|
2147
|
+
.superRefine((args, ctx) => {
|
|
2148
|
+
for (const field of PROTECTED_BRANCH_ACCESS_FIELDS) {
|
|
2149
|
+
args[field]?.forEach((entry, index) => {
|
|
2150
|
+
const path = [field, index];
|
|
2151
|
+
const targets = ["access_level", "user_id", "group_id", "deploy_key_id"].filter(key => entry[key] !== undefined);
|
|
2152
|
+
if (entry._destroy === true && entry.id === undefined) {
|
|
2153
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path, message: "_destroy requires id" });
|
|
2154
|
+
}
|
|
2155
|
+
if (entry._destroy !== true && targets.length === 0) {
|
|
2156
|
+
ctx.addIssue({
|
|
2157
|
+
code: z.ZodIssueCode.custom,
|
|
2158
|
+
path,
|
|
2159
|
+
message: "Set one of access_level, user_id, group_id, deploy_key_id, or id with _destroy: true",
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
if (targets.length > 1) {
|
|
2163
|
+
ctx.addIssue({
|
|
2164
|
+
code: z.ZodIssueCode.custom,
|
|
2165
|
+
path,
|
|
2166
|
+
message: `Set only one of access_level, user_id, group_id, deploy_key_id (got ${targets.join(", ")})`,
|
|
2167
|
+
});
|
|
2168
|
+
}
|
|
2169
|
+
if (entry.deploy_key_id !== undefined && field !== "allowed_to_push") {
|
|
2170
|
+
ctx.addIssue({
|
|
2171
|
+
code: z.ZodIssueCode.custom,
|
|
2172
|
+
path,
|
|
2173
|
+
message: "deploy_key_id is only valid in allowed_to_push",
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
if (entry.access_level === 0 && field === "allowed_to_unprotect") {
|
|
2177
|
+
ctx.addIssue({
|
|
2178
|
+
code: z.ZodIssueCode.custom,
|
|
2179
|
+
path,
|
|
2180
|
+
message: "access_level 0 (No access) is not valid for allowed_to_unprotect",
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
});
|
|
2184
|
+
}
|
|
2185
|
+
});
|
|
2105
2186
|
export const UnprotectBranchSchema = ProjectParamsSchema.extend({
|
|
2106
2187
|
branch_name: z.string().describe("Name of the protected branch to unprotect"),
|
|
2107
2188
|
});
|
|
@@ -2110,8 +2191,12 @@ export const UpdateDefaultBranchSchema = ProjectParamsSchema.extend({
|
|
|
2110
2191
|
default_branch: z.string().describe("The new default branch name for the project"),
|
|
2111
2192
|
});
|
|
2112
2193
|
export const GitLabProtectedBranchAccessLevelSchema = z.object({
|
|
2194
|
+
// member_role_id (Ultimate custom roles) is not kept, and update_protected_branch does not accept it.
|
|
2195
|
+
// Record id: update_protected_branch takes it to change or remove this entry
|
|
2196
|
+
id: z.number().optional(),
|
|
2113
2197
|
access_level: z.number().nullable().optional(),
|
|
2114
2198
|
access_level_description: z.string().optional(),
|
|
2199
|
+
deploy_key_id: z.number().nullable().optional(),
|
|
2115
2200
|
// GitLab returns null for role-based access levels (not user-/group-specific)
|
|
2116
2201
|
user_id: z.number().nullable().optional(),
|
|
2117
2202
|
group_id: z.number().nullable().optional(),
|
package/build/tools/registry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toJSONSchema } from "../utils/schema.js";
|
|
2
2
|
import { USE_GITLAB_WIKI, USE_MILESTONE, USE_PIPELINE, SSE, STREAMABLE_HTTP } from "../config.js";
|
|
3
3
|
import { getToolDescription } from "./tool-descriptions.js";
|
|
4
|
-
import { ApproveMergeRequestSchema, BulkPublishDraftNotesSchema, CancelPipelineJobSchema, ErasePipelineJobSchema, CancelPipelineSchema, ConvertWorkItemTypeSchema, CreateBranchSchema, CreateDraftNoteSchema, CreateGroupSchema, CreateGroupWikiPageSchema, CreateIssueLinkSchema, CreateIssueNoteSchema, CreateIssueSchema, CreateIssueEmojiReactionSchema, CreateIssueNoteEmojiReactionSchema, ListIssueEmojiReactionsSchema, ListIssueNoteEmojiReactionsSchema, CreateLabelSchema, MarkAllTodosDoneSchema, ListTodosSchema, MarkTodoDoneSchema, CreateMergeRequestDiscussionNoteSchema, CreateMergeRequestEmojiReactionSchema, ListMergeRequestEmojiReactionsSchema, ListMergeRequestNoteEmojiReactionsSchema, CreateMergeRequestNoteSchema, CreateMergeRequestNoteEmojiReactionSchema, CreateMergeRequestSchema, CreateMergeRequestThreadSchema, CreateNoteSchema, CreateCommitStatusSchema, CreateOrUpdateFileSchema, CreatePipelineSchema, CreateProjectMilestoneSchema, CreateGroupMilestoneSchema, CreateReleaseEvidenceSchema, CreateReleaseSchema, CreateRepositorySchema, CreateTagSchema, CreateTimelineEventSchema, CreateWebhookSchema, CreateWikiPageSchema, CreateWorkItemNoteSchema, CreateWorkItemEmojiReactionSchema, CreateWorkItemNoteEmojiReactionSchema, ListWorkItemEmojiReactionsSchema, ListWorkItemNoteEmojiReactionsSchema, CreateWorkItemSchema, DeleteBranchSchema, GetProtectedBranchSchema, ListProtectedBranchesSchema, ProtectBranchSchema, ProtectTagSchema, UnprotectBranchSchema, UnprotectTagSchema, UpdateDefaultBranchSchema, DeleteDraftNoteSchema, DeleteGroupMilestoneSchema, DeleteGroupWikiPageSchema, DeleteIssueLinkSchema, DeleteIssueSchema, DeleteIssueEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, DeleteLabelSchema, DeleteMergeRequestDiscussionNoteSchema, DeleteMergeRequestNoteSchema, DeleteMergeRequestEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, DeleteProjectMilestoneSchema, DeleteReleaseSchema, DeleteTagSchema, DeleteWebhookSchema, DeleteWikiPageSchema, DeleteWorkItemEmojiReactionSchema, DeleteWorkItemNoteEmojiReactionSchema, DownloadAttachmentSchema, DownloadAttachmentRemoteSchema, DownloadJobArtifactsSchema, DownloadJobArtifactsRemoteSchema, DownloadReleaseAssetSchema, EditProjectMilestoneSchema, EditGroupMilestoneSchema, ExecuteGraphQLSchema, ForkRepositorySchema, HealthCheckSchema, GetBranchSchema, GetBranchDiffsSchema, GetCommitDiffSchema, GetCommitSchema, GetFileBlameSchema, GetDeploymentSchema, CreateDeploymentSchema, UpdateDeploymentSchema, DeploymentApprovalSchema, ListDeploymentMergeRequestsSchema, GetDraftNoteSchema, GetEnvironmentSchema, UpdateEnvironmentSchema, StopEnvironmentSchema, StopStaleEnvironmentsSchema, DeleteReviewAppEnvironmentsSchema, PipelineTriggerIdSchema, ListPipelineTriggersSchema, CreatePipelineTriggerSchema, UpdatePipelineTriggerSchema, TriggerPipelineSchema, GetFileContentsSchema, GetGroupWikiPageSchema, GetIssueLinkSchema, GetIssueSchema, GetJobArtifactFileSchema, GetLabelSchema, GetMergeRequestApprovalStateSchema, GetMergeRequestConflictsSchema, GetMergeRequestDiffsSchema, GetMergeRequestFileDiffSchema, GetMergeRequestDiscussionSchema, GetMergeRequestNoteSchema, GetMergeRequestNotesSchema, GetMergeRequestSchema, GetMergeRequestVersionSchema, GetMilestoneBurndownEventsSchema, GetMilestoneIssuesSchema, GetMilestoneMergeRequestsSchema, GetGroupMilestoneSchema, GetGroupMilestoneIssuesSchema, GetGroupMilestoneMergeRequestsSchema, GetGroupMilestoneBurndownEventsSchema, GetNamespaceSchema, GetPipelineJobOutputSchema, PipelineJobControlSchema, GetPipelineSchema, GetRunnerSchema, GetPipelineVariablesSchema, UpdatePipelineMetadataSchema, DeletePipelineSchema, PipelineReportSchema, WaitForPipelineSchema, WaitForPipelineJobSchema, PlayPipelineJobsSchema, GetProjectEventsSchema, GetProjectMilestoneSchema, GetProjectSchema, GetReleaseSchema, GetRepositoryTreeSchema, GetTagSchema, GetTagSignatureSchema, GetProtectedTagSchema, GetTimelineEventsSchema, GetUsersSchema, GetUserSchema, WhoAmISchema, GetWebhookEventSchema, GetWikiPageSchema, GetWorkItemSchema, ListBranchesSchema, ListCommitsSchema, ListCommitStatusesSchema, ListCustomFieldDefinitionsSchema, ListDeploymentsSchema, ListDraftNotesSchema, ListEnvironmentsSchema, ListEventsSchema, ListGroupIterationsSchema, ListGroupMilestonesSchema, ListGroupProjectsSchema, ListGroupWikiPagesSchema, ListIssueDiscussionsSchema, ListIssueLinksSchema, ListIssuesSchema, ListJobArtifactsSchema, ListLabelsSchema, ListMergeRequestChangedFilesSchema, ListMergeRequestDiffsSchema, ListMergeRequestDiscussionsSchema, ListMergeRequestPipelinesSchema, ListMergeRequestVersionsSchema, ListMergeRequestsSchema, ListGroupMergeRequestsSchema, ListNamespacesSchema, ListPipelineJobsSchema, ListPipelineTriggerJobsSchema, ValidateCiLintSchema, ValidateProjectCiLintSchema, ListCiCatalogResourcesSchema, GetCiCatalogResourceSchema, ListPipelinesSchema, ListPipelineSchedulesSchema, GetPipelineScheduleSchema, ListPipelineSchedulePipelinesSchema, CreatePipelineScheduleSchema, UpdatePipelineScheduleSchema, DeletePipelineScheduleSchema, PlayPipelineScheduleSchema, TakeOwnershipPipelineScheduleSchema, GetPipelineScheduleVariableSchema, CreatePipelineScheduleVariableSchema, UpdatePipelineScheduleVariableSchema, DeletePipelineScheduleVariableSchema, ListGroupMembersSchema, ListProjectMembersSchema, ListProjectMilestonesSchema, ListProjectsSchema, ListProjectRunnersSchema, ListReleasesSchema, ListTagsSchema, ListProtectedTagsSchema, ListWebhookEventsSchema, ListWebhooksSchema, ListWikiPagesSchema, ListWorkItemNotesSchema, ListWorkItemStatusesSchema, ListWorkItemsSchema, MarkdownUploadSchema, MarkdownUploadRemoteSchema, MergeMergeRequestSchema, MoveWorkItemSchema, MyIssuesSchema, OrbitQuerySchema, OrbitSchemaSchema, OrbitStatusSchema, OrbitToolsSchema, PlayPipelineJobSchema, PromoteProjectMilestoneSchema, PublishDraftNoteSchema, PushFilesSchema, ResolveMergeRequestThreadSchema, RetryPipelineJobSchema, RetryPipelineSchema, SearchCodeSchema, SearchGroupCodeSchema, SearchProjectCodeSchema, SearchRepositoriesSchema, ListSnippetsSchema, GetSnippetSchema, CreateSnippetSchema, UpdateSnippetSchema, DeleteSnippetSchema, UnapproveMergeRequestSchema, RebaseMergeRequestSchema, UpdateDraftNoteSchema, UpdateGroupWikiPageSchema, UpdateIssueNoteSchema, UpdateIssueSchema, UpdateIssueDescriptionPatchSchema, UpdateLabelSchema, UpdateProjectSchema, UpdateMergeRequestDiscussionNoteSchema, UpdateMergeRequestNoteSchema, UpdateMergeRequestSchema, UpdateReleaseSchema, UpdateWebhookSchema, UpdateWikiPageSchema, UpdateWorkItemSchema, VerifyNamespaceSchema, ListProjectVariablesSchema, GetProjectVariableSchema, CreateProjectVariableSchema, UpdateProjectVariableSchema, DeleteProjectVariableSchema, ListGroupVariablesSchema, GetGroupVariableSchema, CreateGroupVariableSchema, UpdateGroupVariableSchema, DeleteGroupVariableSchema, GetDependencyProxySettingsSchema, UpdateDependencyProxySettingsSchema, ListDependencyProxyBlobsSchema, PurgeDependencyProxyCacheSchema, ListProjectVulnerabilitiesSchema, GetVulnerabilitySchema, DismissVulnerabilitySchema, ConfirmVulnerabilitySchema, } from "../schemas.js";
|
|
4
|
+
import { ApproveMergeRequestSchema, BulkPublishDraftNotesSchema, CancelPipelineJobSchema, ErasePipelineJobSchema, CancelPipelineSchema, ConvertWorkItemTypeSchema, CreateBranchSchema, CreateDraftNoteSchema, CreateGroupSchema, CreateGroupWikiPageSchema, CreateIssueLinkSchema, CreateIssueNoteSchema, CreateIssueSchema, CreateIssueEmojiReactionSchema, CreateIssueNoteEmojiReactionSchema, ListIssueEmojiReactionsSchema, ListIssueNoteEmojiReactionsSchema, CreateLabelSchema, MarkAllTodosDoneSchema, ListTodosSchema, MarkTodoDoneSchema, CreateMergeRequestDiscussionNoteSchema, CreateMergeRequestEmojiReactionSchema, ListMergeRequestEmojiReactionsSchema, ListMergeRequestNoteEmojiReactionsSchema, CreateMergeRequestNoteSchema, CreateMergeRequestNoteEmojiReactionSchema, CreateMergeRequestSchema, CreateMergeRequestThreadSchema, CreateNoteSchema, CreateCommitStatusSchema, CreateOrUpdateFileSchema, CreatePipelineSchema, CreateProjectMilestoneSchema, CreateGroupMilestoneSchema, CreateReleaseEvidenceSchema, CreateReleaseSchema, CreateRepositorySchema, CreateTagSchema, CreateTimelineEventSchema, CreateWebhookSchema, CreateWikiPageSchema, CreateWorkItemNoteSchema, CreateWorkItemEmojiReactionSchema, CreateWorkItemNoteEmojiReactionSchema, ListWorkItemEmojiReactionsSchema, ListWorkItemNoteEmojiReactionsSchema, CreateWorkItemSchema, DeleteBranchSchema, GetProtectedBranchSchema, ListProtectedBranchesSchema, ProtectBranchSchema, UpdateProtectedBranchSchema, ProtectTagSchema, UnprotectBranchSchema, UnprotectTagSchema, UpdateDefaultBranchSchema, DeleteDraftNoteSchema, DeleteGroupMilestoneSchema, DeleteGroupWikiPageSchema, DeleteIssueLinkSchema, DeleteIssueSchema, DeleteIssueEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, DeleteLabelSchema, DeleteMergeRequestDiscussionNoteSchema, DeleteMergeRequestNoteSchema, DeleteMergeRequestEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, DeleteProjectMilestoneSchema, DeleteReleaseSchema, DeleteTagSchema, DeleteWebhookSchema, DeleteWikiPageSchema, DeleteWorkItemEmojiReactionSchema, DeleteWorkItemNoteEmojiReactionSchema, DownloadAttachmentSchema, DownloadAttachmentRemoteSchema, DownloadJobArtifactsSchema, DownloadJobArtifactsRemoteSchema, DownloadReleaseAssetSchema, EditProjectMilestoneSchema, EditGroupMilestoneSchema, ExecuteGraphQLSchema, ForkRepositorySchema, HealthCheckSchema, GetBranchSchema, GetBranchDiffsSchema, GetCommitDiffSchema, GetCommitSchema, GetFileBlameSchema, GetDeploymentSchema, CreateDeploymentSchema, UpdateDeploymentSchema, DeploymentApprovalSchema, ListDeploymentMergeRequestsSchema, GetDraftNoteSchema, GetEnvironmentSchema, UpdateEnvironmentSchema, StopEnvironmentSchema, StopStaleEnvironmentsSchema, DeleteReviewAppEnvironmentsSchema, PipelineTriggerIdSchema, ListPipelineTriggersSchema, CreatePipelineTriggerSchema, UpdatePipelineTriggerSchema, TriggerPipelineSchema, GetFileContentsSchema, GetGroupWikiPageSchema, GetIssueLinkSchema, GetIssueSchema, GetJobArtifactFileSchema, GetLabelSchema, GetMergeRequestApprovalStateSchema, GetMergeRequestConflictsSchema, GetMergeRequestDiffsSchema, GetMergeRequestFileDiffSchema, GetMergeRequestDiscussionSchema, GetMergeRequestNoteSchema, GetMergeRequestNotesSchema, GetMergeRequestSchema, GetMergeRequestVersionSchema, GetMilestoneBurndownEventsSchema, GetMilestoneIssuesSchema, GetMilestoneMergeRequestsSchema, GetGroupMilestoneSchema, GetGroupMilestoneIssuesSchema, GetGroupMilestoneMergeRequestsSchema, GetGroupMilestoneBurndownEventsSchema, GetNamespaceSchema, GetPipelineJobOutputSchema, PipelineJobControlSchema, GetPipelineSchema, GetRunnerSchema, GetPipelineVariablesSchema, UpdatePipelineMetadataSchema, DeletePipelineSchema, PipelineReportSchema, WaitForPipelineSchema, WaitForPipelineJobSchema, PlayPipelineJobsSchema, GetProjectEventsSchema, GetProjectMilestoneSchema, GetProjectSchema, GetReleaseSchema, GetRepositoryTreeSchema, GetTagSchema, GetTagSignatureSchema, GetProtectedTagSchema, GetTimelineEventsSchema, GetUsersSchema, GetUserSchema, WhoAmISchema, GetWebhookEventSchema, GetWikiPageSchema, GetWorkItemSchema, ListBranchesSchema, ListCommitsSchema, ListCommitStatusesSchema, ListCustomFieldDefinitionsSchema, ListDeploymentsSchema, ListDraftNotesSchema, ListEnvironmentsSchema, ListEventsSchema, ListGroupIterationsSchema, ListGroupMilestonesSchema, ListGroupProjectsSchema, ListGroupWikiPagesSchema, ListIssueDiscussionsSchema, ListIssueLinksSchema, ListIssuesSchema, ListJobArtifactsSchema, ListLabelsSchema, ListMergeRequestChangedFilesSchema, ListMergeRequestDiffsSchema, ListMergeRequestDiscussionsSchema, ListMergeRequestPipelinesSchema, ListMergeRequestVersionsSchema, ListMergeRequestsSchema, ListGroupMergeRequestsSchema, ListNamespacesSchema, ListPipelineJobsSchema, ListPipelineTriggerJobsSchema, ValidateCiLintSchema, ValidateProjectCiLintSchema, ListCiCatalogResourcesSchema, GetCiCatalogResourceSchema, ListPipelinesSchema, ListPipelineSchedulesSchema, GetPipelineScheduleSchema, ListPipelineSchedulePipelinesSchema, CreatePipelineScheduleSchema, UpdatePipelineScheduleSchema, DeletePipelineScheduleSchema, PlayPipelineScheduleSchema, TakeOwnershipPipelineScheduleSchema, GetPipelineScheduleVariableSchema, CreatePipelineScheduleVariableSchema, UpdatePipelineScheduleVariableSchema, DeletePipelineScheduleVariableSchema, ListGroupMembersSchema, ListProjectMembersSchema, ListProjectMilestonesSchema, ListProjectsSchema, ListProjectRunnersSchema, ListReleasesSchema, ListTagsSchema, ListProtectedTagsSchema, ListWebhookEventsSchema, ListWebhooksSchema, ListWikiPagesSchema, ListWorkItemNotesSchema, ListWorkItemStatusesSchema, ListWorkItemsSchema, MarkdownUploadSchema, MarkdownUploadRemoteSchema, MergeMergeRequestSchema, MoveWorkItemSchema, MyIssuesSchema, OrbitQuerySchema, OrbitSchemaSchema, OrbitStatusSchema, OrbitToolsSchema, PlayPipelineJobSchema, PromoteProjectMilestoneSchema, PublishDraftNoteSchema, PushFilesSchema, ResolveMergeRequestThreadSchema, RetryPipelineJobSchema, RetryPipelineSchema, SearchCodeSchema, SearchGroupCodeSchema, SearchProjectCodeSchema, SearchRepositoriesSchema, ListSnippetsSchema, GetSnippetSchema, CreateSnippetSchema, UpdateSnippetSchema, DeleteSnippetSchema, UnapproveMergeRequestSchema, RebaseMergeRequestSchema, UpdateDraftNoteSchema, UpdateGroupWikiPageSchema, UpdateIssueNoteSchema, UpdateIssueSchema, UpdateIssueDescriptionPatchSchema, UpdateLabelSchema, UpdateProjectSchema, UpdateMergeRequestDiscussionNoteSchema, UpdateMergeRequestNoteSchema, UpdateMergeRequestSchema, UpdateReleaseSchema, UpdateWebhookSchema, UpdateWikiPageSchema, UpdateWorkItemSchema, VerifyNamespaceSchema, ListProjectVariablesSchema, GetProjectVariableSchema, CreateProjectVariableSchema, UpdateProjectVariableSchema, DeleteProjectVariableSchema, ListGroupVariablesSchema, GetGroupVariableSchema, CreateGroupVariableSchema, UpdateGroupVariableSchema, DeleteGroupVariableSchema, GetDependencyProxySettingsSchema, UpdateDependencyProxySettingsSchema, ListDependencyProxyBlobsSchema, PurgeDependencyProxyCacheSchema, ListProjectVulnerabilitiesSchema, GetVulnerabilitySchema, DismissVulnerabilitySchema, ConfirmVulnerabilitySchema, } from "../schemas.js";
|
|
5
5
|
import { GitLabApiRequestSchema } from "./gitlab-api-request.js";
|
|
6
6
|
const IS_REMOTE = SSE || STREAMABLE_HTTP;
|
|
7
7
|
// Define all available tools
|
|
@@ -121,6 +121,11 @@ export const allTools = [
|
|
|
121
121
|
description: "Protect a repository branch (set push/merge/unprotect access levels)",
|
|
122
122
|
inputSchema: toJSONSchema(ProtectBranchSchema),
|
|
123
123
|
},
|
|
124
|
+
{
|
|
125
|
+
name: "update_protected_branch",
|
|
126
|
+
description: "Update an existing protected branch rule in place (access levels, force push, code owner approval)",
|
|
127
|
+
inputSchema: toJSONSchema(UpdateProtectedBranchSchema),
|
|
128
|
+
},
|
|
124
129
|
{
|
|
125
130
|
name: "unprotect_branch",
|
|
126
131
|
description: "Remove protection from a previously protected branch",
|
|
@@ -1621,6 +1626,9 @@ export const destructiveTools = new Set([
|
|
|
1621
1626
|
"delete_branch",
|
|
1622
1627
|
"unprotect_branch",
|
|
1623
1628
|
"protect_branch",
|
|
1629
|
+
// Can loosen protection (force push, wider access). Not in deleteTools: the rule stays,
|
|
1630
|
+
// and modify mode needs an in-place update because unprotect_branch is blocked there.
|
|
1631
|
+
"update_protected_branch",
|
|
1624
1632
|
"unprotect_tag",
|
|
1625
1633
|
"protect_tag",
|
|
1626
1634
|
"update_default_branch",
|
|
@@ -1930,6 +1938,7 @@ export const TOOLSET_DEFINITIONS = [
|
|
|
1930
1938
|
"list_protected_branches",
|
|
1931
1939
|
"get_protected_branch",
|
|
1932
1940
|
"protect_branch",
|
|
1941
|
+
"update_protected_branch",
|
|
1933
1942
|
"unprotect_branch",
|
|
1934
1943
|
"update_default_branch",
|
|
1935
1944
|
"list_commits",
|
|
@@ -16,8 +16,9 @@ const TOOL_GUIDANCE = {
|
|
|
16
16
|
fork_repository: "Use this to create a copy of an existing project in the current user's namespace or a permitted namespace; use `search_repositories` or `get_project` to inspect projects without copying them. The operation creates a new project, requires fork permission, and returns the forked project or a namespace/permission error.",
|
|
17
17
|
create_branch: "Use this to create a branch from a branch, tag, or commit; use `get_branch` or `list_branches` to inspect branches and `protect_branch` to configure protection afterward. The operation changes remote repository state, requires branch-creation permission, and returns the new branch or a validation, missing-ref, protected-project, or already-exists error. `project_id` accepts a numeric ID or URL-encoded path, `branch` is the new name, and `ref` selects its starting revision.",
|
|
18
18
|
delete_branch: "Use this only after confirming the branch name and intended data loss; use `get_branch` or `list_branches` before deletion and never use it to remove branch protection. The operation permanently removes a remote branch, requires branch-delete permission, and returns the deletion result or a protected-branch, missing-resource, or permission error.",
|
|
19
|
-
protect_branch: "Use this to create
|
|
20
|
-
|
|
19
|
+
protect_branch: "Use this to create a protection rule for a branch or wildcard that has none; it does not update an existing rule (GitLab returns 409 Conflict), so use `get_protected_branch` to check first and `update_protected_branch` to change a rule. The operation changes who may push, merge, or unprotect, may enable force-push or code-owner settings, requires maintainer-level permission, and returns the protection rule or a validation/permission/conflict error.",
|
|
20
|
+
update_protected_branch: "Use this to change an existing protection rule for a branch or wildcard in place, so the branch is never left unprotected; use `protect_branch` to create a rule and `get_protected_branch` to read the access level record `id`s first. In `allowed_to_push`, `allowed_to_merge`, and `allowed_to_unprotect`, add an entry with one of `access_level`, `user_id`, `group_id`, or `deploy_key_id` (push only); change a record with its `id` and the new value; remove one with `{id, _destroy: true}`. `member_role_id` (custom roles) is not supported; an entry with only that key is rejected. For example, `allowed_to_push: [{id: 12, access_level: 0}]` sets that push record to No access. GitLab documents `access_level`, `user_id`, and `group_id` entries and `code_owner_approval_required` as Premium/Ultimate, and `deploy_key_id` push entries as Free from 18.10; check the returned rule to see what was applied. A request whose `_destroy` entries would leave `allowed_to_unprotect` with no records is refused before the update (a best-effort check; concurrent changes between the read and the update are not detected); keep one or add a replacement in the same request. GitLab may reject the update when the caller is not allowed by the rule's current `allowed_to_unprotect` settings, even as a Maintainer; check current unprotect access with `get_protected_branch` first, especially before replacing an unprotect record. The operation changes repository security controls, requires maintainer-level permission, and returns the updated rule or a validation, missing-rule, or permission error.",
|
|
21
|
+
unprotect_branch: "Use this to remove protection from an existing branch; use `update_protected_branch` to change access levels or force push while keeping the rule. The operation changes repository security controls, requires permission to manage protected branches, and returns the result or an error when the branch is missing or policy forbids the change.",
|
|
21
22
|
protect_tag: "Use this to protect a tag or wildcard such as `v*` so protected CI/CD variables reach tag pipelines; use `get_protected_tag` or `list_protected_tags` to inspect existing rules first. The operation changes who may create matching tags, requires maintainer-level permission, and returns the protection rule or a validation/permission error.",
|
|
22
23
|
unprotect_tag: "Use this to remove protection from an existing tag or wildcard. To change the create access level, use `unprotect_tag` first, then `protect_tag`; `protect_tag` creates a rule and does not update an existing rule. This change is unavailable in `modify` mode because `unprotect_tag` is blocked there. The operation changes repository security controls, requires permission to manage protected tags, and returns the result or an error when the tag is missing or policy forbids the change.",
|
|
23
24
|
update_default_branch: "Use this to change which branch GitLab treats as the project's default; use `create_branch` to create a branch rather than changing project defaults. The operation changes project settings and may affect clone, merge request, and CI defaults, requires project-maintainer permission, and returns the updated project or a validation/permission error.",
|
package/build/utils/url.js
CHANGED
|
@@ -102,19 +102,43 @@ function apiUrlProblem(url) {
|
|
|
102
102
|
* them would fail every request and echo the password in the error.
|
|
103
103
|
*/
|
|
104
104
|
export function parseConfiguredGitLabApiUrls(value) {
|
|
105
|
-
const
|
|
105
|
+
const rawEntries = splitCommaSeparatedUrls(value);
|
|
106
|
+
const entries = rawEntries.map(stripUrlUserinfo);
|
|
107
|
+
const urls = entries.map(entry => normalizeGitLabApiUrl(entry.url));
|
|
106
108
|
return {
|
|
107
|
-
urls
|
|
109
|
+
urls,
|
|
108
110
|
hadUserinfo: entries.some(entry => entry.hadUserinfo),
|
|
111
|
+
hostnamesForLog: apiUrlHostnamesForLog(rawEntries, urls),
|
|
109
112
|
};
|
|
110
113
|
}
|
|
114
|
+
const INVALID_HOSTNAME = "<invalid>";
|
|
111
115
|
/**
|
|
112
|
-
* The host name of
|
|
113
|
-
*
|
|
116
|
+
* The host name of each configured API URL, for the startup log. `rawEntries`
|
|
117
|
+
* are the entries as split, before userinfo is dropped, and `urls` the URLs
|
|
118
|
+
* built from them. A password with literal commas can be split into several
|
|
119
|
+
* URLs: "http://alice:12,http://password:34,http://tail@host" gives
|
|
120
|
+
* "http://password:34", whose host is part of the password, and no single
|
|
121
|
+
* entry shows that. The password ends at an "@", so every entry before the last
|
|
122
|
+
* one with an "@" shows as "<invalid>", even when it is a whole URL of its own.
|
|
123
|
+
*/
|
|
124
|
+
function apiUrlHostnamesForLog(rawEntries, urls) {
|
|
125
|
+
let lastWithAt = -1;
|
|
126
|
+
rawEntries.forEach((entry, index) => {
|
|
127
|
+
if (entry.includes("@")) {
|
|
128
|
+
lastWithAt = index;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return urls.map((url, index) => index < lastWithAt ? INVALID_HOSTNAME : apiUrlHostnameForLog(url));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The host name of one configured API URL, for the startup log. A password with
|
|
135
|
+
* a literal comma can be split into two URLs, and "http://alice:12" then reads
|
|
114
136
|
* the start of the password as a port, which text redaction keeps. The port,
|
|
115
137
|
* userinfo, path, and query are left out. An IPv6 host keeps its brackets.
|
|
116
138
|
* An "@" after the host means the host can be part of a password
|
|
117
139
|
* ("http://sec/ret@host" from "alice:12,http://sec/ret@host"), so it is not shown.
|
|
140
|
+
* The host of a URL cut out of the middle of a password looks like any other
|
|
141
|
+
* host here, so the startup log uses the list from parseConfiguredGitLabApiUrls.
|
|
118
142
|
*/
|
|
119
143
|
export function apiUrlHostnameForLog(url) {
|
|
120
144
|
let parsed;
|
|
@@ -122,10 +146,10 @@ export function apiUrlHostnameForLog(url) {
|
|
|
122
146
|
parsed = new URL(url);
|
|
123
147
|
}
|
|
124
148
|
catch {
|
|
125
|
-
return
|
|
149
|
+
return INVALID_HOSTNAME;
|
|
126
150
|
}
|
|
127
151
|
const atAfterHost = parsed.pathname.includes("@") || parsed.search.includes("@") || parsed.hash.includes("@");
|
|
128
|
-
return parsed.hostname.length === 0 || atAfterHost ?
|
|
152
|
+
return parsed.hostname.length === 0 || atAfterHost ? INVALID_HOSTNAME : parsed.hostname;
|
|
129
153
|
}
|
|
130
154
|
const LOOPBACK_HOSTNAMES = new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
131
155
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zereight/mcp-gitlab",
|
|
3
|
-
"version": "2.3.7-next.
|
|
3
|
+
"version": "2.3.7-next.138",
|
|
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": [
|