You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP OAuth: opencode mcp auth doesn't refresh token in active sessions #21702
After re-authenticating an OAuth MCP server with opencode mcp auth , the new token is written to disk but the running MCP connection still uses the stale one.
opencode mcp debug confirms: shows authenticated with a valid token and future expiry, but the HTTP connection test returns 401 Unauthorized. The only workaround is restarting opencode entirely.
Expected: opencode mcp auth should refresh the active MCP connection with the new token, or there should be an opencode mcp reconnect command to re-establish the connection.
Plugins
none
OpenCode version
1.4.1
Steps to reproduce
Connect to an OAuth-enabled MCP server (Streamable HTTP transport)
Wait for the token to expire or be invalidated server-side
Run opencode mcp auth <server> — completes successfully
MCP calls still fail with auth errors
opencode mcp debug <server> shows valid token but 401 on test
If your issue is specifically about the running session not picking up a newly written token (stale in-memory connection), it may be distinct from these — but please review to confirm.
If your issue is specifically about the running session not picking up a newly written token (stale in-memory connection), it may be distinct from these — but please review to confirm.
It's not a duplicate of any of them.
In my case, the authentication succeeds without any problems, meaning it opens a browser and all checks are fine. But after the authentication, opencode still can't fetch anything through the mcp server, and I had to close the process to do a full restart of opencode.
Activity
github-actions commentedon Apr 9, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is specifically about the running session not picking up a newly written token (stale in-memory connection), it may be distinct from these — but please review to confirm.
duke8253 commentedon Apr 9, 2026
It's not a duplicate of any of them.
In my case, the authentication succeeds without any problems, meaning it opens a browser and all checks are fine. But after the authentication, opencode still can't fetch anything through the mcp server, and I had to close the process to do a full restart of opencode.
aks24k commentedon Apr 22, 2026
Having same problem for JIRA mcp.
fix: serialize mcp-auth.json mutations with EffectFlock to prevent co…
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.