Skip to content

fix(mcp): mcp auth returns "Unexpected status: disabled" after successful OAuth #20278

Closed

Description

@Ayushlm10

Bug

After completing OAuth for a remote MCP server, opencode mcp auth <name> shows:

┌  MCP OAuth Authentication
│
■  Unexpected status: disabled
│
└  Done

Even though the authentication itself succeeded.

Root Cause

In finishAuth (packages/opencode/src/mcp/index.ts), after OAuth completes successfully, createAndStore(mcpName, mcpConfig) is called with the raw config from getMcpConfig(). If the server has enabled: false (e.g. was previously disconnected), create() short-circuits and returns { status: "disabled" } without attempting to connect.

The authenticate CLI handler doesn't have a case for "disabled" status, so it falls through to the else branch printing "Unexpected status: disabled".

Fix

Pass { ...mcpConfig, enabled: true } to createAndStore in finishAuth, matching what connect() already does.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 31, 2026
  2. github-actions commented on Mar 31, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Please use one of the three required templates: Bug Report, Feature Request, or Question
    • Missing required system information: OpenCode version, OS, and install method
    • Bug reports should include steps to reproduce

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. added a commit that references this issue on Mar 31, 2026
    d3842e6
  4. github-actions commented on Mar 31, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

  5. Ayushlm10 commented on Apr 17, 2026

    @Ayushlm10
    ContributorAuthor

    closing this, wasn't totally clear initially what was happening. Sorry for the noise.

  6. phantomwhale commented on May 14, 2026

    @phantomwhale

    Seeing something similar...

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions