@jmrp.io/gitlab-mcp-server 2.7.5
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 +68 -0
- package/cli.js +106 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @jmrp.io/gitlab-mcp-server
|
|
2
|
+
|
|
3
|
+
A [Model Context Protocol](https://modelcontextprotocol.io) server that exposes
|
|
4
|
+
the GitLab REST v4 and GraphQL APIs as tools for AI assistants. It runs as a
|
|
5
|
+
local binary over stdio (default) or HTTP.
|
|
6
|
+
|
|
7
|
+
This package is a thin launcher. The actual server is a prebuilt Go binary that
|
|
8
|
+
ships inside a per-platform package; npm installs only the one matching your
|
|
9
|
+
operating system and CPU, so there is nothing to compile and nothing is
|
|
10
|
+
downloaded at install time.
|
|
11
|
+
|
|
12
|
+
## Run without installing
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx @jmrp.io/gitlab-mcp-server
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Most MCP clients are configured to launch the server this way. For example:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"gitlab": {
|
|
24
|
+
"command": "npx",
|
|
25
|
+
"args": ["-y", "@jmrp.io/gitlab-mcp-server"],
|
|
26
|
+
"env": {
|
|
27
|
+
"GITLAB_URL": "https://gitlab.com",
|
|
28
|
+
"GITLAB_TOKEN": "glpat-…"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g @jmrp.io/gitlab-mcp-server
|
|
39
|
+
gitlab-mcp-server --help
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
|
|
44
|
+
`GITLAB_URL` and `GITLAB_TOKEN` are the two required environment variables in
|
|
45
|
+
stdio mode. Every flag and variable — HTTP mode, OAuth, read-only and safe
|
|
46
|
+
modes, tool surfaces, tiers — is documented in the
|
|
47
|
+
[configuration reference](https://jmrp.io/docs/gitlab-mcp-server/reference/configuration).
|
|
48
|
+
|
|
49
|
+
## Auto-update is off under npm
|
|
50
|
+
|
|
51
|
+
The server can update itself in place, but that is disabled here: npm owns the
|
|
52
|
+
binary, and letting it replace itself would desynchronize what npm has
|
|
53
|
+
recorded. Update with your package manager instead (`npm update -g
|
|
54
|
+
@jmrp.io/gitlab-mcp-server`). Setting `AUTO_UPDATE` explicitly still takes
|
|
55
|
+
effect if you have a reason to override it.
|
|
56
|
+
|
|
57
|
+
## Supported platforms
|
|
58
|
+
|
|
59
|
+
Linux, macOS and Windows, on x64 and arm64. On any other platform the launcher
|
|
60
|
+
exits with a message pointing to the
|
|
61
|
+
[release binaries](https://github.com/jmrplens/gitlab-mcp-server/releases) and
|
|
62
|
+
the option to build from source.
|
|
63
|
+
|
|
64
|
+
## Links
|
|
65
|
+
|
|
66
|
+
- Documentation: <https://jmrp.io/docs/gitlab-mcp-server>
|
|
67
|
+
- Source and issues: <https://github.com/jmrplens/gitlab-mcp-server>
|
|
68
|
+
- License: MIT
|
package/cli.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// cli.js resolves the prebuilt gitlab-mcp-server binary for the current
|
|
3
|
+
// platform and hands control to it. The binary ships inside a per-platform
|
|
4
|
+
// optional dependency (see the package's optionalDependencies); npm installs
|
|
5
|
+
// only the one whose os/cpu match, and this launcher execs it.
|
|
6
|
+
//
|
|
7
|
+
// It is a thin shim on purpose. The server speaks MCP over stdio, so stdio is
|
|
8
|
+
// inherited untouched; argv is forwarded verbatim; the child's exit code and
|
|
9
|
+
// terminating signal are mirrored so `npx` callers and process supervisors see
|
|
10
|
+
// the real outcome.
|
|
11
|
+
"use strict";
|
|
12
|
+
|
|
13
|
+
const { spawnSync } = require("node:child_process");
|
|
14
|
+
|
|
15
|
+
// platformKey maps Node's platform/arch names to the per-platform package
|
|
16
|
+
// suffix. The suffixes follow Node's vocabulary (win32, x64), not Go's
|
|
17
|
+
// (windows, amd64); the release generator translates when it builds each
|
|
18
|
+
// package, so the two never have to agree at runtime.
|
|
19
|
+
function platformKey() {
|
|
20
|
+
const platform = process.platform;
|
|
21
|
+
const arch = process.arch;
|
|
22
|
+
const supported = {
|
|
23
|
+
"linux-x64": true,
|
|
24
|
+
"linux-arm64": true,
|
|
25
|
+
"darwin-x64": true,
|
|
26
|
+
"darwin-arm64": true,
|
|
27
|
+
"win32-x64": true,
|
|
28
|
+
"win32-arm64": true,
|
|
29
|
+
};
|
|
30
|
+
const key = `${platform}-${arch}`;
|
|
31
|
+
return supported[key] ? key : null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function binaryName() {
|
|
35
|
+
return process.platform === "win32"
|
|
36
|
+
? "gitlab-mcp-server.exe"
|
|
37
|
+
: "gitlab-mcp-server";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// resolveBinary finds the binary inside the matching per-platform package.
|
|
41
|
+
// require.resolve walks the same node_modules the launcher was loaded from, so
|
|
42
|
+
// it finds the dependency whether the install is flat, nested, hoisted, or run
|
|
43
|
+
// through npx's throwaway prefix.
|
|
44
|
+
function resolveBinary(key) {
|
|
45
|
+
const pkg = `@jmrp.io/gitlab-mcp-server-${key}`;
|
|
46
|
+
try {
|
|
47
|
+
return require.resolve(`${pkg}/${binaryName()}`);
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function fail(message) {
|
|
54
|
+
process.stderr.write(`gitlab-mcp-server: ${message}\n`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const key = platformKey();
|
|
59
|
+
if (!key) {
|
|
60
|
+
fail(
|
|
61
|
+
`unsupported platform ${process.platform}/${process.arch}. ` +
|
|
62
|
+
"Prebuilt binaries exist for linux, macOS and Windows on x64 and arm64; " +
|
|
63
|
+
"for anything else, build from source or use a released binary directly " +
|
|
64
|
+
"(https://github.com/jmrplens/gitlab-mcp-server/releases).",
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const binary = resolveBinary(key);
|
|
69
|
+
if (!binary) {
|
|
70
|
+
// The platform is supported but its package is absent. The usual cause is an
|
|
71
|
+
// install that skipped optional dependencies (npm install --no-optional, or
|
|
72
|
+
// a lockfile pinned on a different OS), not a broken release.
|
|
73
|
+
fail(
|
|
74
|
+
`the @jmrp.io/gitlab-mcp-server-${key} package is not installed. ` +
|
|
75
|
+
"It is an optional dependency that carries the binary for this platform; " +
|
|
76
|
+
"reinstall without --no-optional, or delete node_modules and the lockfile " +
|
|
77
|
+
"and install again.",
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Self-update must stay off: npm owns this binary, and letting it replace
|
|
82
|
+
// itself on disk would desynchronize what npm believes is installed — the same
|
|
83
|
+
// reason the Homebrew formula and the Claude Desktop manifest pin it off. An
|
|
84
|
+
// explicit AUTO_UPDATE from the caller still wins.
|
|
85
|
+
const env = { ...process.env };
|
|
86
|
+
if (env.AUTO_UPDATE === undefined) {
|
|
87
|
+
env.AUTO_UPDATE = "false";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const result = spawnSync(binary, process.argv.slice(2), {
|
|
91
|
+
stdio: "inherit",
|
|
92
|
+
env,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (result.error) {
|
|
96
|
+
fail(`failed to start the binary: ${result.error.message}`);
|
|
97
|
+
}
|
|
98
|
+
// A child killed by a signal reports null status and a signal name. Re-raise it
|
|
99
|
+
// so the launcher dies the same way rather than masking a SIGINT as exit 0.
|
|
100
|
+
if (result.signal) {
|
|
101
|
+
process.kill(process.pid, result.signal);
|
|
102
|
+
// If the re-raise did not terminate us (signal ignored), fall through to a
|
|
103
|
+
// conventional 128+signal code so the caller still sees a failure.
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jmrp.io/gitlab-mcp-server",
|
|
3
|
+
"version": "2.7.5",
|
|
4
|
+
"description": "Model Context Protocol (MCP) server exposing GitLab REST v4 and GraphQL as tools for AI assistants. Runs as a local binary over stdio or HTTP.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"gitlab",
|
|
9
|
+
"ai",
|
|
10
|
+
"llm",
|
|
11
|
+
"claude",
|
|
12
|
+
"stdio",
|
|
13
|
+
"cli"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://jmrp.io/docs/gitlab-mcp-server",
|
|
16
|
+
"bugs": "https://github.com/jmrplens/gitlab-mcp-server/issues",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/jmrplens/gitlab-mcp-server.git",
|
|
20
|
+
"directory": "npm/gitlab-mcp-server"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "José M. Requena Plens",
|
|
24
|
+
"type": "commonjs",
|
|
25
|
+
"bin": {
|
|
26
|
+
"gitlab-mcp-server": "cli.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"cli.js",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"optionalDependencies": {
|
|
33
|
+
"@jmrp.io/gitlab-mcp-server-linux-x64": "2.7.5",
|
|
34
|
+
"@jmrp.io/gitlab-mcp-server-linux-arm64": "2.7.5",
|
|
35
|
+
"@jmrp.io/gitlab-mcp-server-darwin-x64": "2.7.5",
|
|
36
|
+
"@jmrp.io/gitlab-mcp-server-darwin-arm64": "2.7.5",
|
|
37
|
+
"@jmrp.io/gitlab-mcp-server-win32-x64": "2.7.5",
|
|
38
|
+
"@jmrp.io/gitlab-mcp-server-win32-arm64": "2.7.5"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
}
|
|
43
|
+
}
|