Skip to content

Unexpected status: needs_auth when trying to authenticate MCP after changing account (already authenticated) #29227

Description

@leobrqz

Description

Context:
A couple people share the same computer, each use their own opencode account. Today, i changed the GO(zen) token to my account, and suddendly the MCP asked for authentication. I did the usual flow opencode mcp auth xxx, it opened the browser, i accepted, but it returned Unexpected status: needs_auth - when i do the same auth command again, it says valid credentials were found and asks if i want to reuse them, saying yes doesn't authenticate, opening opencode just shows the mcp needs auth and it's disabled.

I've tried clearing .config/opencode + .cache/opencode and .share/opencode

I've also removed the bearer token from opencode.json inside the project repo, and tried the key oauth and enabled, neither worked.

And i completely removed opencode.json and tried making it again, no luck.

This is the first time this happens.

Plugins

No response

OpenCode version

1.15.10

Steps to reproduce

  1. /provider, change api key
  2. refresh window
  3. opencode asks for mcp auth
  4. do opencode mcp auth xxxx
    Either:
    5.1. Valid credentials found
    5.2. Browser opens
  5. error appears either way

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Bash

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