opencode-gitlab-plugin 2.0.3 → 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,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.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
+
12
+ ## [2.0.4](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.0.3...v2.0.4) (2026-04-01)
13
+
14
+
15
+ ### ♻️ Code Refactoring
16
+
17
+ * remove DAP agent/flow tools (moved to opencode-gitlab-dap) ([9377e43](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/9377e430b72ecddcbefda866b9fc9262d96a9963))
18
+
5
19
  ## [2.0.3](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.0.2...v2.0.3) (2026-03-22)
6
20
 
7
21
 
package/README.md CHANGED
@@ -40,6 +40,11 @@ A comprehensive GitLab API plugin for OpenCode that provides AI-powered access t
40
40
  - **🔧 Git Commands**: Execute safe, read-only git operations
41
41
  - **👥 Project Management**: Member management and project details
42
42
 
43
+ ### Companion Plugin: DAP (Duo Agent Platform)
44
+
45
+ For GitLab AI Catalog agent/flow management, flow execution, and `@` menu integration,
46
+ see [opencode-gitlab-dap](https://gitlab.com/vglafirov/opencode-gitlab-dap).
47
+
43
48
  ### Technical Features
44
49
 
45
50
  - **TypeScript**: Full type safety with comprehensive type definitions
@@ -53,7 +58,7 @@ A comprehensive GitLab API plugin for OpenCode that provides AI-powered access t
53
58
  - **Rate Limiting**: Built-in handling for GitLab API rate limits
54
59
  - **Caching**: Efficient API response handling
55
60
  - **Modular Architecture**: Clean separation of concerns with client and tool modules
56
- - **Comprehensive Testing**: 180 tests with full coverage of all features
61
+ - **Comprehensive Testing**: 225 tests with full coverage of all features
57
62
 
58
63
  ### GraphQL-Powered Tools
59
64
 
@@ -228,6 +233,55 @@ Then run:
228
233
  npm install
229
234
  ```
230
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
+
231
285
  ## ⚙️ Configuration
232
286
 
233
287
  ### Environment Variables
@@ -755,7 +809,7 @@ opencode-gitlab-plugin/
755
809
  │ ├── index.ts # Main plugin entry point
756
810
  │ ├── utils.ts # Utility functions
757
811
  │ └── validation.ts # GID validation utilities
758
- ├── tests/ # Test suite (180 tests)
812
+ ├── tests/ # Test suite (225 tests)
759
813
  │ ├── client/ # Client tests
760
814
  │ ├── tools/ # Tool tests
761
815
  │ ├── validation.test.ts # Validation tests
@@ -877,7 +931,7 @@ npm run test:coverage
877
931
 
878
932
  **Test Coverage:**
879
933
 
880
- - **180 tests** across 21 test files
934
+ - **225 tests** across 25 test files
881
935
  - Client tests for all API methods (REST and GraphQL)
882
936
  - Tool tests for all tool definitions
883
937
  - Validation tests for GID utilities
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