Skip to content

Support OpenCode 2 (0.2.0) - #1

Merged
pray-mrscraper merged 1 commit into
mainfrom
opencode-2
Oct 12, 2026
Merged

pray-mrscraper merged 1 commit into
mainfrom
opencode-2

Conversation

@ai-mrscraper

Copy link
Copy Markdown
Member

OpenCode 2 (released 2026-10-10 as @opencode/cli) does not run OpenCode 1 plugins, so @mrscraper/opencode@0.1.0 does nothing for users who upgrade.

Changes

  • index.ts: one default export with an OpenCode 2 setup() (registers the mrscraper MCP server through ctx.mcp.transform and the four skills through ctx.skill.transform, parsing SKILL.md the way OpenCode 2 does) and an OpenCode 1 server() (the existing config hook). This is the dual-version pattern from OpenCode's plugin docs ("Support V1"). A user-defined mrscraper server or same-named skill is kept in both.
  • No runtime dependencies: @opencode/plugin is used for types only (Plugin.define is an identity function).
  • OpenCode 1 now needs 1.18.29+ (first release that loads the object form); older releases can pin 0.1.0. The MrScraperPlugin named export is removed.
  • README, CHANGELOG, PUBLISHING updated for both versions; version 0.2.0.

Verification

  • npm ci && npm run check and npm pack --dry-run from a clean checkout; skills identical to mrscraper-claude-plugin.
  • Packed tarball in clean profiles (separate HOME/XDG dirs):
    • OpenCode 2.0.26: mcp.list → mrscraper needs_auth; skill.list includes the four skills; with the README API-key config → ✓ mrscraper connected (user entry kept). The API key must be in the background service's environment (opencode service restart from that shell) — verified.
    • OpenCode 1.19.0 and 1.18.29: mcp list → ⚠ mrscraper needs authentication; debug skill lists the four skills; with the API-key config → ✓ mrscraper connected.
  • Not run: browser OAuth sign-in and an LLM prompt (no model provider in the test profiles).

OpenCode 2 does not run OpenCode 1 plugins. Default-export one object with an OpenCode 2 setup(), which registers the mrscraper MCP server and the four skills through MCP and skill transforms, and an OpenCode 1 server(), which keeps the existing config hook. A user-defined mrscraper server or same-named skill is kept in both.

Tested with packed tarballs in clean profiles: OpenCode 2.0.26, 1.19.0, and 1.18.29 each show mrscraper as needs authentication and load the four skills; with the README API-key configuration each shows connected.
@riandradiva18

Copy link
Copy Markdown
Collaborator

lgtm

@pray-mrscraper
pray-mrscraper self-requested a review October 12, 2026 02:13
@pray-mrscraper
pray-mrscraper merged commit 3c60981 into main Oct 12, 2026
1 check passed
@ai-mrscraper
ai-mrscraper deleted the opencode-2 branch October 12, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants