opencode-gitlab-plugin 2.0.4 → 2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## [2.2.0](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.1.0...v2.2.0) (2026-04-07)
6
+
7
+
8
+ ### ✨ Features
9
+
10
+ * add system prompt hint when tools are served via lazy-mcp ([d9d8f01](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/d9d8f015a128e934d5e963aebfea9e5920f78130))
11
+
12
+ ## [2.1.0](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.0.4...v2.1.0) (2026-04-07)
13
+
14
+
15
+ ### ✨ Features
16
+
17
+ * add MCP server mode for lazy-mcp integration ([d98dd56](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/d98dd56a2d14d9d5808b4c166de107f074aad854))
18
+
5
19
  ## [2.0.4](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.0.3...v2.0.4) (2026-04-01)
6
20
 
7
21
 
package/README.md CHANGED
@@ -233,6 +233,55 @@ Then run:
233
233
  npm install
234
234
  ```
235
235
 
236
+ ## MCP Server Mode
237
+
238
+ You can also run opencode-gitlab-plugin as a standalone [MCP](https://modelcontextprotocol.io/) server over stdio. This is useful with [lazy-mcp](https://gitlab.com/gitlab-org/ai/lazy-mcp) to reduce input token context — instead of 74 tool schemas in every message, tools are lazy-loaded on demand.
239
+
240
+ ```bash
241
+ npx opencode-gitlab-plugin
242
+ ```
243
+
244
+ ### lazy-mcp Configuration
245
+
246
+ [lazy-mcp](https://gitlab.com/gitlab-org/ai/lazy-mcp) is a lightweight MCP proxy that lazy-loads tools from multiple MCP servers. Add the following to the `servers` array in `~/.config/lazy-mcp/servers.json`:
247
+
248
+ ```json
249
+ {
250
+ "name": "gitlab",
251
+ "description": "GitLab API: MRs, issues, pipelines, security, search, and more",
252
+ "type": "local",
253
+ "command": ["npx", "-y", "opencode-gitlab-plugin"],
254
+ "tags": ["gitlab", "merge-requests", "issues", "pipelines", "security"]
255
+ }
256
+ ```
257
+
258
+ Full example with lazy-mcp configured in opencode (`~/.config/opencode/opencode.json`):
259
+
260
+ ```json
261
+ {
262
+ "$schema": "https://opencode.ai/config.json",
263
+ "mcp": {
264
+ "lazy-mcp": {
265
+ "type": "local",
266
+ "command": ["npx", "-y", "lazy-mcp@latest", "--config", "~/.config/lazy-mcp/servers.json"]
267
+ }
268
+ },
269
+ "plugin": [["opencode-gitlab-plugin", { "tools": false }]]
270
+ }
271
+ ```
272
+
273
+ Setting `"tools": false` disables tool registration from the plugin. The tools are then served exclusively through the MCP server via lazy-mcp.
274
+
275
+ | Mode | Tools in context | Token cost |
276
+ | ------------------- | ------------------------- | ---------- |
277
+ | Plugin only | 74 schemas always loaded | High |
278
+ | MCP only (lazy-mcp) | 0 (lazy-loaded on demand) | Low |
279
+
280
+ ### Requirements for MCP Mode
281
+
282
+ - GitLab token via `GITLAB_TOKEN` env var or opencode auth storage (`~/.local/share/opencode/auth.json`)
283
+ - Optionally set `GITLAB_INSTANCE_URL` for self-hosted GitLab (defaults to `https://gitlab.com`)
284
+
236
285
  ## ⚙️ Configuration
237
286
 
238
287
  ### Environment Variables
package/dist/index.js CHANGED
@@ -4982,42 +4982,36 @@ Examples:
4982
4982
  };
4983
4983
 
4984
4984
  // src/index.ts
4985
- var gitlabPlugin = async (_input) => {
4985
+ var gitlabPlugin = async (_input, options) => {
4986
+ if (options?.tools === false) {
4987
+ return {
4988
+ "experimental.chat.system.transform": async (_input2, output) => {
4989
+ output.system.push(
4990
+ `## GitLab Tools via lazy-mcp
4991
+ GitLab API tools (MRs, issues, pipelines, security, search, repos, users, todos, work items, discussions, notes, audit, git, award emoji) are served via the "gitlab" MCP server through lazy-mcp. Use lazy-mcp_list_commands with server "gitlab" to discover and call them.
4992
+ DAP tools (agents, flows, memory, skills) are on the "gitlab-dap" server instead.`
4993
+ );
4994
+ }
4995
+ };
4996
+ }
4986
4997
  return {
4987
4998
  tool: {
4988
- // Merge Request Tools
4989
4999
  ...mergeRequestTools,
4990
- // Issue Tools
4991
5000
  ...issueTools,
4992
- // Epic Tools
4993
5001
  ...epicTools,
4994
- // Pipeline Tools
4995
5002
  ...pipelineTools,
4996
- // Repository Tools
4997
5003
  ...repositoryTools,
4998
- // Search Tools
4999
5004
  ...searchTools,
5000
- // Project Tools
5001
5005
  ...projectTools,
5002
- // User Tools
5003
5006
  ...userTools,
5004
- // Security Tools
5005
5007
  ...securityTools,
5006
- // TODO Tools
5007
5008
  ...todoTools,
5008
- // Wiki Tools
5009
5009
  ...wikiTools,
5010
- // Work Item Tools
5011
5010
  ...workItemTools,
5012
- // Unified Discussion Tools (covers MR, issue, epic, commit, snippet discussions)
5013
5011
  ...discussionsUnifiedTools,
5014
- // Unified Notes Tools (covers MR, issue, epic, snippet notes)
5015
5012
  ...notesUnifiedTools,
5016
- // Git Tools
5017
5013
  ...gitTools,
5018
- // Audit Tools
5019
5014
  ...auditTools,
5020
- // Award Emoji (Reactions) Tools
5021
5015
  ...awardEmojiTools
5022
5016
  }
5023
5017
  };
@@ -5027,3 +5021,4 @@ export {
5027
5021
  index_default as default,
5028
5022
  gitlabPlugin
5029
5023
  };
5024
+ //# sourceMappingURL=index.js.map