gitlab-duo-mcp-bridge 0.1.0 → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DataTalesByAgos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # gitlab-duo-mcp-bridge
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/gitlab-duo-mcp-bridge.svg)](https://www.npmjs.com/package/gitlab-duo-mcp-bridge)
4
+ [![npm downloads](https://img.shields.io/npm/dm/gitlab-duo-mcp-bridge.svg)](https://www.npmjs.com/package/gitlab-duo-mcp-bridge)
5
+ [![license](https://img.shields.io/npm/l/gitlab-duo-mcp-bridge.svg)](./LICENSE)
6
+ [![node](https://img.shields.io/node/v/gitlab-duo-mcp-bridge.svg)](https://nodejs.org)
7
+
3
8
  A tiny **MCP server** that wraps the **GitLab Duo CLI** as a single, clean,
4
9
  fault-tolerant tool: **`duo_review`**.
5
10
 
@@ -69,9 +74,30 @@ result back as clean JSON. You don't copy code around — Duo gathers it itself.
69
74
 
70
75
  ## Quick start (plug and play)
71
76
 
72
- No clone, no build, no paths to figure out. Add one line to your MCP client and
73
- `npx` downloads and runs the bridge automatically the first time your agent
74
- calls it.
77
+ No clone, no build, no paths to figure out. You can configure your environment automatically with a single command, or add it manually.
78
+
79
+ ### 1. Automatic installation (Recommended)
80
+
81
+ Run the automatic configurator from your terminal:
82
+
83
+ ```bash
84
+ npx gitlab-duo-mcp-bridge setup
85
+ ```
86
+
87
+ This script will automatically detect and configure all active MCP clients on your system:
88
+ - **Claude Desktop** (both standard and Windows Microsoft Store packages)
89
+ - **Cursor**
90
+ - **Cline** (VS Code)
91
+ - **Roo Code / Roo Cline** (VS Code)
92
+ - **Windsurf**
93
+ - **Zed**
94
+ - **Continue**
95
+
96
+ Once run, simply restart or reload your editor/agent.
97
+
98
+ ---
99
+
100
+ ### 2. Manual configuration
75
101
 
76
102
  **Claude Code:**
77
103
 
package/dist/src/index.js CHANGED
@@ -8,7 +8,12 @@
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
9
  import { loadConfig } from "./config.js";
10
10
  import { createServer } from "./server.js";
11
+ import { runSetup } from "./setup.js";
11
12
  async function main() {
13
+ if (process.argv[2] === "setup") {
14
+ await runSetup();
15
+ return;
16
+ }
12
17
  const config = loadConfig();
13
18
  const server = createServer(config);
14
19
  const transport = new StdioServerTransport();
@@ -0,0 +1,209 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ import os from "node:os";
4
+ export async function runSetup() {
5
+ const home = os.homedir();
6
+ const platform = os.platform();
7
+ const appData = process.env.APPDATA || "";
8
+ const localAppData = process.env.LOCALAPPDATA || "";
9
+ // Define client configurations and their paths
10
+ const targets = [];
11
+ const newConfigEntry = {
12
+ command: "npx",
13
+ args: ["-y", "gitlab-duo-mcp-bridge"],
14
+ };
15
+ if (platform === "win32") {
16
+ // Claude Desktop (Standard)
17
+ if (appData) {
18
+ targets.push({
19
+ name: "Claude Desktop (Standard)",
20
+ path: path.join(appData, "Claude", "claude_desktop_config.json"),
21
+ key: "mcpServers",
22
+ });
23
+ }
24
+ // Claude Desktop (MSIX)
25
+ if (localAppData) {
26
+ targets.push({
27
+ name: "Claude Desktop (MSIX)",
28
+ path: path.join(localAppData, "Packages", "Claude_pzs8sxrjxfjjc", "LocalCache", "Roaming", "Claude", "claude_desktop_config.json"),
29
+ key: "mcpServers",
30
+ });
31
+ }
32
+ // Cursor
33
+ targets.push({
34
+ name: "Cursor",
35
+ path: path.join(home, ".cursor", "mcp.json"),
36
+ key: "mcpServers",
37
+ });
38
+ // Cline
39
+ if (appData) {
40
+ targets.push({
41
+ name: "Cline (VS Code)",
42
+ path: path.join(appData, "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
43
+ key: "mcpServers",
44
+ });
45
+ }
46
+ // Roo Code
47
+ if (appData) {
48
+ targets.push({
49
+ name: "Roo Code (VS Code)",
50
+ path: path.join(appData, "Code", "User", "globalStorage", "rooveterinaryinc.roo-cline", "settings", "cline_mcp_settings.json"),
51
+ key: "mcpServers",
52
+ });
53
+ }
54
+ // Windsurf
55
+ if (appData) {
56
+ targets.push({
57
+ name: "Windsurf",
58
+ path: path.join(appData, "Windsurf", "mcp_settings.json"),
59
+ key: "mcpServers",
60
+ });
61
+ }
62
+ }
63
+ else if (platform === "darwin") {
64
+ // Claude Desktop
65
+ targets.push({
66
+ name: "Claude Desktop",
67
+ path: path.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json"),
68
+ key: "mcpServers",
69
+ });
70
+ // Cursor
71
+ targets.push({
72
+ name: "Cursor",
73
+ path: path.join(home, ".cursor", "mcp.json"),
74
+ key: "mcpServers",
75
+ });
76
+ // Cline
77
+ targets.push({
78
+ name: "Cline (VS Code)",
79
+ path: path.join(home, "Library", "Application Support", "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
80
+ key: "mcpServers",
81
+ });
82
+ // Roo Code
83
+ targets.push({
84
+ name: "Roo Code (VS Code)",
85
+ path: path.join(home, "Library", "Application Support", "Code", "User", "globalStorage", "rooveterinaryinc.roo-cline", "settings", "cline_mcp_settings.json"),
86
+ key: "mcpServers",
87
+ });
88
+ // Windsurf
89
+ targets.push({
90
+ name: "Windsurf",
91
+ path: path.join(home, ".codeium", "windsurf", "mcp_config.json"),
92
+ key: "mcpServers",
93
+ });
94
+ // Zed
95
+ targets.push({
96
+ name: "Zed",
97
+ path: path.join(home, ".config", "zed", "settings.json"),
98
+ key: "context_servers",
99
+ });
100
+ }
101
+ else {
102
+ // Linux and others
103
+ // Claude Desktop
104
+ targets.push({
105
+ name: "Claude Desktop",
106
+ path: path.join(home, ".config", "Claude", "claude_desktop_config.json"),
107
+ key: "mcpServers",
108
+ });
109
+ // Cursor
110
+ targets.push({
111
+ name: "Cursor",
112
+ path: path.join(home, ".cursor", "mcp.json"),
113
+ key: "mcpServers",
114
+ });
115
+ // Cline
116
+ targets.push({
117
+ name: "Cline (VS Code)",
118
+ path: path.join(home, ".config", "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
119
+ key: "mcpServers",
120
+ });
121
+ // Roo Code
122
+ targets.push({
123
+ name: "Roo Code (VS Code)",
124
+ path: path.join(home, ".config", "Code", "User", "globalStorage", "rooveterinaryinc.roo-cline", "settings", "cline_mcp_settings.json"),
125
+ key: "mcpServers",
126
+ });
127
+ // Windsurf
128
+ targets.push({
129
+ name: "Windsurf",
130
+ path: path.join(home, ".codeium", "windsurf", "mcp_config.json"),
131
+ key: "mcpServers",
132
+ });
133
+ // Zed
134
+ targets.push({
135
+ name: "Zed",
136
+ path: path.join(home, ".config", "zed", "settings.json"),
137
+ key: "context_servers",
138
+ });
139
+ }
140
+ // Continue-specific path (Always uses a dedicated JSON file under ~/.continue/mcpServers/)
141
+ targets.push({
142
+ name: "Continue (IDE)",
143
+ path: path.join(home, ".continue", "mcpServers", "gitlab-duo.json"),
144
+ key: "raw",
145
+ });
146
+ process.stderr.write("Iniciando la configuración automática de gitlab-duo-mcp-bridge...\n\n");
147
+ let configuredCount = 0;
148
+ for (const target of targets) {
149
+ const parentDir = path.dirname(target.path);
150
+ try {
151
+ // Check if parent directory exists
152
+ await fs.access(parentDir);
153
+ }
154
+ catch {
155
+ // Parent directory does not exist, so client is likely not installed or used. Skip it.
156
+ continue;
157
+ }
158
+ try {
159
+ let config = {};
160
+ if (target.key === "raw") {
161
+ // For dedicated JSON files (like Continue's config files under ~/.continue/mcpServers/)
162
+ // We write the standard structure directly.
163
+ config = {
164
+ mcpServers: {
165
+ "gitlab-duo": newConfigEntry,
166
+ },
167
+ };
168
+ }
169
+ else {
170
+ try {
171
+ const content = await fs.readFile(target.path, "utf8");
172
+ // Handle empty or whitespace files safely
173
+ if (content.trim() !== "") {
174
+ config = JSON.parse(content);
175
+ }
176
+ }
177
+ catch (err) {
178
+ if (err.code !== "ENOENT") {
179
+ process.stderr.write(`⚠️ No se pudo leer o parsear ${target.name} en ${target.path}: ${err.message}\n`);
180
+ continue;
181
+ }
182
+ }
183
+ const key = target.key;
184
+ if (!config[key]) {
185
+ config[key] = {};
186
+ }
187
+ config[key]["gitlab-duo"] = newConfigEntry;
188
+ }
189
+ // Ensure directory exists (just in case)
190
+ await fs.mkdir(parentDir, { recursive: true });
191
+ // Write config back
192
+ await fs.writeFile(target.path, JSON.stringify(config, null, 2), "utf8");
193
+ process.stderr.write(`✅ Configurado con éxito: ${target.name}\n └─ Ruta: ${target.path}\n`);
194
+ configuredCount++;
195
+ }
196
+ catch (err) {
197
+ process.stderr.write(`❌ Error al configurar ${target.name} en ${target.path}: ${err.message}\n`);
198
+ }
199
+ }
200
+ process.stderr.write("\n");
201
+ if (configuredCount > 0) {
202
+ process.stderr.write(`🎉 ¡Configuración completa! Se configuraron ${configuredCount} cliente(s) MCP.\n`);
203
+ process.stderr.write("Recuerda reiniciar o recargar tu cliente de IA para que detecte la herramienta 'duo_review'.\n");
204
+ }
205
+ else {
206
+ process.stderr.write("⚠️ No se encontraron directorios de configuración de clientes MCP activos.\n");
207
+ process.stderr.write("Si usas Claude Desktop, Cursor, Cline, Roo Code, Windsurf, Zed o Continue, asegúrate de haberlos instalado e iniciado al menos una vez.\n");
208
+ }
209
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitlab-duo-mcp-bridge",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "MCP server that wraps the GitLab Duo CLI as a clean, fault-tolerant duo_review tool for AI coding agents.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,6 +9,7 @@
9
9
  "files": [
10
10
  "dist/src",
11
11
  "README.md",
12
+ "LICENSE",
12
13
  ".env.example"
13
14
  ],
14
15
  "engines": {
@@ -33,6 +34,14 @@
33
34
  "ai-agents"
34
35
  ],
35
36
  "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/DataTalesByAgos/gitlab-duo-mcp-bridge.git"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/DataTalesByAgos/gitlab-duo-mcp-bridge/issues"
43
+ },
44
+ "homepage": "https://github.com/DataTalesByAgos/gitlab-duo-mcp-bridge#readme",
36
45
  "dependencies": {
37
46
  "@modelcontextprotocol/sdk": "^1.29.0",
38
47
  "zod": "^3.25.0"