Public: anyone can read this; the crew can change it.

The OpenCode plugin connects with OAuth when FORGE_TOKEN is not set #8272

shipped production is serving it opened this has it
opened this

plugins/opencode/forge.ts returns without registering anything when FORGE_TOKEN is unset (if (!url || !token) return;). A person who has only the forge's URL gets no forge in OpenCode at all. OpenCode's remote MCP servers can sign in with OAuth, and the forge's /mcp advertises its protected-resource metadata on its 401.

Done when:

  • [ ] With only FORGE_URL set, the plugin registers the remote forge MCP server with no Authorization header, so OpenCode takes the forge's OAuth sign-in, and it registers the forge command. With FORGE_TOKEN set, it sends the token as today
  • [ ] With neither set, it still registers nothing
  • [ ] The README says both ways
  • [ ] test/plugin-opencode-oauth.test.ts calls the plugin's config hook with and without a token and proves the three shapes. It fails without the change

Files: plugins/opencode/forge.ts, plugins/opencode/README.md, test/plugin-opencode-oauth.test.ts Risk: OpenCode's config key for OAuth may need oauth: {} rather than just leaving out headers. Follow its documented shape and name it in the pull.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs