Skip to content

Windows: MCP OAuth authentication succeeds but auth state is never persisted #31282

@oaslananka

Description

@oaslananka

Description

opencode mcp auth context7 completes successfully and the browser OAuth flow finishes without errors.

The CLI prints:

Authentication successful!

However, running:

opencode mcp auth list

immediately afterwards still shows:

✗ context7 not authenticated

The same behavior occurs with deepwiki.

In addition, ~/.local/share/opencode/mcp-auth.json is never created (or remains empty), so the OAuth state does not appear to be persisted.

Plugins

opencode-mem opencode-pty opencode-vibeguard @tarquinen/opencode-dcp @mohak34/opencode-notifier

OpenCode version

1.16.2

Steps to reproduce

  1. Fresh install of OpenCode 1.16.2 via pnpm.
  2. Remove existing database and auth files:
    del $HOME\.local\share\opencode\opencode.db*
    del $HOME\.local\share\opencode\mcp-auth.json
  3. Run:
    opencode mcp auth context7
  4. Complete the browser OAuth flow.
  5. Run:
    opencode mcp auth list
  6. Observe that it still reports:
    ✗ context7 not authenticated
    

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

PowerShell 7.6.2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions