[PR #9078] feat(mcp): add oauth callbackHost config #12974

Open
opened 2026-02-16 18:17:51 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9078

State: open
Merged: No


Adds mcp.<name>.oauth.callbackHost to control the bind address for the OAuth callback server. This helps in WSL2, Docker, and devcontainers where the host browser can’t reach the callback listener.

Default behavior is unchanged when unset. When set, we pass hostname to Bun.serve() and restart the callback server if the host changes.

Also escapes the callback error page output and documents the troubleshooting step in the MCP server docs.

Testing:

  • bun run typecheck
  • bun test test/mcp/oauth-callback.test.ts
  • bun test test/config/config.test.ts

Fixes #9081

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9078 **State:** open **Merged:** No --- Adds `mcp.<name>.oauth.callbackHost` to control the bind address for the OAuth callback server. This helps in WSL2, Docker, and devcontainers where the host browser can’t reach the callback listener. Default behavior is unchanged when unset. When set, we pass `hostname` to `Bun.serve()` and restart the callback server if the host changes. Also escapes the callback error page output and documents the troubleshooting step in the MCP server docs. Testing: - bun run typecheck - bun test test/mcp/oauth-callback.test.ts - bun test test/config/config.test.ts Fixes #9081
yindo added the pull-request label 2026-02-16 18:17:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12974