Skip to content

fix(mcp): reconnect after OAuth even when server is disabled#33920

Open
MaxAnderson95 wants to merge 1 commit into
anomalyco:devfrom
MaxAnderson95:fix/mcp-finishauth-enabled
Open

fix(mcp): reconnect after OAuth even when server is disabled#33920
MaxAnderson95 wants to merge 1 commit into
anomalyco:devfrom
MaxAnderson95:fix/mcp-finishauth-enabled

Conversation

@MaxAnderson95

@MaxAnderson95 MaxAnderson95 commented Jun 25, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #33915

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

opencode mcp auth <name> prints "Unexpected status: disabled" after a successful OAuth flow when the server is set to "enabled": false in the config. The token saves fine, but the server never connects and it looks like auth failed.

finishAuth was passing the raw config to createAndStore, so enabled: false made create() short-circuit and return disabled. connect() already handles this by forcing enabled: true before reconnecting — this does the same in finishAuth.

Same fix as #20279, which was closed before it got merged.

How did you verify your code works?

Added a remote OAuth MCP server with "enabled": false, ran bun dev mcp auth <name>, and completed the browser flow. It now prints "Authentication successful!" and the server connects. The same steps before the change gave "Unexpected status: disabled".

Screenshots / recordings

N/A — CLI output change only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

finishAuth passed the raw config to createAndStore, so a server with
enabled: false short-circuited in create() and returned status
"disabled" right after a successful OAuth flow. Force enabled: true the
same way connect() already does so the server actually connects.

Closes anomalyco#33915

OpenCode session ID: ses_100f47509ffeVOfeYfrub3HYwF
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jun 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant