opencode-gitlab-plugin 2.0.4 → 2.1.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,13 @@
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.1.0](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.0.4...v2.1.0) (2026-04-07)
6
+
7
+
8
+ ### ✨ Features
9
+
10
+ * add MCP server mode for lazy-mcp integration ([d98dd56](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/d98dd56a2d14d9d5808b4c166de107f074aad854))
11
+
5
12
  ## [2.0.4](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.0.3...v2.0.4) (2026-04-01)
6
13
 
7
14
 
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,28 @@ 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
+ }
4986
4989
  return {
4987
4990
  tool: {
4988
- // Merge Request Tools
4989
4991
  ...mergeRequestTools,
4990
- // Issue Tools
4991
4992
  ...issueTools,
4992
- // Epic Tools
4993
4993
  ...epicTools,
4994
- // Pipeline Tools
4995
4994
  ...pipelineTools,
4996
- // Repository Tools
4997
4995
  ...repositoryTools,
4998
- // Search Tools
4999
4996
  ...searchTools,
5000
- // Project Tools
5001
4997
  ...projectTools,
5002
- // User Tools
5003
4998
  ...userTools,
5004
- // Security Tools
5005
4999
  ...securityTools,
5006
- // TODO Tools
5007
5000
  ...todoTools,
5008
- // Wiki Tools
5009
5001
  ...wikiTools,
5010
- // Work Item Tools
5011
5002
  ...workItemTools,
5012
- // Unified Discussion Tools (covers MR, issue, epic, commit, snippet discussions)
5013
5003
  ...discussionsUnifiedTools,
5014
- // Unified Notes Tools (covers MR, issue, epic, snippet notes)
5015
5004
  ...notesUnifiedTools,
5016
- // Git Tools
5017
5005
  ...gitTools,
5018
- // Audit Tools
5019
5006
  ...auditTools,
5020
- // Award Emoji (Reactions) Tools
5021
5007
  ...awardEmojiTools
5022
5008
  }
5023
5009
  };
@@ -5027,3 +5013,4 @@ export {
5027
5013
  index_default as default,
5028
5014
  gitlabPlugin
5029
5015
  };
5016
+ //# sourceMappingURL=index.js.map