@zereight/mcp-gitlab 2.0.19 → 2.0.21

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
@@ -228,7 +228,7 @@ stdio_gitlab_mcp_client = MCPClient(
228
228
  "USE_MILESTONE",
229
229
  "-e",
230
230
  "USE_PIPELINE",
231
- "iwakitakuma/gitlab-mcp"
231
+ "zereight050/gitlab-mcp"
232
232
  ],
233
233
  "env": {
234
234
  "GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
@@ -247,6 +247,7 @@ stdio_gitlab_mcp_client = MCPClient(
247
247
 
248
248
  ```shell
249
249
  docker run -i --rm \
250
+ -e HOST=0.0.0.0 \
250
251
  -e GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token \
251
252
  -e GITLAB_API_URL="https://gitlab.com/api/v4" \
252
253
  -e GITLAB_READ_ONLY_MODE=true \
@@ -255,7 +256,7 @@ docker run -i --rm \
255
256
  -e USE_PIPELINE=true \
256
257
  -e SSE=true \
257
258
  -p 3333:3002 \
258
- iwakitakuma/gitlab-mcp
259
+ zereight050/gitlab-mcp
259
260
  ```
260
261
 
261
262
  ```json
@@ -273,6 +274,7 @@ docker run -i --rm \
273
274
 
274
275
  ```shell
275
276
  docker run -i --rm \
277
+ -e HOST=0.0.0.0 \
276
278
  -e GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token \
277
279
  -e GITLAB_API_URL="https://gitlab.com/api/v4" \
278
280
  -e GITLAB_READ_ONLY_MODE=true \
@@ -281,7 +283,7 @@ docker run -i --rm \
281
283
  -e USE_PIPELINE=true \
282
284
  -e STREAMABLE_HTTP=true \
283
285
  -p 3333:3002 \
284
- iwakitakuma/gitlab-mcp
286
+ zereight050/gitlab-mcp
285
287
  ```
286
288
 
287
289
  ```json
@@ -333,6 +335,7 @@ docker run -i --rm \
333
335
 
334
336
  #### Performance & Security Configuration
335
337
 
338
+ - `HOST`: Server host address. Default: `127.0.0.1` (localhost only). Set to `0.0.0.0` to allow external connections (required for Docker with port forwarding).
336
339
  - `MAX_SESSIONS`: Maximum number of concurrent sessions allowed. Default: `1000`. Valid range: 1-10000. When limit is reached, new connections are rejected with HTTP 503.
337
340
  - `MAX_REQUESTS_PER_MINUTE`: Rate limit per session in requests per minute. Default: `60`. Valid range: 1-1000. Exceeded requests return HTTP 429.
338
341
  - `PORT`: Server port. Default: `3002`. Valid range: 1-65535.
@@ -361,13 +364,14 @@ When using `REMOTE_AUTHORIZATION=true`, the MCP server can support multiple user
361
364
  ```bash
362
365
  # Start server with remote authorization
363
366
  docker run -d \
367
+ -e HOST=0.0.0.0 \
364
368
  -e STREAMABLE_HTTP=true \
365
369
  -e REMOTE_AUTHORIZATION=true \
366
370
  -e GITLAB_API_URL="https://gitlab.com/api/v4" \
367
371
  -e GITLAB_READ_ONLY_MODE=true \
368
372
  -e SESSION_TIMEOUT_SECONDS=3600 \
369
373
  -p 3333:3002 \
370
- iwakitakuma/gitlab-mcp
374
+ zereight050/gitlab-mcp
371
375
  ```
372
376
 
373
377
  **Client Configuration:**
package/build/index.js CHANGED
@@ -165,7 +165,7 @@ const STREAMABLE_HTTP = process.env.STREAMABLE_HTTP === "true";
165
165
  const REMOTE_AUTHORIZATION = process.env.REMOTE_AUTHORIZATION === "true";
166
166
  const ENABLE_DYNAMIC_API_URL = process.env.ENABLE_DYNAMIC_API_URL === "true";
167
167
  const SESSION_TIMEOUT_SECONDS = process.env.SESSION_TIMEOUT_SECONDS ? parseInt(process.env.SESSION_TIMEOUT_SECONDS) : 3600;
168
- const HOST = process.env.HOST || "0.0.0.0";
168
+ const HOST = process.env.HOST || "127.0.0.1";
169
169
  const PORT = process.env.PORT || 3002;
170
170
  // Add proxy configuration
171
171
  const HTTP_PROXY = process.env.HTTP_PROXY;
@@ -5166,6 +5166,14 @@ async function startStreamableHTTPServer() {
5166
5166
  await handleRequest();
5167
5167
  }
5168
5168
  });
5169
+ // Reject unsupported methods on /mcp
5170
+ app.get("/mcp", (_req, res) => {
5171
+ res.setHeader("Allow", "POST, DELETE");
5172
+ res.status(405).json({
5173
+ error: "Method Not Allowed",
5174
+ message: "GET /mcp is not supported when STREAMABLE_HTTP is enabled. Use POST to communicate with the MCP server."
5175
+ });
5176
+ });
5169
5177
  // Metrics endpoint
5170
5178
  app.get("/metrics", (_req, res) => {
5171
5179
  res.json({
@@ -216,6 +216,12 @@ describe('GitLab MCP Server - Streamable HTTP Transport', () => {
216
216
  cleanup();
217
217
  console.log('Client disconnected from Streamable HTTP server');
218
218
  });
219
+ test('should return 405 for GET /mcp', async () => {
220
+ const response = await fetch(`http://${HOST}:${port}/mcp`);
221
+ assert.strictEqual(response.status, 405, 'GET /mcp should respond with 405');
222
+ const body = await response.json();
223
+ assert.strictEqual(body?.error, 'Method Not Allowed');
224
+ });
219
225
  test('should list tools via Streamable HTTP', async () => {
220
226
  const tools = await client.listTools();
221
227
  assert.ok(tools !== null && tools !== undefined, 'Tools response should be defined');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "MCP server for using the GitLab API",
5
5
  "license": "MIT",
6
6
  "author": "zereight",
@@ -17,7 +17,8 @@
17
17
  "access": "public"
18
18
  },
19
19
  "engines": {
20
- "node": ">=14"
20
+ "node": ">=18.0.0",
21
+ "npm": ">=9.0.0"
21
22
  },
22
23
  "scripts": {
23
24
  "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",