Skip to content

OAuth callback server binds to IPv6, breaking WSL2 localhost forwarding #30013

Closed

Description

@billovfo

Description

The OAuth callback server in packages/opencode/src/mcp/oauth-callback.ts:164
calls server.listen(port) without a host, which binds to :: (IPv6) on Linux.
WSL2's localhost forwarding cannot route to IPv6 dual-stack sockets, so OAuth
callbacks from the Windows browser never reach OpenCode.

Plugins

No response

OpenCode version

Latest

Steps to reproduce

server!.listen(currentPort, '0.0.0.0', () => {

All OAuth-based remote MCP servers on WSL2 (Notion, etc.).

Screenshot and/or share link

No response

Operating System

Windows 11 pro (WSL 2, Ubuntu)

Terminal

WSL Ubuntu Tmus

Activity

  1. mertcanvural commented on May 31, 2026

    @mertcanvural

    I hit a similar WSL2 loopback bug once. Since your repro already pins binding to , I'd compare three things first: a plain manual diff of the callback host the Windows browser actually reaches, authproxy.dev if you want to watch the handoff live, or OAuth Redirect Doctor if you want the callback host, loopback listener, and provider redirect lined up. tbh WSL2 usually falls over when the browser can hit localhost but the OAuth listener is only sitting on IPv6.

  2. billovfo commented on May 31, 2026

    @billovfo
    Author

    Thank you guys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions