Skip to content

Commit 8a66de8

Browse files
authored
feat(llm-assistants): replace glab MCP with @zereight/mcp-gitlab, bump MCP server versions (#60)
* feat(llm-assistants): replace glab MCP with @zereight/mcp-gitlab Replace `glab mcp serve` with `@zereight/mcp-gitlab` (v2.0.34) for the GitLab MCP server. The old server had multiple issues: CWD git remote coupling, response body swallowing, zero per-field schema descriptions, and 172+ tools with bare types. The new server: - Calls GitLab REST API directly (no CWD dependency) - Has flat, descriptive parameter schemas on every tool - Supports toolset filtering via GITLAB_TOOLSETS (7 toolsets enabled) - Supports custom host via GITLAB_API_URL Package and integration: - Add Nix package (buildNpmPackage) for air-gapped/devvm environments - Add overlay entry in flake.nix - Self-configuring auth: reads PAT from glab CLI config, falls back to agenix secret file - Update Claude Code permissions for new tool name patterns - Update instructions with usage guidance * chore(mcp): bump mcp-server-github to v0.32.0 and mcp-server-filesystem to 2026.1.26 mcp-server-github v0.32.0 includes PR #2130 which gracefully handles numeric parameters passed as strings, fixing the type coercion issue where Claude sends "60" (string) instead of 60 (number) for pullNumber and similar fields. mcp-server-filesystem 2026.1.26 is a minor monorepo update. mcp-server-git remains at 2026.1.14 (already latest on PyPI).
1 parent 7f2dd11 commit 8a66de8

File tree

8 files changed

+103
-19
lines changed

8 files changed

+103
-19
lines changed

.cspell/words.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ toolsai
206206
tulanp
207207
twikoo
208208
ulimits
209+
unapprove
209210
unhinted
210211
usernamehw
211212
utun
@@ -228,5 +229,6 @@ xsel
228229
xtls
229230
xtype
230231
yzhang
232+
zereight
231233
zstd
232234
zstyle

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
mcp-server-filesystem = final.callPackage ./packages/mcp/mcp-server-filesystem { };
8383
mcp-server-git = final.callPackage ./packages/mcp/mcp-server-git { };
8484
mcp-server-github = final.callPackage ./packages/mcp/mcp-server-github { };
85+
mcp-server-gitlab = final.callPackage ./packages/mcp/mcp-server-gitlab { };
8586
peertube = final.unstable.peertube.overrideAttrs (old: {
8687
patches = (old.patches or [ ]) ++ [
8788
./packages/peertube/cdn-redirect-runner.patch

home/modules/llm-assistants/claude-code/permissions.nix

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,35 @@
386386
"mcp__GitHub__push_files"
387387
"mcp__GitHub__sub_issue_write"
388388
"mcp__GitHub__update_pull_request"
389-
"mcp__GitLab__glab_mr_create"
390-
"mcp__GitLab__glab_mr_merge"
391-
"mcp__GitLab__glab_mr_close"
392-
"mcp__GitLab__glab_mr_delete"
393-
"mcp__GitLab__glab_issue_create"
394-
"mcp__GitLab__glab_issue_close"
395-
"mcp__GitLab__glab_issue_delete"
396-
"mcp__GitLab__glab_release_create"
397-
"mcp__GitLab__glab_release_delete"
398-
"mcp__GitLab__glab_repo_create"
399-
"mcp__GitLab__glab_repo_delete"
389+
"mcp__GitLab__approve_merge_request"
390+
"mcp__GitLab__create_branch"
391+
"mcp__GitLab__create_issue"
392+
"mcp__GitLab__create_issue_link"
393+
"mcp__GitLab__create_issue_note"
394+
"mcp__GitLab__create_label"
395+
"mcp__GitLab__create_merge_request"
396+
"mcp__GitLab__create_merge_request_discussion_note"
397+
"mcp__GitLab__create_merge_request_note"
398+
"mcp__GitLab__create_merge_request_thread"
399+
"mcp__GitLab__create_note"
400+
"mcp__GitLab__create_or_update_file"
401+
"mcp__GitLab__create_pipeline"
402+
"mcp__GitLab__create_repository"
403+
"mcp__GitLab__delete_issue"
404+
"mcp__GitLab__delete_issue_link"
405+
"mcp__GitLab__delete_label"
406+
"mcp__GitLab__delete_merge_request_discussion_note"
407+
"mcp__GitLab__delete_merge_request_note"
408+
"mcp__GitLab__merge_merge_request"
409+
"mcp__GitLab__push_files"
410+
"mcp__GitLab__resolve_merge_request_thread"
411+
"mcp__GitLab__unapprove_merge_request"
412+
"mcp__GitLab__update_issue"
413+
"mcp__GitLab__update_issue_note"
414+
"mcp__GitLab__update_label"
415+
"mcp__GitLab__update_merge_request"
416+
"mcp__GitLab__update_merge_request_discussion_note"
417+
"mcp__GitLab__update_merge_request_note"
400418

401419
# --------------------------------------------------------------------------
402420
# Nix

home/modules/llm-assistants/shared/instructions/claude-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Use for all GitHub API interactions. Prefer over `gh` CLI commands because MCP p
4949

5050
### GitLab (`mcp__GitLab__*`)
5151

52-
Use for all GitLab API interactions. Prefer over `glab` CLI commands because MCP provides structured responses. For repository exploration on GitLab, use `glab_repo_view` and `glab_api` (analogous to DeepWiki for GitHub).
52+
Use for all GitLab API interactions. Powered by `@zereight/mcp-gitlab` with flat, descriptive parameter schemas. Prefer over `glab` CLI commands. Use `project_id` as the URL-encoded project path (e.g., `group/subgroup/project`).
5353

5454
### IDE (`mcp__ide__*`)
5555

home/modules/llm-assistants/shared/mcp/default.nix

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,33 @@ let
9393
# ----------------------------------------------------------------------------
9494
# GitLab
9595
# ----------------------------------------------------------------------------
96+
glabBin = "${config.home.profileDirectory}/bin/glab";
97+
gitlabPatFile = "${secretsDir}/gitlab-pat";
98+
gitlabToolsets = lib.concatStringsSep "," [
99+
"branches"
100+
"issues"
101+
"labels"
102+
"merge_requests"
103+
"pipelines"
104+
"projects"
105+
"repositories"
106+
];
96107
gitlabBin = pkgs.writeShellScriptBin "gitlab-mcp" ''
97-
exec "${config.home.profileDirectory}/bin/glab" mcp serve "$@"
108+
if [ -x "${glabBin}" ]; then
109+
host=$("${glabBin}" config get host 2>/dev/null || true)
110+
if [ -n "$host" ]; then
111+
token=$("${glabBin}" config get token --host "$host" 2>/dev/null || true)
112+
if [ -n "$token" ]; then
113+
export GITLAB_PERSONAL_ACCESS_TOKEN="$token"
114+
export GITLAB_API_URL="https://''${host}/api/v4"
115+
fi
116+
fi
117+
fi
118+
if [ -z "''${GITLAB_PERSONAL_ACCESS_TOKEN:-}" ] && [ -f "${gitlabPatFile}" ]; then
119+
export GITLAB_PERSONAL_ACCESS_TOKEN="$(cat ${gitlabPatFile})"
120+
fi
121+
export GITLAB_TOOLSETS="${gitlabToolsets}"
122+
exec ${pkgs.mcp-server-gitlab}/bin/mcp-server-gitlab "$@"
98123
'';
99124
in
100125
{

packages/mcp/mcp-server-filesystem/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
pkgs.buildNpmPackage rec {
1212
pname = "mcp-server-filesystem";
13-
version = "2026.1.14";
13+
version = "2026.1.26";
1414

1515
src = pkgs.fetchFromGitHub {
1616
owner = "modelcontextprotocol";
1717
repo = "servers";
1818
rev = version;
19-
hash = "sha256-KL2YmxcXAVvGFuaaWQUOrbBl1JoZMtiGbjcxnFnMV8c=";
19+
hash = "sha256-uULXUEHFZpYm/fmF6PkOFCxS+B+0q3dMveLG+3JHrhk=";
2020
};
2121

22-
npmDepsHash = "sha256-NgRIzWZbXhfQp+1e9XUdh5/OlziVCBHH39paTaiQOKg=";
22+
npmDepsHash = "sha256-jmz4JdpeHH07vJQFntBwrENbJaIcOuZMb7+qf497VOE=";
2323

2424
# Monorepo: build the filesystem workspace
2525
npmWorkspace = "src/filesystem";

packages/mcp/mcp-server-github/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
let
1212
inherit (pkgs.stdenv.hostPlatform) isLinux;
13-
version = "0.29.0";
13+
version = "0.32.0";
1414
baseUrl = "https://github.com/github/github-mcp-server/releases/download/v${version}";
1515

1616
sources = {
1717
aarch64-darwin = {
1818
url = "${baseUrl}/github-mcp-server_Darwin_arm64.tar.gz";
19-
hash = "sha256-/5mSea5DyMCo9A7gnMJM1beNo1E4uBoqTZhpzqsAtHs=";
19+
hash = "sha256-Q1V8kDoT/OmQl14K30P33OCFRCv8AGkt5ioe1ltBYXo=";
2020
};
2121
x86_64-linux = {
2222
url = "${baseUrl}/github-mcp-server_Linux_x86_64.tar.gz";
23-
hash = "sha256-m6qsu0CP64OWHKvQ+2RCMXE8biht7aiB0SHngE2qa7Q=";
23+
hash = "sha256-yQ/L1oG3Fv24RcxuGfiPrBwm/sC4CEsR7zn8QQoX4wQ=";
2424
};
2525
};
2626

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
pkgs,
3+
lib,
4+
...
5+
}:
6+
7+
# ==============================================================================
8+
# MCP Server – GitLab (@zereight/mcp-gitlab)
9+
# ==============================================================================
10+
11+
pkgs.buildNpmPackage rec {
12+
pname = "mcp-server-gitlab";
13+
version = "2.0.34";
14+
15+
src = pkgs.fetchFromGitHub {
16+
owner = "zereight";
17+
repo = "gitlab-mcp";
18+
rev = "v${version}";
19+
hash = "sha256-g7r0hInk4u4thR/8c8dVOqSc9VWHkx8jYa7sO6l8B+U=";
20+
};
21+
22+
npmDepsHash = "sha256-tJou/TMZZvlPiMJgEEpE7oj3+B1XMrcCdQBDcNHsNxE=";
23+
24+
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
25+
26+
postInstall = ''
27+
makeWrapper "${pkgs.nodejs}/bin/node" "$out/bin/mcp-server-gitlab" \
28+
--add-flags "$out/lib/node_modules/@zereight/mcp-gitlab/build/index.js"
29+
'';
30+
31+
meta = {
32+
description = "MCP server for GitLab API operations (@zereight/mcp-gitlab)";
33+
homepage = "https://github.com/zereight/gitlab-mcp";
34+
license = lib.licenses.mit;
35+
platforms = lib.platforms.unix;
36+
mainProgram = "mcp-server-gitlab";
37+
};
38+
}

0 commit comments

Comments
 (0)