Skip to content

mcp auth returns "Unexpected status: disabled" after successful OAuth on enabled:false servers #33915

Description

@MaxAnderson95

Description

Running opencode mcp auth <name> on a remote MCP server prints Unexpected status: disabled even though the OAuth flow completes fine. The token gets saved, but the CLI reports failure and the server doesn't connect for that run.

It only happens when the server is "enabled": false in the config, which is how I keep MCP servers parked until I actually need one in order to save on context window usage.

The cause is in finishAuth (packages/opencode/src/mcp/index.ts): after OAuth succeeds it calls createAndStore(mcpName, mcpConfig) with the raw config, so enabled: false makes create() short-circuit to { status: "disabled" }. The CLI handler has no case for disabled, so it falls through to "Unexpected status". connect() already avoids this by passing { ...mcp, enabled: true } — finishAuth just needs to do the same.

Same bug and fix were reported in #20278 / PR #20279, but that PR was closed unmerged and the Effect refactor (#19042) carried it forward, so it's still on dev.

OpenCode version

1.17.11

Steps to reproduce

  1. Add a remote MCP server with OAuth and "enabled": false in opencode.json
  2. Run opencode mcp auth <name> and complete the browser OAuth
  3. CLI prints Unexpected status: disabled instead of Authentication successful!

Operating System

macOS (Apple Silicon)

Terminal

Ghostty

Activity

added a commit that references this issue on Jun 28, 2026
411e053
added a commit that references this issue on Jun 29, 2026
2602aff
added a commit that references this issue on Jul 3, 2026
3174446
added a commit that references this issue on Jul 9, 2026
e3cb8f7
added a commit that references this issue on Jul 31, 2026
98316c5
added a commit that references this issue on Sep 24, 2026
990ca8b
added a commit that references this issue on Oct 7, 2026
60c9b00
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