gitlab-issue-creator-mcp 1.0.2 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# GitLab Issue Creator (MCP Server)
|
|
2
2
|
|
|
3
|
-
An MCP server that creates GitLab issues, compatible with self-hosted instances (default: <https://gitlab.
|
|
3
|
+
An MCP server that creates GitLab issues, compatible with self-hosted instances (default: <https://gitlab.com>).
|
|
4
4
|
|
|
5
5
|
## Tools
|
|
6
6
|
|
|
7
7
|
- `create_gitlab_issue`
|
|
8
8
|
- Required: `title`, `projectId`
|
|
9
9
|
- Optional: `description`, `labels`, `assigneeIds`, `milestoneId`, `dueDate`, `confidential`
|
|
10
|
-
- Optional overrides: `gitlabUrl
|
|
10
|
+
- Optional overrides: `gitlabUrl` (token must come from env)
|
|
11
11
|
|
|
12
12
|
## Configuration
|
|
13
13
|
|
|
14
14
|
Set env vars (recommended):
|
|
15
15
|
|
|
16
|
-
- `GITLAB_URL` (defaults to `https://gitlab.
|
|
16
|
+
- `GITLAB_URL` (defaults to `https://gitlab.com`)
|
|
17
17
|
- `GITLAB_TOKEN` (required)
|
|
18
18
|
|
|
19
19
|
See [.env.example](.env.example).
|
|
@@ -27,23 +27,21 @@ Prerequisites:
|
|
|
27
27
|
Install into an existing project:
|
|
28
28
|
|
|
29
29
|
```sh
|
|
30
|
-
npm install gitlab-issue-creator-mcp
|
|
30
|
+
npm install gitlab-issue-creator-mcp -D
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
## MCP
|
|
33
|
+
## VS Code MCP setup (npm install)
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
VS Code MCP servers are typically configured in `.vscode/mcp.json`. If you installed this package into a project, point VS Code at the installed `dist/index.js` and use `envFile` to load secrets from a local `.env` file:
|
|
36
36
|
|
|
37
37
|
```json
|
|
38
38
|
{
|
|
39
|
-
"
|
|
40
|
-
"gitlab-issue-creator": {
|
|
39
|
+
"servers": {
|
|
40
|
+
"gitlab-issue-creator-mcp": {
|
|
41
|
+
"type": "stdio",
|
|
41
42
|
"command": "node",
|
|
42
43
|
"args": ["./node_modules/gitlab-issue-creator-mcp/dist/index.js"],
|
|
43
|
-
"
|
|
44
|
-
"GITLAB_URL": "https://gitlab.org",
|
|
45
|
-
"GITLAB_TOKEN": "<your_token>"
|
|
46
|
-
}
|
|
44
|
+
"envFile": "${workspaceFolder}/.env"
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
}
|
|
@@ -52,7 +50,8 @@ Most MCP clients expect a stdio server. If you installed this package into a pro
|
|
|
52
50
|
Notes:
|
|
53
51
|
|
|
54
52
|
- Some clients require an absolute path for `args[0]`. In that case, replace the relative `./node_modules/...` path with an absolute path on your machine.
|
|
55
|
-
- `GITLAB_TOKEN` is required; `GITLAB_URL` defaults to `https://gitlab.
|
|
53
|
+
- `GITLAB_TOKEN` is required; `GITLAB_URL` defaults to `https://gitlab.com`.
|
|
54
|
+
- Keep `.env` out of source control (this repo’s `.gitignore` already ignores it). Start from the template: `cp .env.example .env`.
|
|
56
55
|
|
|
57
56
|
## Develop (from source)
|
|
58
57
|
|
|
@@ -63,11 +62,6 @@ Recommended flow for teammates:
|
|
|
63
62
|
3. Open the repo folder in VS Code
|
|
64
63
|
4. Start the MCP server (Chat tool picker or `MCP: List Servers`)
|
|
65
64
|
|
|
66
|
-
VS Code will prompt for:
|
|
67
|
-
|
|
68
|
-
- GitLab base URL (defaults to `https://gitlab.org`)
|
|
69
|
-
- GitLab access token (stored securely by VS Code)
|
|
70
|
-
|
|
71
65
|
## Develop / Build
|
|
72
66
|
|
|
73
67
|
- Install: `npm install`
|
|
@@ -9,8 +9,8 @@ function normalizeBaseUrl(url) {
|
|
|
9
9
|
return url.replace(/\/$/, "");
|
|
10
10
|
}
|
|
11
11
|
async function createGitLabIssue(params) {
|
|
12
|
-
const baseUrl = normalizeBaseUrl(params.gitlabUrl ?? process.env.GITLAB_URL ?? "https://gitlab.
|
|
13
|
-
const token =
|
|
12
|
+
const baseUrl = normalizeBaseUrl(params.gitlabUrl ?? process.env.GITLAB_URL ?? "https://gitlab.com");
|
|
13
|
+
const token = requiredEnv("GITLAB_TOKEN");
|
|
14
14
|
const projectId = params.projectId;
|
|
15
15
|
const apiUrl = `${baseUrl}/api/v4/projects/${encodeURIComponent(projectId)}/issues`;
|
|
16
16
|
const body = new URLSearchParams();
|
|
@@ -83,11 +83,7 @@ export const createGitLabIssueTool = {
|
|
|
83
83
|
confidential: { type: "boolean", description: "Create as confidential" },
|
|
84
84
|
gitlabUrl: {
|
|
85
85
|
type: "string",
|
|
86
|
-
description: "Optional override for GitLab base URL. Otherwise uses GITLAB_URL env var (defaults to https://gitlab.
|
|
87
|
-
},
|
|
88
|
-
gitlabToken: {
|
|
89
|
-
type: "string",
|
|
90
|
-
description: "Optional override for GitLab token. Otherwise uses GITLAB_TOKEN env var.",
|
|
86
|
+
description: "Optional override for GitLab base URL. Otherwise uses GITLAB_URL env var (defaults to https://gitlab.com).",
|
|
91
87
|
},
|
|
92
88
|
},
|
|
93
89
|
},
|
|
@@ -111,7 +107,6 @@ export async function handleCreateGitLabIssue(rawArgs) {
|
|
|
111
107
|
confidential: args.confidential,
|
|
112
108
|
projectId: args.projectId,
|
|
113
109
|
gitlabUrl: args.gitlabUrl,
|
|
114
|
-
gitlabToken: args.gitlabToken,
|
|
115
110
|
});
|
|
116
111
|
return {
|
|
117
112
|
content: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGitLabIssue.js","sourceRoot":"","sources":["../../src/tools/createGitLabIssue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGitLabIssue.js","sourceRoot":"","sources":["../../src/tools/createGitLabIssue.ts"],"names":[],"mappings":"AA2BA,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CA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