Files
skillshare/website/docs/reference
Willie f540daf601 fix(mcp): turn off a global server in OpenCode 2 projects (#541)
* fix(mcp): turn off a global server in OpenCode 2 projects

OpenCode 2 replaces a global server with the project entry of the same
name, and silently drops an entry without its type and command or url.
The project switch Skillshare wrote, {"enabled": false}, therefore left
the server on in OpenCode 2, while OpenCode 1 merged it by field.

Checked against OpenCode 2.0.27 and 1.19.0: OpenCode 2 still reads the
flat mcp.<name> shape and turns enabled: false into disabled: true, and
both read an entry with type and command or url. So no version detection
is needed. When the global config under mcp.projects defines the server,
the OpenCode switch now carries its type and executable, or its url
without the query, next to enabled: false. Args, env, headers and the
query stay out of a project file that may be committed, as the Pi switch
once did. A switch that already carries the endpoint keeps it when the
global server later leaves the config, unless it was edited since sync.

In project mode, or when the global config lacks the server, only the
bare switch can be written; the plan now says OpenCode 2 ignores it, in
the CLI and the dashboard.

Import also reads OpenCode 2's mcp.servers section, which its own
`mcp add` writes, instead of reporting it as one broken server.

Refs #538

* fix(mcp): keep secrets in a URL path out of the OpenCode switch

The OpenCode switch dropped only the query of the global server's URL.
Some MCP services put the key in the path instead, and an absolute
executable path names the user's home directory; both then reached a
project file that may be committed. A disabled server never starts, and
OpenCode 2 accepts any type with a command or url, so the switch now
carries only the executable's name or the URL's scheme and host.

Refs #538

* fix(mcp): skip OpenCode 2's timeout defaults when importing

OpenCode 2 keeps server defaults in mcp.timeout next to mcp.servers, so
import listed timeout as a broken server. It is dropped only together
with a recognized servers section, where it cannot be a v1 server.

Refs #538

* fix(mcp): read an empty OpenCode 2 servers section

An empty mcp.servers object was not recognized as OpenCode 2's section,
so import listed servers and timeout as broken servers instead of
finding no entries. The dashboard help for disabled also still said only
the switch is written, which is no longer true for opencode.

Refs #538

* fix(mcp): keep an OpenCode endpoint switch next to its own fields

The kept switch was matched by the whole native entry, so a field only
OpenCode reads, such as a per-server timeout, made the next sync drop the
type and command or url once the global server left the config, and
OpenCode 2 then ignored the switch. Match the fields Skillshare manages.

Refs #538

* fix(mcp): show the OpenCode endpoint switch in the dashboard preview

The dashboard renders a project's server alone, so the preview never saw
the same-named global server and showed the bare switch that OpenCode 2
ignores, while sync wrote the switch with the endpoint. Resolve the
global server the way sync does.

Refs #538

* fix(plugin): read OpenCode 2's version output

OpenCode 2 prints "opencode v2.0.27" for --version, while OpenCode 1
prints only "1.19.0". The adapter trimmed a leading "v" only, so plugin
sync to OpenCode 2 failed as an unrecognized version and imported
updates were skipped as if OpenCode 1 had no update command. Read the
last field, and decide the update check with the same parser.

Refs #538
2026-10-12 23:57:40 +08:00
..