From 3094f2f0ceb24e1d715a84e7fe03c410ebb5577c Mon Sep 17 00:00:00 2001 From: trick77 Date: Fri, 8 May 2026 10:38:39 +0200 Subject: [PATCH 1/3] 0.3.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6f1a4d..b467625 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opencode-presets", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opencode-presets", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "dependencies": { "ajv": "8.20.0", diff --git a/package.json b/package.json index 4e7a8da..e21075d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencode-presets", - "version": "0.3.0", + "version": "0.3.1", "description": "Interactive CLI that patches opencode.json with curated config presets — LSP, MCP, permissions.", "type": "module", "bin": { From 4bf223599843c6bfc493b2d54b2d83dc8c21c445 Mon Sep 17 00:00:00 2001 From: trick77 Date: Fri, 8 May 2026 10:39:17 +0200 Subject: [PATCH 2/3] 0.3.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b467625..ec41305 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opencode-presets", - "version": "0.3.1", + "version": "0.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opencode-presets", - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "dependencies": { "ajv": "8.20.0", diff --git a/package.json b/package.json index e21075d..6ecaff2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencode-presets", - "version": "0.3.1", + "version": "0.3.2", "description": "Interactive CLI that patches opencode.json with curated config presets — LSP, MCP, permissions.", "type": "module", "bin": { From 938f2583d9b2e500535bc4284a7f6a165c6e4c33 Mon Sep 17 00:00:00 2001 From: trick77 Date: Sat, 9 May 2026 12:06:05 +0200 Subject: [PATCH 3/3] refactor(mcp): rename mcp-remote-add to mcp-http, generalize header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous name implied the server had to be off-machine, but opencode's `type: "remote"` is just HTTP transport — the URL can point to localhost. Renamed to mcp-http / mcp-http-noauth, which also matches the existing `-` naming pattern in presets/. Generalized the auth variant beyond hardcoded `Authorization: Bearer `: it now prompts for a header name and value so the same preset covers bearer auth, upstream API tokens (e.g. X-Bitbucket-Token), and other custom headers needed by MCP servers that proxy to backend services. Breaking change for users referencing the old preset names. --- README.md | 6 +++--- presets/mcp-http-noauth.conf | 16 ++++++++++++++++ presets/mcp-http.conf | 23 +++++++++++++++++++++++ presets/mcp-remote-add-noauth.conf | 16 ---------------- presets/mcp-remote-add.conf | 21 --------------------- 5 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 presets/mcp-http-noauth.conf create mode 100644 presets/mcp-http.conf delete mode 100644 presets/mcp-remote-add-noauth.conf delete mode 100644 presets/mcp-remote-add.conf diff --git a/README.md b/README.md index 48888af..1c6cfaf 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ each write — no auto-pruning, so they pile up. | --- | --- | --- | --- | | `jdtls-lombok` | LSP | replace | Makes jdtls lombok-aware via `-javaagent` flag | | `jdtls-clean-workspace` | LSP | replace | Stops jdtls from writing `.project`/`.classpath`/etc. into your project root | -| `mcp-remote-add` | MCP | replace | Add a remote MCP server with bearer-token auth (prompts for id, URL, token) | -| `mcp-remote-add-noauth` | MCP | replace | Add a remote MCP server without auth (prompts for id, URL) | +| `mcp-http` | MCP | replace | Add an HTTP MCP server (localhost or remote) with one custom header (prompts for id, URL, header name, header value) | +| `mcp-http-noauth` | MCP | replace | Add an HTTP MCP server (localhost or remote) without auth headers (prompts for id, URL) | | `mcp-intellij` | MCP | replace | Add the JetBrains IDE MCP server (loopback HTTP, default port 64342) | | `mcp-vscode` | MCP | replace | Add the VS Code MCP server via the `JuehangQin.vscode-mcp-server` extension (loopback HTTP, default port 3000) | | `permissions-git-safe` | Permissions | merge | Read-only git commands (status, diff, log, branch --list, fetch, etc.) | @@ -55,7 +55,7 @@ opencode-presets install jdtls-lombok jdtls-clean-workspace opencode-presets install permissions-git-safe permissions-shell-safe ``` -Presets whose path uses a prompt (like `mcp-remote-add`) can't be +Presets whose path uses a prompt (like `mcp-http`) can't be removed with `remove` — use `reset` instead: ```sh diff --git a/presets/mcp-http-noauth.conf b/presets/mcp-http-noauth.conf new file mode 100644 index 0000000..76f2f50 --- /dev/null +++ b/presets/mcp-http-noauth.conf @@ -0,0 +1,16 @@ +// @name: mcp-http-noauth +// @description: Adds an HTTP MCP server to opencode (URL can be +// localhost or remote) with no auth headers. Use this for open +// servers or for OAuth (which opencode handles separately). For +// a single custom header (bearer token, upstream API token, etc.), +// use mcp-http instead. +// @author: Jan +// @version: 0.2.0 +// @path: mcp.{{prompt:name}} +// @prompt: name | text | server identifier (key under mcp) +// @prompt: url | text | server URL +{ + "type": "remote", + "url": "{{prompt:url}}", + "enabled": true +} diff --git a/presets/mcp-http.conf b/presets/mcp-http.conf new file mode 100644 index 0000000..75aef03 --- /dev/null +++ b/presets/mcp-http.conf @@ -0,0 +1,23 @@ +// @name: mcp-http +// @description: Adds an HTTP MCP server to opencode (URL can be +// localhost or remote) with one custom request header. Use this for +// bearer auth (header name "Authorization", value "Bearer ") +// or for upstream credentials the MCP server forwards to a backend +// service such as Bitbucket, GitHub, or Jira. For multi-header setups, +// run the preset and then edit opencode.json by hand. For servers +// without auth headers, use mcp-http-noauth. +// @author: Jan +// @version: 0.2.0 +// @path: mcp.{{prompt:name}} +// @prompt: name | text | server identifier (key under mcp, e.g. openrag-tom) +// @prompt: url | text | server URL (e.g. https://my-mcp.example.com/mcp or http://localhost:8080/mcp) +// @prompt: headerName | text | request header name (e.g. Authorization, X-Bitbucket-Token) +// @prompt: headerValue | secret | request header value (e.g. "Bearer " or a raw token) +{ + "type": "remote", + "url": "{{prompt:url}}", + "enabled": true, + "headers": { + "{{prompt:headerName}}": "{{prompt:headerValue}}" + } +} diff --git a/presets/mcp-remote-add-noauth.conf b/presets/mcp-remote-add-noauth.conf deleted file mode 100644 index 93496f0..0000000 --- a/presets/mcp-remote-add-noauth.conf +++ /dev/null @@ -1,16 +0,0 @@ -// @name: mcp-remote-add-noauth -// @description: Adds a remote (HTTP) MCP server to opencode WITHOUT -// any auth header. Prompts for the server identifier (the key under -// `mcp`, e.g. `my-server`) and the URL. Use this for MCP servers -// that are open or use OAuth (which opencode handles separately). -// For bearer-token auth, use mcp-remote-add instead. -// @author: Jan -// @version: 0.1.0 -// @path: mcp.{{prompt:name}} -// @prompt: name | text | server identifier (key under mcp) -// @prompt: url | text | server URL -{ - "type": "remote", - "url": "{{prompt:url}}", - "enabled": true -} diff --git a/presets/mcp-remote-add.conf b/presets/mcp-remote-add.conf deleted file mode 100644 index f03b117..0000000 --- a/presets/mcp-remote-add.conf +++ /dev/null @@ -1,21 +0,0 @@ -// @name: mcp-remote-add -// @description: Adds a remote (HTTP) MCP server to opencode and -// authenticates it with a bearer token. Prompts for the server -// identifier (the key under `mcp`, e.g. `openrag-tom`), the URL, -// and the bearer token. The token is written into opencode.json -// under the server's Authorization header. Re-running with the -// same identifier overwrites that server's entry. -// @author: Jan -// @version: 0.1.0 -// @path: mcp.{{prompt:name}} -// @prompt: name | text | server identifier (key under mcp, e.g. openrag-tom) -// @prompt: url | text | server URL (e.g. https://my-mcp.example.com/mcp) -// @prompt: token | secret | bearer token -{ - "type": "remote", - "url": "{{prompt:url}}", - "enabled": true, - "headers": { - "Authorization": "Bearer {{prompt:token}}" - } -}