GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcp: OAuth loopback callback fails with a remote OpenCode server · Issue #59869 · anomalyco/opencode

mcp: OAuth loopback callback fails with a remote OpenCode server #59869

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
mcp: OAuth loopback callback fails with a remote OpenCode server#59869
Copy link
Labels
pending closetriaging

Description

@Sc0th
Sc0th
opened on Oct 28, 2026
Issue body actions

Description

MCP OAuth authorization fails when OpenCode is running as a remote server and the authorization browser is on a different device. The OAuth URL uses a loopback redirect (http://127.0.0.1:<port>/callback), which points to the browser’s device, not the remote OpenCode server that initiated authorization.

Plugins

notify-pushover, @openclient-ios/[email protected], [email protected]

OpenCode version

OpenCode version: 2.2.0

Steps to reproduce

  1. Connect a client to an OpenCode server running on a different host.
  2. Open /mcps and authorize the remote MCP server at https://opencode.ai/console/mcp.
  3. Complete authorization in a browser on the client device.
  4. The authorization URL redirects to http://127.0.0.1:<ephemeral-port>/callback, and authorization fails because that loopback address is on the browser’s device, not the OpenCode server.

Expected Behavior

 OAuth authorization should complete when using a remote OpenCode server, without requiring the browser device to reach the server through a manually configured tunnel.

Actual Behavior

 The callback targets the browser device’s loopback address, while the OpenCode server is on another host. Authorization cannot complete. In this environment, network policy prevents using an SSH tunnel as a workaround.

Additional Context

 The redirect URI observed was `http://127.0.0.1:36857/callback` (port varies). OAuth query parameters have been omitted. A remote-safe callback mechanism or device-code/manual-code flow would avoid this limitation.

Screenshot

No response

Operating System

Alma 10

Terminal

Bash

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    opencodejrBot
    on Oct 28, 2026
    Contributor
    More actions

    Thanks for the clear report, @Sc0th!

    I think this is a duplicate of #54495. It asks for MCP OAuth to work when the browser is on a different machine than the OpenCode server, using the paste-the-redirect-URL/code fallback you suggested. There's also an open PR for it, #58370, which names a TUI attached to a remote server as one of the cases it fixes.

    Possible duplicates and related issues, ordered from most to least likely:

    • [FEATURE]: MCP OAuth paste-code fallback for headless/SSH sessions #54495: MCP OAuth paste-code fallback for headless/remote sessions where the browser can't reach the server's 127.0.0.1 callback (same problem)
    • feat(core): accept a pasted redirect URL for MCP OAuth #58370: open PR that lets you paste the redirect URL from the browser's address bar to finish MCP sign-in (covers your case)
    • tui: openai oauth redirects to localhost callback on remote servers #58095: the same loopback-callback problem for ChatGPT (OpenAI) sign-in on a remote server
    • [FEATURE]: make OAUTH_CALLBACK_HOST configurable #33966: request to make the OAuth callback host configurable (container/remote setups)
    • [FEATURE]: MCP OAuth: let the engine choose and hold its loopback listener per attempt and report it #57130: MCP OAuth per-attempt loopback listener for setups with a front server

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencodejr
    added
    pending close
    triaging
    on Oct 28, 2026
  3. opencodejr
    closed this as duplicateon Oct 29, 2026
  4. opencodejr commented on Oct 29, 2026

    @opencodejr
    opencodejrBot
    on Oct 29, 2026
    Contributor
    More actions

    Closing this as a duplicate of #54495. That issue covers MCP OAuth failing when the browser is on a different machine from the OpenCode server, because the callback listens only on the server's 127.0.0.1. There's also an open PR for it, #58370, which would let you finish sign-in by pasting the redirect URL from your browser. Please follow #54495 for updates.

    If your case turns out to be different, reply here with the details and we can reopen. Thanks again for the clear report, @Sc0th!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closetriaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.