gitlab-mcp 0.0.1 → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michael Lin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,277 @@
1
+ # GitLab MCP Server
2
+
3
+ Model Context Protocol (MCP) server for GitLab integration. This server allows communication between GitLab and MCP-compatible AI assistants.
4
+
5
+ ## Usage
6
+
7
+ ### Using with Claude App, Cline, Roo Code, Cursor
8
+
9
+ When using with the Claude App, you need to set up your API key and URLs directly.
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "GitLab communication server": {
15
+ "command": "npx",
16
+ "args": ["-y", "mcp-gitlab"],
17
+ "env": {
18
+ "GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
19
+ "GITLAB_API_URL": "your_gitlab_api_url",
20
+ "GITLAB_READ_ONLY_MODE": "true"
21
+ }
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ ### Environment Variables
28
+
29
+ - `GITLAB_PERSONAL_ACCESS_TOKEN`: Your GitLab personal access token.
30
+ - `GITLAB_API_URL`: Your GitLab API URL. (Default: `https://gitlab.com/api/v4`)
31
+ - `GITLAB_READ_ONLY_MODE`: When set to 'true', restricts the server to only expose read-only operations. Useful for enhanced security or when write access is not needed. Also useful for using with Cursor and it's 40 tool limit.
32
+
33
+ ## Tools đŸ› ī¸
34
+
35
+ 1. `create_or_update_file`
36
+
37
+ - Create or update a single file in a GitLab project. 📝
38
+ - Inputs:
39
+ - `project_id` (string): Project ID or namespace/project_path
40
+ - `file_path` (string): Path to create/update the file
41
+ - `content` (string): File content
42
+ - `commit_message` (string): Commit message
43
+ - `branch` (string): Branch to create/update the file in
44
+ - `previous_path` (optional string): Previous file path when renaming a file
45
+ - Returns: File content and commit details
46
+
47
+ 2. `push_files`
48
+
49
+ - Push multiple files in a single commit. 📤
50
+ - Inputs:
51
+ - `project_id` (string): Project ID or namespace/project_path
52
+ - `branch` (string): Branch to push to
53
+ - `files` (array): Array of files to push, each with `file_path` and `content` properties
54
+ - `commit_message` (string): Commit message
55
+ - Returns: Updated branch reference
56
+
57
+ 3. `search_repositories`
58
+
59
+ - Search for GitLab projects. 🔍
60
+ - Inputs:
61
+ - `search` (string): Search query
62
+ - `page` (optional number): Page number (default: 1)
63
+ - `per_page` (optional number): Results per page (default: 20, max: 100)
64
+ - Returns: Project search results
65
+
66
+ 4. `create_repository`
67
+
68
+ - Create a new GitLab project. ➕
69
+ - Inputs:
70
+ - `name` (string): Project name
71
+ - `description` (optional string): Project description
72
+ - `visibility` (optional string): Project visibility level (public, private, internal)
73
+ - `initialize_with_readme` (optional boolean): Initialize with README
74
+ - Returns: Details of the created project
75
+
76
+ 5. `get_file_contents`
77
+
78
+ - Get the contents of a file or directory. 📂
79
+ - Inputs:
80
+ - `project_id` (string): Project ID or namespace/project_path
81
+ - `file_path` (string): Path to the file/directory
82
+ - `ref` (optional string): Branch, tag, or commit SHA (default: default branch)
83
+ - Returns: File/directory content
84
+
85
+ 6. `create_issue`
86
+
87
+ - Create a new issue. 🐛
88
+ - Inputs:
89
+ - `project_id` (string): Project ID or namespace/project_path
90
+ - `title` (string): Issue title
91
+ - `description` (string): Issue description
92
+ - `assignee_ids` (optional number[]): Array of assignee IDs
93
+ - `milestone_id` (optional number): Milestone ID
94
+ - `labels` (optional string[]): Array of labels
95
+ - Returns: Details of the created issue
96
+
97
+ 7. `create_merge_request`
98
+
99
+ - Create a new merge request. 🚀
100
+ - Inputs:
101
+ - `project_id` (string): Project ID or namespace/project_path
102
+ - `title` (string): Merge request title
103
+ - `description` (string): Merge request description
104
+ - `source_branch` (string): Branch with changes
105
+ - `target_branch` (string): Branch to merge into
106
+ - `allow_collaboration` (optional boolean): Allow collaborators to push commits to the source branch
107
+ - `draft` (optional boolean): Create as a draft merge request
108
+ - Returns: Details of the created merge request
109
+
110
+ 8. `fork_repository`
111
+
112
+ - Fork a project. 🍴
113
+ - Inputs:
114
+ - `project_id` (string): Project ID or namespace/project_path to fork
115
+ - `namespace` (optional string): Namespace to fork into (default: user namespace)
116
+ - Returns: Details of the forked project
117
+
118
+ 9. `create_branch`
119
+
120
+ - Create a new branch. đŸŒŋ
121
+ - Inputs:
122
+ - `project_id` (string): Project ID or namespace/project_path
123
+ - `name` (string): New branch name
124
+ - `ref` (optional string): Ref to create the branch from (branch, tag, commit SHA, default: default branch)
125
+ - Returns: Created branch reference
126
+
127
+ 10. `get_merge_request`
128
+
129
+ - Get details of a merge request. â„šī¸
130
+ - Inputs:
131
+ - `project_id` (string): Project ID or namespace/project_path
132
+ - `merge_request_iid` (number): Merge request IID
133
+ - Returns: Merge request details
134
+
135
+ 11. `get_merge_request_diffs`
136
+
137
+ - Get changes (diffs) of a merge request. diff
138
+ - Inputs:
139
+ - `project_id` (string): Project ID or namespace/project_path
140
+ - `merge_request_iid` (number): Merge request IID
141
+ - `view` (optional string): Diff view type ('inline' or 'parallel')
142
+ - Returns: Array of merge request diff information
143
+
144
+ 12. `update_merge_request`
145
+
146
+ - Update a merge request. 🔄
147
+ - Inputs:
148
+ - `project_id` (string): Project ID or namespace/project_path
149
+ - `merge_request_iid` (number): Merge request IID
150
+ - `title` (optional string): New title
151
+ - `description` (string): New description
152
+ - `target_branch` (optional string): New target branch
153
+ - `state_event` (optional string): Merge request state change event ('close', 'reopen')
154
+ - `remove_source_branch` (optional boolean): Remove source branch after merge
155
+ - `allow_collaboration` (optional boolean): Allow collaborators to push commits to the source branch
156
+ - Returns: Updated merge request details
157
+
158
+ 13. `create_note`
159
+
160
+ - Create a new note (comment) to an issue or merge request. đŸ’Ŧ
161
+ - Inputs:
162
+ - `project_id` (string): Project ID or namespace/project_path
163
+ - `noteable_type` (string): Type of noteable ("issue" or "merge_request")
164
+ - `noteable_iid` (number): IID of the issue or merge request
165
+ - `body` (string): Note content
166
+ - Returns: Details of the created note
167
+
168
+ 14. `list_projects`
169
+ - List accessible projects with rich filtering options 📊
170
+ - Inputs:
171
+ - Search/filtering:
172
+ - `search`
173
+ - `owned`
174
+ - `membership`
175
+ - `archived`
176
+ - `visibility`
177
+ - Features filtering:
178
+ - `with_issues_enabled`
179
+ - `with_merge_requests_enabled`
180
+ - Sorting:
181
+ - `order_by`
182
+ - `sort`
183
+ - Access control:
184
+ - `min_access_level`
185
+ - Pagination:
186
+ - `page`
187
+ - `per_page`
188
+ - `simple`
189
+ - Returns: Array of projects
190
+ 15. `list_labels`
191
+ - List all labels for a project with filtering options đŸˇī¸
192
+ - Inputs:
193
+ - `project_id` (string): Project ID or path
194
+ - `with_counts` (optional): Include issue and merge request counts
195
+ - `include_ancestor_groups` (optional): Include ancestor groups
196
+ - `search` (optional): Filter labels by keyword
197
+ - Returns: Array of labels
198
+ 16. `get_label`
199
+ - Get a single label from a project
200
+ - Inputs:
201
+ - `project_id` (string): Project ID or path
202
+ - `label_id` (number/string): Label ID or name
203
+ - `include_ancestor_groups` (optional): Include ancestor groups
204
+ - Returns: label details
205
+ 17. `create_label`
206
+ - Create a new label in an object đŸˇī¸âž•
207
+ - Inputs:
208
+ - `project_id` (string): Project ID or path
209
+ - `name` (string): Label name
210
+ - `color` (string): Color in hex format (e.g., "#FF0000")
211
+ - `description` (optional): Label description
212
+ - `priority` (optional): Label priority
213
+ - Returns: Created label details
214
+ 18. `update_label`
215
+ - Update an existing label in a project đŸˇī¸âœī¸
216
+ - Inputs:
217
+ - `project_id` (string): Project ID or path
218
+ - `label_id` (number/string): Label ID or name
219
+ - `new_name` (optional): New label name
220
+ - `color` (optional): New color in hex format
221
+ - `description` (optional): New description
222
+ - `priority` (optional): New priority
223
+ - Returns: Updated label details
224
+ 19. `delete_label`
225
+
226
+ - Delete a label from a project đŸˇī¸âŒ
227
+ - Inputs:
228
+ - `project_id` (string): Project ID or path
229
+ - `label_id` (number/string): Label ID or name
230
+ - Returns: Success message
231
+
232
+ 20. `list_group_projects`
233
+
234
+ - List all projects in a GitLab group. 📂
235
+ - Inputs:
236
+ - `group_id` (string): Project ID or namespace/project_path
237
+ - Filtering options:
238
+ - `include_subgroups` (optional boolean): Include projects from subgroups
239
+ - `search` (optional string): Search term to filter projects
240
+ - `archived` (optional boolean): Filter for archived projects
241
+ - `visibility` (optional string): Filter by project visibility (public/internal/private)
242
+ - `with_programming_language` (optional string): Filter by programming language
243
+ - `starred` (optional boolean): Filter by starred projects
244
+ - Feature filtering:
245
+ - `with_issues_enabled` (optional boolean): Filter projects with issues feature enabled
246
+ - `with_merge_requests_enabled` (optional boolean): Filter projects with merge requests feature enabled
247
+ - `min_access_level` (optional number): Filter by minimum access level
248
+ - Pagination:
249
+ - `page` (optional number): Page number
250
+ - `per_page` (optional number): Results per page
251
+ - Sorting:
252
+ - `order_by` (optional string): Field to sort by
253
+ - `sort` (optional string): Sort direction (asc/desc)
254
+ - Additional data:
255
+ - `statistics` (optional boolean): Include project statistics
256
+ - `with_custom_attributes` (optional boolean): Include custom attributes
257
+ - `with_security_reports` (optional boolean): Include security reports
258
+ - Returns: List of projects
259
+
260
+ ## Environment Variable Configuration
261
+
262
+ Before running the server, you need to set the following environment variables:
263
+
264
+ ```
265
+ GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token
266
+ GITLAB_API_URL=your_gitlab_api_url # Default: https://gitlab.com/api/v4
267
+ GITLAB_READ_ONLY_MODE=true # Optional: Enable read-only mode
268
+ ```
269
+
270
+ ## Credits
271
+
272
+ - [Model Context Protocol](https://modelcontextprotocol.io/)
273
+ - [GitLab MCP](https://github.com/zereight/gitlab-mcp)
274
+
275
+ ## License
276
+
277
+ MIT