@zereight/mcp-gitlab 1.0.55 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -2
- package/build/index.js +38 -5
- package/build/schemas.js +2 -2
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -36,8 +36,8 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
#### Docker
|
|
39
|
-
|
|
40
|
-
```json
|
|
39
|
+
- stdio
|
|
40
|
+
```mcp.json
|
|
41
41
|
{
|
|
42
42
|
"mcpServers": {
|
|
43
43
|
"GitLab communication server": {
|
|
@@ -73,6 +73,30 @@ When using with the Claude App, you need to set up your API key and URLs directl
|
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
- sse
|
|
77
|
+
```shell
|
|
78
|
+
docker run -i --rm \
|
|
79
|
+
-e GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token \
|
|
80
|
+
-e GITLAB_API_URL= "https://gitlab.com/api/v4"\
|
|
81
|
+
-e GITLAB_READ_ONLY_MODE=true \
|
|
82
|
+
-e USE_GITLAB_WIKI=true \
|
|
83
|
+
-e USE_MILESTONE=true \
|
|
84
|
+
-e USE_PIPELINE=true \
|
|
85
|
+
-e SSE=true \
|
|
86
|
+
-p 3333:3002 \
|
|
87
|
+
gitlab-mcp
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"GitLab communication server": {
|
|
94
|
+
"url": "http://localhost:3333/sse"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
76
100
|
#### Docker Image Push
|
|
77
101
|
|
|
78
102
|
```shell
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
|
|
4
5
|
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
5
6
|
import fetch from "node-fetch";
|
|
6
7
|
import { SocksProxyAgent } from "socks-proxy-agent";
|
|
@@ -12,6 +13,7 @@ import { fileURLToPath } from "url";
|
|
|
12
13
|
import { dirname } from "path";
|
|
13
14
|
import fs from "fs";
|
|
14
15
|
import path from "path";
|
|
16
|
+
import express from "express";
|
|
15
17
|
// Add type imports for proxy agents
|
|
16
18
|
import { Agent } from "http";
|
|
17
19
|
import { Agent as HttpsAgent } from 'https';
|
|
@@ -53,6 +55,7 @@ const GITLAB_READ_ONLY_MODE = process.env.GITLAB_READ_ONLY_MODE === "true";
|
|
|
53
55
|
const USE_GITLAB_WIKI = process.env.USE_GITLAB_WIKI === "true";
|
|
54
56
|
const USE_MILESTONE = process.env.USE_MILESTONE === "true";
|
|
55
57
|
const USE_PIPELINE = process.env.USE_PIPELINE === "true";
|
|
58
|
+
const SSE = process.env.SSE === "true";
|
|
56
59
|
// Add proxy configuration
|
|
57
60
|
const HTTP_PROXY = process.env.HTTP_PROXY;
|
|
58
61
|
const HTTPS_PROXY = process.env.HTTPS_PROXY;
|
|
@@ -692,12 +695,14 @@ async function listIssues(projectId, options = {}) {
|
|
|
692
695
|
// Add all query parameters
|
|
693
696
|
Object.entries(options).forEach(([key, value]) => {
|
|
694
697
|
if (value !== undefined) {
|
|
695
|
-
if (key === "
|
|
698
|
+
if (key === "labels" && Array.isArray(value)) {
|
|
696
699
|
// Handle array of labels
|
|
697
|
-
|
|
700
|
+
value.forEach(label => {
|
|
701
|
+
url.searchParams.append("labels[]", label.toString());
|
|
702
|
+
});
|
|
698
703
|
}
|
|
699
704
|
else {
|
|
700
|
-
url.searchParams.append(
|
|
705
|
+
url.searchParams.append("labels[]", value.toString());
|
|
701
706
|
}
|
|
702
707
|
}
|
|
703
708
|
});
|
|
@@ -2966,8 +2971,36 @@ async function runServer() {
|
|
|
2966
2971
|
console.error(`GitLab MCP Server v${SERVER_VERSION}`);
|
|
2967
2972
|
console.error(`API URL: ${GITLAB_API_URL}`);
|
|
2968
2973
|
console.error("========================");
|
|
2969
|
-
|
|
2970
|
-
|
|
2974
|
+
if (!SSE) {
|
|
2975
|
+
const transport = new StdioServerTransport();
|
|
2976
|
+
await server.connect(transport);
|
|
2977
|
+
}
|
|
2978
|
+
else {
|
|
2979
|
+
const app = express();
|
|
2980
|
+
const transports = {};
|
|
2981
|
+
app.get("/sse", async (_, res) => {
|
|
2982
|
+
const transport = new SSEServerTransport("/messages", res);
|
|
2983
|
+
transports[transport.sessionId] = transport;
|
|
2984
|
+
res.on("close", () => {
|
|
2985
|
+
delete transports[transport.sessionId];
|
|
2986
|
+
});
|
|
2987
|
+
await server.connect(transport);
|
|
2988
|
+
});
|
|
2989
|
+
app.post("/messages", async (req, res) => {
|
|
2990
|
+
const sessionId = req.query.sessionId;
|
|
2991
|
+
const transport = transports[sessionId];
|
|
2992
|
+
if (transport) {
|
|
2993
|
+
await transport.handlePostMessage(req, res);
|
|
2994
|
+
}
|
|
2995
|
+
else {
|
|
2996
|
+
res.status(400).send("No transport found for sessionId");
|
|
2997
|
+
}
|
|
2998
|
+
});
|
|
2999
|
+
const PORT = process.env.PORT || 3002;
|
|
3000
|
+
app.listen(PORT, () => {
|
|
3001
|
+
console.log(`Server is running on port ${PORT}`);
|
|
3002
|
+
});
|
|
3003
|
+
}
|
|
2971
3004
|
console.error("GitLab MCP Server running on stdio");
|
|
2972
3005
|
}
|
|
2973
3006
|
catch (error) {
|
package/build/schemas.js
CHANGED
|
@@ -809,10 +809,10 @@ export const ListIssuesSchema = z.object({
|
|
|
809
809
|
created_after: z.string().optional().describe("Return issues created after the given time"),
|
|
810
810
|
created_before: z.string().optional().describe("Return issues created before the given time"),
|
|
811
811
|
due_date: z.string().optional().describe("Return issues that have the due date"),
|
|
812
|
-
|
|
812
|
+
labels: z.array(z.string()).optional().describe("Array of label names"),
|
|
813
813
|
milestone: z.string().optional().describe("Milestone title"),
|
|
814
814
|
scope: z
|
|
815
|
-
.enum(["
|
|
815
|
+
.enum(["created_by_me", "assigned_to_me", "all"])
|
|
816
816
|
.optional()
|
|
817
817
|
.describe("Return issues from a specific scope"),
|
|
818
818
|
search: z.string().optional().describe("Search for specific terms"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zereight/mcp-gitlab",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.56",
|
|
4
4
|
"description": "MCP server for using the GitLab API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "zereight",
|
|
@@ -30,8 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@modelcontextprotocol/sdk": "1.8.0",
|
|
33
|
-
"form-data": "^4.0.0",
|
|
34
33
|
"@types/node-fetch": "^2.6.12",
|
|
34
|
+
"express": "^5.1.0",
|
|
35
|
+
"form-data": "^4.0.0",
|
|
35
36
|
"http-proxy-agent": "^7.0.2",
|
|
36
37
|
"https-proxy-agent": "^7.0.6",
|
|
37
38
|
"node-fetch": "^3.3.2",
|
|
@@ -39,13 +40,14 @@
|
|
|
39
40
|
"zod-to-json-schema": "^3.23.5"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
43
|
+
"@types/express": "^5.0.2",
|
|
42
44
|
"@types/node": "^22.13.10",
|
|
43
|
-
"typescript": "^5.8.2",
|
|
44
|
-
"zod": "^3.24.2",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
|
46
46
|
"@typescript-eslint/parser": "^8.21.0",
|
|
47
47
|
"eslint": "^9.18.0",
|
|
48
48
|
"prettier": "^3.4.2",
|
|
49
|
-
"ts-node": "^10.9.2"
|
|
49
|
+
"ts-node": "^10.9.2",
|
|
50
|
+
"typescript": "^5.8.2",
|
|
51
|
+
"zod": "^3.24.2"
|
|
50
52
|
}
|
|
51
53
|
}
|