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 — [FEATURE]: trigger MCP authentication from the ACP client · Issue #55048 · anomalyco/opencode

[FEATURE]: trigger MCP authentication from the ACP client #55048

New issue
Copy link
New issue
Copy link
Open
Open
[FEATURE]: trigger MCP authentication from the ACP client#55048
Copy link

Description

@monrus
monrus
opened on Oct 13, 2026
Issue body actions

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

When opencode runs as an ACP agent (e.g. Zed), the client cannot authenticate or re-authenticate opencode's native MCP servers. OAuth servers can only be signed in from a terminal (opencode mcp auth <name>) or the TUI (/mcps). With short-lived OAuth sessions this means re-login outside the client on every expiry.

Environment

  • opencode: 2.0.27 (release/latest)
  • OS: Linux 7.0.0-38-generic (x64)
  • Client: Zed (custom agent_servers, opencode acp); TERM=xterm-256color
  • Shell: /usr/bin/zsh
  • Plugins: local (~/.config/opencode/plugins/: attention.js, knowledge-capture.js, session-branch.js)

Reproduction

  1. Add a remote OAuth MCP server to mcp.servers.
  2. Open opencode from Zed (ACP). opencode mcp list shows needs authentication; the client offers no way to sign in.
  3. Log in once from a terminal, then use the agent until the OAuth session expires — refresh is rejected, the credential is invalidated, MCP calls return 401, and there is still no in-client way to re-authorize.

Expected Behavior

The ACP client can trigger MCP auth/re-auth, similar to provider login over ACP.

Actual Behavior

Only opencode-login (provider auth) is advertised. MCP OAuth servers require a browser flow reachable only outside the client. On invalid_grant opencode invalidates the credential and the client just keeps getting 401s with no actionable prompt.

mcp oauth authorization completed  hasRefreshToken=true  expiresIn=400
mcp oauth request rejected         error=invalid_grant
  message="Refresh session expired by policy. Please re-authorize via OAuth."
mcp oauth credential invalidated   scope=tokens

Additional Context

  • Client-forwarded MCP servers (session/new mcpServers) don't use OAuth (headers only), so Zed's context_servers can't substitute for opencode's native OAuth servers.

  • Proposed:
    (1) expose servers needing auth via ACP authenticate as terminal methods (args: ["mcp","auth","<name>"]);
    (2) send a session update when re-auth is needed; (3) expose an MCP command via available_commands_update.

  • Consistently reproducible; in the reported setup re-auth was needed ~8 min after login.

Reacted by Rob Gil

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 13, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the detailed request, @monrus!

    To restate it: when opencode runs as an ACP agent (e.g. in Zed), you'd like the client to be able to start authentication or re-authentication for opencode's native OAuth MCP servers. Right now that's only possible from a terminal (opencode mcp auth <name>) or the TUI (/mcps). You also want a clear prompt when re-auth is needed, instead of repeated 401s. That matches the current code: over ACP, opencode only advertises the provider login method (opencode-login).

    Maintainers will consider this along with your proposed approaches (per-server terminal auth methods, a re-auth session update, and an MCP command via available_commands_update). A plugin can't do this today, because plugins have no access to ACP auth methods or session updates.

    These are related but don't cover this request:

    • fix(core): serialize MCP OAuth refreshes across processes #50994 and fix(core): reuse MCP OAuth refresh answers for spent tokens #53275: open PRs about how MCP OAuth refresh tokens are handled
    • [FEATURE]: ACP v2 draft spec support #44877: ACP v2 draft spec support
    Reacted by Konstantin Bezgodov
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

    No labels
    No labels

    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.