anomalyco / anomalyco/opencode
MCP servers fail to connect when a session starts during self-upgrade
@rekram1-node is already working on this.
Since Aug 23, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Started opencode while it was auto-upgrading from an older 1.18.x to 1.18.21. Every configured MCP server (a mix of local stdio servers and remote HTTP servers) failed to connect at startup, and the session never recovered — MCP status stays red with no retry/reconnect. The self-upgrade ran after MCP init:
01:07:14 <remote-mcp> failed
01:07:20 <remote-mcp> needs_auth
01:07:45 <local-mcp> failed
01:07:47 <local-mcp> failed
01:07:47 <local-mcp> failed
01:07:47 <local-mcp> failed
01:07:47 init count=5
01:08:01 upgraded method=npm target=1.18.21
Corroborating: three simultaneous sessions against the same user-scope config showed three different MCP states (all green / one remote server red / all red) — each captured a different startup moment, confirming MCP connection state is a one-shot startup snapshot with no reconnect path.
Plugins
opencode-openai-codex-auth
OpenCode version
1.18.21 (self-upgraded mid-session from an older 1.18.x)
Steps to reproduce
- Open a session while a newer opencode release is available (auto-upgrade pending).
- Let the session launch during the upgrade window.
- Observe all MCPs fail at init and never reconnect.
Operating System
Windows 10
Terminal
Windows Terminal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.