Skip to content

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

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
MaxAnderson95:fix/mcp-finishauth-enabled
Jun 28, 2026
Merged

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

Conversation

@MaxAnderson95

@MaxAnderson95 MaxAnderson95 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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. 👍

@rekram1-node

rekram1-node commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@rekram1-node
rekram1-node enabled auto-merge (squash) June 28, 2026 23:06
@rekram1-node
rekram1-node merged commit 411e053 into anomalyco:dev Jun 28, 2026
6 checks passed
@MaxAnderson95
MaxAnderson95 deleted the fix/mcp-finishauth-enabled branch July 1, 2026 10:26
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

2 participants