@zereight/mcp-gitlab 2.1.7 → 2.1.9
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 +25 -0
- package/README.md +150 -98
- package/README.zh-CN.md +25 -0
- package/build/index.js +183 -9
- package/build/schemas.js +160 -0
- package/build/test/schema-tests.js +228 -3
- package/build/test/streamable-http-static-token-auth.test.js +154 -0
- package/build/test/test-ci-lint.js +191 -0
- package/build/test/test-todos.js +195 -0
- package/build/test/test-toolset-filtering.js +13 -6
- package/build/tools/registry.js +52 -1
- package/package.json +2 -2
package/README.ko.md
CHANGED
|
@@ -155,6 +155,21 @@ docker run -i --rm \
|
|
|
155
155
|
|
|
156
156
|
MCP OAuth 사양을 지원하는 원격 MCP 클라이언트(예: Claude.ai)용입니다. 서버는 완전한 OAuth 2.0 인증 서버로 동작합니다. 인증되지 않은 요청은 `401 + WWW-Authenticate` 응답을 받고, 클라이언트 측 OAuth 브라우저 플로우가 자동으로 시작됩니다.
|
|
157
157
|
|
|
158
|
+
OpenCode, MCPJam, Claude.ai 같은 원격 MCP 클라이언트는 인증 중에 자체 callback URL을 보낼 수 있습니다. 모든 클라이언트 callback URL을 GitLab에 등록할 수 없다면 `GITLAB_OAUTH_CALLBACK_PROXY=true`를 켜세요. 콜백 프록시 모드에서는 GitLab에 `{MCP_SERVER_URL}/callback` 하나만 Redirect URI로 등록하면 됩니다.
|
|
159
|
+
|
|
160
|
+
`GITLAB_OAUTH_REDIRECT_URI`는 로컬 OAuth(`GITLAB_USE_OAUTH`) 전용입니다. 원격 MCP OAuth 클라이언트 callback URL을 덮어쓰지 않으며, 원격 `Unregistered redirect_uri` 오류 해결용으로 사용하면 안 됩니다.
|
|
161
|
+
|
|
162
|
+
이 변수가 존재하는 이유는 로컬 OAuth 플로우가 MCP 서버와 같은 머신에서 브라우저를 열고, `http://127.0.0.1:8888/callback` 같은 로컬 HTTP 서버로 callback을 받기 때문입니다.
|
|
163
|
+
|
|
164
|
+
원격 MCP OAuth는 다릅니다. `GITLAB_MCP_OAUTH=true` 모드에서는 MCP 클라이언트가 `/authorize` 요청 중에 자체 callback URL을 제공합니다. `GITLAB_OAUTH_REDIRECT_URI`는 그 클라이언트 제공 URL을 대체하지 않습니다.
|
|
165
|
+
|
|
166
|
+
| 모드 | 활성화 변수 | Callback 변수 | GitLab Redirect URI |
|
|
167
|
+
| --- | --- | --- | --- |
|
|
168
|
+
| 로컬 OAuth | `GITLAB_USE_OAUTH=true` | `GITLAB_OAUTH_REDIRECT_URI` | `http://127.0.0.1:8888/callback` 또는 로컬 callback |
|
|
169
|
+
| 원격 MCP OAuth | `GITLAB_MCP_OAUTH=true` | `GITLAB_OAUTH_CALLBACK_PROXY=true` | `{MCP_SERVER_URL}/callback` |
|
|
170
|
+
|
|
171
|
+
MCP 서버가 직접 로컬 브라우저 callback을 받을 때만 `GITLAB_OAUTH_REDIRECT_URI`를 사용하세요. 원격 MCP 클라이언트가 callback URL을 소유하는 경우에는 `GITLAB_OAUTH_CALLBACK_PROXY=true`를 사용하세요.
|
|
172
|
+
|
|
158
173
|
**동작 방식**: 공개 HTTPS URL을 가진 위치에 이 MCP 서버를 배포합니다. MCP 클라이언트는 `{MCP_SERVER_URL}/mcp`로 연결합니다. 서버는 OAuth 2.0 플로우를 처리하고 GitLab과 자격 증명을 교환합니다.
|
|
159
174
|
|
|
160
175
|
**사전 준비:**
|
|
@@ -173,6 +188,16 @@ MCP OAuth 사양을 지원하는 원격 MCP 클라이언트(예: Claude.ai)용
|
|
|
173
188
|
| `GITLAB_OAUTH_CALLBACK_PROXY` | 선택 | MCP 서버의 고정 `/callback` URL을 사용하려면 `true` |
|
|
174
189
|
| `GITLAB_OAUTH_SCOPES` | 선택 | 쉼표로 구분된 scope 목록(기본값: `api,read_api,read_user`) |
|
|
175
190
|
|
|
191
|
+
> **`Unregistered redirect_uri` 문제 해결**
|
|
192
|
+
>
|
|
193
|
+
> 브라우저 URL의 `redirect_uri`를 확인하세요. 값이 `http://127.0.0.1:xxxxx/.../callback` 같은 클라이언트 callback을 가리키면 다음 설정을 켜세요.
|
|
194
|
+
>
|
|
195
|
+
> ```env
|
|
196
|
+
> GITLAB_OAUTH_CALLBACK_PROXY=true
|
|
197
|
+
> ```
|
|
198
|
+
>
|
|
199
|
+
> 원격 MCP OAuth 문제를 `GITLAB_OAUTH_REDIRECT_URI` 변경으로 해결하려고 하지 마세요. 이 변수는 로컬 OAuth(`GITLAB_USE_OAUTH`) 전용입니다.
|
|
200
|
+
|
|
176
201
|
```shell
|
|
177
202
|
docker run -i --rm \
|
|
178
203
|
-e HOST=0.0.0.0 \
|
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ Quick start: choose either Personal Access Token or OAuth2 setup below and use `
|
|
|
33
33
|
- [OAuth2 Authentication Setup Guide](./docs/oauth-setup.md)
|
|
34
34
|
- [Environment Variables Reference](./docs/environment-variables.md)
|
|
35
35
|
- [Stateless Mode — Multi-Pod HPA](./docs/stateless-mode.md)
|
|
36
|
+
- [Custom Agents and Multiple PAT Setup](./docs/custom-agent-multiple-pat.md)
|
|
36
37
|
|
|
37
38
|
## Usage
|
|
38
39
|
|
|
@@ -128,7 +129,7 @@ docker run -i --rm \
|
|
|
128
129
|
```shell
|
|
129
130
|
docker run -i --rm \
|
|
130
131
|
-e HOST=0.0.0.0 \
|
|
131
|
-
-e
|
|
132
|
+
-e REMOTE_AUTHORIZATION=true \
|
|
132
133
|
-e GITLAB_API_URL="https://gitlab.com/api/v4" \
|
|
133
134
|
-e GITLAB_READ_ONLY_MODE=true \
|
|
134
135
|
-e USE_GITLAB_WIKI=true \
|
|
@@ -144,7 +145,10 @@ docker run -i --rm \
|
|
|
144
145
|
"mcpServers": {
|
|
145
146
|
"gitlab": {
|
|
146
147
|
"type": "streamable-http",
|
|
147
|
-
"url": "http://localhost:3333/mcp"
|
|
148
|
+
"url": "http://localhost:3333/mcp",
|
|
149
|
+
"headers": {
|
|
150
|
+
"Authorization": "Bearer glpat-..."
|
|
151
|
+
}
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
}
|
|
@@ -159,6 +163,32 @@ The server acts as a full OAuth 2.0 authorization server — unauthenticated req
|
|
|
159
163
|
receive a `401 + WWW-Authenticate` response, which triggers the OAuth browser flow
|
|
160
164
|
automatically on the client side.
|
|
161
165
|
|
|
166
|
+
Remote MCP clients such as OpenCode, MCPJam, and Claude.ai can send their own
|
|
167
|
+
callback URL during authorization. If you cannot register every client callback
|
|
168
|
+
URL in GitLab, enable `GITLAB_OAUTH_CALLBACK_PROXY=true`. With callback proxy
|
|
169
|
+
mode, GitLab only needs one registered redirect URI: `{MCP_SERVER_URL}/callback`.
|
|
170
|
+
|
|
171
|
+
`GITLAB_OAUTH_REDIRECT_URI` is for local OAuth (`GITLAB_USE_OAUTH`) only. It does
|
|
172
|
+
not override remote MCP OAuth client callback URLs and should not be used to fix
|
|
173
|
+
remote `Unregistered redirect_uri` errors.
|
|
174
|
+
|
|
175
|
+
This variable exists because the local OAuth flow starts a browser on the same
|
|
176
|
+
machine as the MCP server and listens for the callback on a local HTTP server,
|
|
177
|
+
for example `http://127.0.0.1:8888/callback`.
|
|
178
|
+
|
|
179
|
+
Remote MCP OAuth is different. In `GITLAB_MCP_OAUTH=true` mode, the MCP client
|
|
180
|
+
provides its own callback URL during `/authorize`. `GITLAB_OAUTH_REDIRECT_URI`
|
|
181
|
+
does not replace that client-provided URL.
|
|
182
|
+
|
|
183
|
+
| Mode | Enable with | Callback variable | GitLab redirect URI |
|
|
184
|
+
| --- | --- | --- | --- |
|
|
185
|
+
| Local OAuth | `GITLAB_USE_OAUTH=true` | `GITLAB_OAUTH_REDIRECT_URI` | `http://127.0.0.1:8888/callback` or your local callback |
|
|
186
|
+
| Remote MCP OAuth | `GITLAB_MCP_OAUTH=true` | `GITLAB_OAUTH_CALLBACK_PROXY=true` | `{MCP_SERVER_URL}/callback` |
|
|
187
|
+
|
|
188
|
+
Use `GITLAB_OAUTH_REDIRECT_URI` only when the MCP server itself owns the local
|
|
189
|
+
browser callback. Use `GITLAB_OAUTH_CALLBACK_PROXY=true` when a remote MCP client
|
|
190
|
+
owns the callback URL.
|
|
191
|
+
|
|
162
192
|
**How it works**: You deploy this MCP server somewhere with a public HTTPS URL. MCP
|
|
163
193
|
clients connect to `{MCP_SERVER_URL}/mcp`. The server handles the OAuth 2.0 flow,
|
|
164
194
|
exchanging credentials with GitLab on behalf of the client.
|
|
@@ -179,6 +209,20 @@ exchanging credentials with GitLab on behalf of the client.
|
|
|
179
209
|
| `GITLAB_OAUTH_CALLBACK_PROXY` | optional | Set to `true` to use the MCP server's fixed `/callback` URL |
|
|
180
210
|
| `GITLAB_OAUTH_SCOPES` | optional | Comma-separated scopes (default: `api,read_api,read_user`) |
|
|
181
211
|
|
|
212
|
+
When `STREAMABLE_HTTP=true`, server-side `GITLAB_PERSONAL_ACCESS_TOKEN` or `GITLAB_JOB_TOKEN` require `REMOTE_AUTHORIZATION=true` or `GITLAB_MCP_OAUTH=true`.
|
|
213
|
+
|
|
214
|
+
> **Troubleshooting `Unregistered redirect_uri`**
|
|
215
|
+
>
|
|
216
|
+
> Check the `redirect_uri` in the browser URL. If it points to a client callback
|
|
217
|
+
> such as `http://127.0.0.1:xxxxx/.../callback`, enable:
|
|
218
|
+
>
|
|
219
|
+
> ```env
|
|
220
|
+
> GITLAB_OAUTH_CALLBACK_PROXY=true
|
|
221
|
+
> ```
|
|
222
|
+
>
|
|
223
|
+
> Do not fix remote MCP OAuth by changing `GITLAB_OAUTH_REDIRECT_URI`. That
|
|
224
|
+
> variable is for local OAuth (`GITLAB_USE_OAUTH`) only.
|
|
225
|
+
|
|
182
226
|
```shell
|
|
183
227
|
docker run -i --rm \
|
|
184
228
|
-e HOST=0.0.0.0 \
|
|
@@ -497,102 +541,110 @@ Register the skill directory in your AI client to get optimal tool usage guidanc
|
|
|
497
541
|
48. `get_issue` - Get details of a specific issue in a GitLab project
|
|
498
542
|
49. `update_issue` - Update an issue in a GitLab project
|
|
499
543
|
50. `delete_issue` - Delete an issue from a GitLab project
|
|
500
|
-
51. `
|
|
501
|
-
52. `
|
|
502
|
-
53. `
|
|
503
|
-
54. `
|
|
504
|
-
55. `
|
|
505
|
-
56. `
|
|
506
|
-
57. `
|
|
507
|
-
58. `
|
|
508
|
-
59. `
|
|
509
|
-
60. `
|
|
510
|
-
61. `
|
|
511
|
-
62. `
|
|
512
|
-
63. `
|
|
513
|
-
64. `
|
|
514
|
-
65. `
|
|
515
|
-
66. `
|
|
516
|
-
67. `
|
|
517
|
-
68. `
|
|
518
|
-
69. `
|
|
519
|
-
70. `
|
|
520
|
-
71. `
|
|
521
|
-
72. `
|
|
522
|
-
73. `
|
|
523
|
-
74. `
|
|
524
|
-
75. `
|
|
525
|
-
76. `
|
|
526
|
-
77. `
|
|
527
|
-
78. `
|
|
528
|
-
79. `
|
|
529
|
-
80. `
|
|
530
|
-
81. `
|
|
531
|
-
82. `
|
|
532
|
-
83. `
|
|
533
|
-
84. `
|
|
534
|
-
85. `
|
|
535
|
-
86. `
|
|
536
|
-
87. `
|
|
537
|
-
88. `
|
|
538
|
-
89. `
|
|
539
|
-
90. `
|
|
540
|
-
91. `
|
|
541
|
-
92. `
|
|
542
|
-
93. `
|
|
543
|
-
94. `
|
|
544
|
-
95. `
|
|
545
|
-
96. `
|
|
546
|
-
97. `
|
|
547
|
-
98. `
|
|
548
|
-
99. `
|
|
549
|
-
100. `
|
|
550
|
-
101. `
|
|
551
|
-
102. `
|
|
552
|
-
103. `
|
|
553
|
-
104. `
|
|
554
|
-
105. `
|
|
555
|
-
106. `
|
|
556
|
-
107. `
|
|
557
|
-
108. `
|
|
558
|
-
109. `
|
|
559
|
-
110. `
|
|
560
|
-
111. `
|
|
561
|
-
112. `
|
|
562
|
-
113. `
|
|
563
|
-
114. `
|
|
564
|
-
115. `
|
|
565
|
-
116. `
|
|
566
|
-
117. `
|
|
567
|
-
118. `
|
|
568
|
-
119. `
|
|
569
|
-
120. `
|
|
570
|
-
121. `
|
|
571
|
-
122. `
|
|
572
|
-
123. `
|
|
573
|
-
124. `
|
|
574
|
-
125. `
|
|
575
|
-
126. `
|
|
576
|
-
127. `
|
|
577
|
-
128. `
|
|
578
|
-
129. `
|
|
579
|
-
130. `
|
|
580
|
-
131. `
|
|
581
|
-
132. `
|
|
582
|
-
133. `
|
|
583
|
-
134. `
|
|
584
|
-
135. `
|
|
585
|
-
136. `
|
|
586
|
-
137. `
|
|
587
|
-
138. `
|
|
588
|
-
139. `
|
|
589
|
-
140. `
|
|
590
|
-
141. `
|
|
591
|
-
142. `
|
|
592
|
-
143. `
|
|
593
|
-
144. `
|
|
594
|
-
145. `
|
|
595
|
-
146. `
|
|
544
|
+
51. `list_todos` - List GitLab to-do items for the current user
|
|
545
|
+
52. `mark_todo_done` - Mark a GitLab to-do item as done
|
|
546
|
+
53. `mark_all_todos_done` - Mark all pending GitLab to-do items as done for the current user
|
|
547
|
+
54. `list_issue_links` - List all issue links for a specific issue
|
|
548
|
+
55. `list_issue_discussions` - List discussions for an issue in a GitLab project
|
|
549
|
+
56. `get_issue_link` - Get a specific issue link
|
|
550
|
+
57. `create_issue_link` - Create an issue link between two issues
|
|
551
|
+
58. `delete_issue_link` - Delete an issue link
|
|
552
|
+
59. `list_namespaces` - List all namespaces available to the current user
|
|
553
|
+
60. `get_namespace` - Get details of a namespace by ID or path
|
|
554
|
+
61. `verify_namespace` - Verify if a namespace path exists
|
|
555
|
+
62. `get_project` - Get details of a specific project
|
|
556
|
+
63. `list_projects` - List projects accessible by the current user
|
|
557
|
+
64. `list_project_members` - List members of a GitLab project
|
|
558
|
+
65. `list_group_projects` - List projects in a GitLab group with filtering options
|
|
559
|
+
66. `list_group_iterations` - List group iterations with filtering options
|
|
560
|
+
67. `list_labels` - List labels for a project
|
|
561
|
+
68. `get_label` - Get a single label from a project
|
|
562
|
+
69. `create_label` - Create a new label in a project
|
|
563
|
+
70. `update_label` - Update an existing label in a project
|
|
564
|
+
71. `delete_label` - Delete a label from a project
|
|
565
|
+
72. `list_pipelines` - List pipelines in a GitLab project with filtering options
|
|
566
|
+
73. `get_pipeline` - Get details of a specific pipeline in a GitLab project
|
|
567
|
+
74. `list_pipeline_jobs` - List all jobs in a specific pipeline
|
|
568
|
+
75. `list_pipeline_trigger_jobs` - List all trigger jobs (bridges) in a specific pipeline that trigger downstream pipelines
|
|
569
|
+
76. `get_pipeline_job` - Get details of a GitLab pipeline job number
|
|
570
|
+
77. `get_pipeline_job_output` - Get the output/trace of a GitLab pipeline job with optional pagination to limit context window usage
|
|
571
|
+
78. `validate_ci_lint` - Validate provided GitLab CI/CD YAML content for a project
|
|
572
|
+
79. `validate_project_ci_lint` - Validate an existing `.gitlab-ci.yml` configuration for a project
|
|
573
|
+
80. `create_pipeline` - Create a new pipeline for a branch or tag
|
|
574
|
+
81. `retry_pipeline` - Retry a failed or canceled pipeline
|
|
575
|
+
82. `cancel_pipeline` - Cancel a running pipeline
|
|
576
|
+
83. `play_pipeline_job` - Run a manual pipeline job
|
|
577
|
+
84. `retry_pipeline_job` - Retry a failed or canceled pipeline job
|
|
578
|
+
85. `cancel_pipeline_job` - Cancel a running pipeline job
|
|
579
|
+
86. `list_deployments` - List deployments in a GitLab project with filtering options
|
|
580
|
+
87. `get_deployment` - Get details of a specific deployment in a GitLab project
|
|
581
|
+
88. `list_environments` - List environments in a GitLab project
|
|
582
|
+
89. `get_environment` - Get details of a specific environment in a GitLab project
|
|
583
|
+
90. `list_job_artifacts` - List artifact files in a job's artifacts archive. Returns file names, paths, types, and sizes
|
|
584
|
+
91. `download_job_artifacts` - Download the entire artifact archive (zip) for a job to a local path. Returns the saved file path
|
|
585
|
+
92. `get_job_artifact_file` - Get the content of a single file from a job's artifacts by its path within the archive
|
|
586
|
+
93. `list_milestones` - List milestones in a GitLab project with filtering options
|
|
587
|
+
94. `get_milestone` - Get details of a specific milestone
|
|
588
|
+
95. `create_milestone` - Create a new milestone in a GitLab project
|
|
589
|
+
96. `edit_milestone` - Edit an existing milestone in a GitLab project
|
|
590
|
+
97. `delete_milestone` - Delete a milestone from a GitLab project
|
|
591
|
+
98. `get_milestone_issue` - Get issues associated with a specific milestone
|
|
592
|
+
99. `get_milestone_merge_requests` - Get merge requests associated with a specific milestone
|
|
593
|
+
100. `promote_milestone` - Promote a milestone to the next stage
|
|
594
|
+
101. `get_milestone_burndown_events` - Get burndown events for a specific milestone
|
|
595
|
+
102. `list_wiki_pages` - List wiki pages in a GitLab project
|
|
596
|
+
103. `get_wiki_page` - Get details of a specific wiki page
|
|
597
|
+
104. `create_wiki_page` - Create a new wiki page in a GitLab project
|
|
598
|
+
105. `update_wiki_page` - Update an existing wiki page in a GitLab project
|
|
599
|
+
106. `delete_wiki_page` - Delete a wiki page from a GitLab project
|
|
600
|
+
107. `list_group_wiki_pages` - List wiki pages in a GitLab group
|
|
601
|
+
108. `get_group_wiki_page` - Get details of a specific group wiki page
|
|
602
|
+
109. `create_group_wiki_page` - Create a new wiki page in a GitLab group
|
|
603
|
+
110. `update_group_wiki_page` - Update an existing wiki page in a GitLab group
|
|
604
|
+
111. `delete_group_wiki_page` - Delete a wiki page from a GitLab group
|
|
605
|
+
112. `get_repository_tree` - Get the repository tree for a GitLab project (list files and directories)
|
|
606
|
+
113. `list_commits` - List repository commits with filtering options
|
|
607
|
+
114. `get_commit` - Get details of a specific commit
|
|
608
|
+
115. `get_commit_diff` - Get changes/diffs of a specific commit
|
|
609
|
+
116. `list_commit_statuses` - List statuses for a specific commit
|
|
610
|
+
117. `create_commit_status` - Create or update the status of a specific commit
|
|
611
|
+
118. `list_releases` - List all releases for a project
|
|
612
|
+
119. `get_release` - Get a release by tag name
|
|
613
|
+
120. `create_release` - Create a new release in a GitLab project
|
|
614
|
+
121. `update_release` - Update an existing release in a GitLab project
|
|
615
|
+
122. `delete_release` - Delete a release from a GitLab project (does not delete the associated tag)
|
|
616
|
+
123. `create_release_evidence` - Create release evidence for an existing release (GitLab Premium/Ultimate only)
|
|
617
|
+
124. `download_release_asset` - Download a release asset file by direct asset path
|
|
618
|
+
125. `list_tags` - List repository tags with filtering and pagination support
|
|
619
|
+
126. `get_tag` - Get details of a specific repository tag
|
|
620
|
+
127. `create_tag` - Create a new tag in the repository
|
|
621
|
+
128. `delete_tag` - Delete a tag from the repository
|
|
622
|
+
129. `get_tag_signature` - Get the signature of a signed tag
|
|
623
|
+
130. `get_users` - Get GitLab user details by usernames
|
|
624
|
+
131. `list_events` - List all events for the currently authenticated user
|
|
625
|
+
132. `get_project_events` - List all visible events for a specified project
|
|
626
|
+
133. `upload_markdown` - Upload a file to a GitLab project for use in markdown content
|
|
627
|
+
134. `download_attachment` - Download an uploaded file from a GitLab project by secret and filename
|
|
628
|
+
135. `get_work_item` - Get a single work item with full details including status, hierarchy (parent/children), type, labels, assignees, and all widgets
|
|
629
|
+
136. `list_work_items` - List work items in a project with filters (type, state, search, assignees, labels). Returns items with status and hierarchy info
|
|
630
|
+
137. `create_work_item` - Create a new work item (issue, task, incident, test_case, epic, key_result, objective, requirement, ticket). Supports setting title, description, labels, assignees, weight, parent, health status, start/due dates, milestone, and confidentiality
|
|
631
|
+
138. `update_work_item` - Update a work item. Can modify title, description, labels, assignees, weight, state, status, parent hierarchy, children, health status, start/due dates, milestone, confidentiality, linked items, and custom fields
|
|
632
|
+
139. `convert_work_item_type` - Convert a work item to a different type (e.g. issue to task, task to incident)
|
|
633
|
+
140. `list_work_item_statuses` - List available statuses for a work item type in a project. Requires GitLab Premium/Ultimate with configurable statuses
|
|
634
|
+
141. `list_custom_field_definitions` - List available custom field definitions for a work item type in a project. Returns field names, types, and IDs needed for setting custom fields via update_work_item
|
|
635
|
+
142. `move_work_item` - Move a work item (issue, task, etc.) to a different project. Uses GitLab GraphQL issueMove mutation
|
|
636
|
+
143. `list_work_item_notes` - List notes and discussions on a work item. Returns threaded discussions with author, body, timestamps, and system/internal flags
|
|
637
|
+
144. `create_work_item_note` - Add a note/comment to a work item. Supports Markdown, internal notes, and threaded replies
|
|
638
|
+
145. `get_timeline_events` - List timeline events for an incident. Returns chronological events with notes, timestamps, and tags
|
|
639
|
+
146. `create_timeline_event` - Create a timeline event on an incident. Supports tags: 'Start time', 'End time', 'Impact detected', 'Response initiated', 'Impact mitigated', 'Cause identified'
|
|
640
|
+
147. `list_webhooks` - List all configured webhooks for a GitLab project or group. Provide either project_id or group_id
|
|
641
|
+
148. `list_webhook_events` - List recent webhook events (past 7 days) for a project or group webhook. Use summary mode for overview, then get_webhook_event for full details
|
|
642
|
+
149. `get_webhook_event` - Get full details of a specific webhook event by ID, including request/response payloads
|
|
643
|
+
150. `search_code` - Search for code across all projects on the GitLab instance (requires advanced search or exact code search to be enabled)
|
|
644
|
+
151. `search_project_code` - Search for code within a specific GitLab project (requires advanced search or exact code search to be enabled)
|
|
645
|
+
152. `search_group_code` - Search for code within a specific GitLab group (requires advanced search or exact code search to be enabled)
|
|
646
|
+
153. `execute_graphql` - Execute a GitLab GraphQL query
|
|
647
|
+
|
|
596
648
|
<!-- TOOLS-END -->
|
|
597
649
|
|
|
598
650
|
</details>
|
package/README.zh-CN.md
CHANGED
|
@@ -155,6 +155,21 @@ docker run -i --rm \
|
|
|
155
155
|
|
|
156
156
|
适用于支持 MCP OAuth 规范的远程 MCP 客户端(例如 Claude.ai)。服务器会作为完整 OAuth 2.0 授权服务器运行。未认证请求会收到 `401 + WWW-Authenticate` 响应,从而触发客户端侧 OAuth 浏览器流程。
|
|
157
157
|
|
|
158
|
+
OpenCode、MCPJam、Claude.ai 等远程 MCP 客户端可能会在授权时发送自己的 callback URL。如果你无法在 GitLab 中注册每个客户端 callback URL,请启用 `GITLAB_OAUTH_CALLBACK_PROXY=true`。启用回调代理模式后,GitLab 只需要注册一个 Redirect URI:`{MCP_SERVER_URL}/callback`。
|
|
159
|
+
|
|
160
|
+
`GITLAB_OAUTH_REDIRECT_URI` 仅用于本地 OAuth(`GITLAB_USE_OAUTH`)。它不会覆盖远程 MCP OAuth 客户端 callback URL,也不应用来修复远程 `Unregistered redirect_uri` 错误。
|
|
161
|
+
|
|
162
|
+
这个变量存在是因为本地 OAuth 流程会在与 MCP 服务器相同的机器上打开浏览器,并通过本地 HTTP 服务器接收 callback,例如 `http://127.0.0.1:8888/callback`。
|
|
163
|
+
|
|
164
|
+
远程 MCP OAuth 不同。在 `GITLAB_MCP_OAUTH=true` 模式下,MCP 客户端会在 `/authorize` 请求中提供自己的 callback URL。`GITLAB_OAUTH_REDIRECT_URI` 不会替换这个客户端提供的 URL。
|
|
165
|
+
|
|
166
|
+
| 模式 | 启用方式 | Callback 变量 | GitLab Redirect URI |
|
|
167
|
+
| --- | --- | --- | --- |
|
|
168
|
+
| 本地 OAuth | `GITLAB_USE_OAUTH=true` | `GITLAB_OAUTH_REDIRECT_URI` | `http://127.0.0.1:8888/callback` 或你的本地 callback |
|
|
169
|
+
| 远程 MCP OAuth | `GITLAB_MCP_OAUTH=true` | `GITLAB_OAUTH_CALLBACK_PROXY=true` | `{MCP_SERVER_URL}/callback` |
|
|
170
|
+
|
|
171
|
+
只有当 MCP 服务器自己接收本地浏览器 callback 时,才使用 `GITLAB_OAUTH_REDIRECT_URI`。当远程 MCP 客户端拥有 callback URL 时,请使用 `GITLAB_OAUTH_CALLBACK_PROXY=true`。
|
|
172
|
+
|
|
158
173
|
**工作方式**:将此 MCP 服务器部署到拥有公开 HTTPS URL 的位置。MCP 客户端连接到 `{MCP_SERVER_URL}/mcp`。服务器处理 OAuth 2.0 流程,并代表客户端与 GitLab 交换凭据。
|
|
159
174
|
|
|
160
175
|
**前置条件:**
|
|
@@ -173,6 +188,16 @@ docker run -i --rm \
|
|
|
173
188
|
| `GITLAB_OAUTH_CALLBACK_PROXY` | 可选 | 设置为 `true` 时使用 MCP 服务器固定的 `/callback` URL |
|
|
174
189
|
| `GITLAB_OAUTH_SCOPES` | 可选 | 逗号分隔的 scope(默认:`api,read_api,read_user`) |
|
|
175
190
|
|
|
191
|
+
> **排查 `Unregistered redirect_uri`**
|
|
192
|
+
>
|
|
193
|
+
> 检查浏览器 URL 中的 `redirect_uri`。如果它指向客户端 callback,例如 `http://127.0.0.1:xxxxx/.../callback`,请启用:
|
|
194
|
+
>
|
|
195
|
+
> ```env
|
|
196
|
+
> GITLAB_OAUTH_CALLBACK_PROXY=true
|
|
197
|
+
> ```
|
|
198
|
+
>
|
|
199
|
+
> 不要通过修改 `GITLAB_OAUTH_REDIRECT_URI` 来修复远程 MCP OAuth。该变量仅用于本地 OAuth(`GITLAB_USE_OAUTH`)。
|
|
200
|
+
|
|
176
201
|
```shell
|
|
177
202
|
docker run -i --rm \
|
|
178
203
|
-e HOST=0.0.0.0 \
|