Description
After context compaction occurs, MCP server tools become completely unavailable for the rest of the session. The only workaround is to start a new session.
This was also reported in NeuralNomadsAI/CodeNomad#344, where the CodeNomad maintainer confirmed this is an OpenCode-level issue.
Steps to Reproduce
- Start a session with MCP servers configured
- Use MCP tools extensively (large tool outputs, many calls)
- Wait for or trigger context compaction (~95% context window)
- Attempt to call any MCP tool after compaction
Expected Behavior
MCP server connections are re-established after compaction. Tools remain available throughout the session.
Actual Behavior
All MCP tool calls fail after compaction. The tools are simply gone — no error, no reconnect attempt. A full new session is required to restore MCP functionality.
Impact
Any workflow relying on MCP tools (e.g. database tools, agent registries, custom servers) is silently broken after compaction. This is especially problematic for long-running sessions where compaction is expected.
Environment
- OpenCode TUI (darwin)
- MCP servers configured via config
- Model: claude-sonnet-4-6
Related
Description
After context compaction occurs, MCP server tools become completely unavailable for the rest of the session. The only workaround is to start a new session.
This was also reported in NeuralNomadsAI/CodeNomad#344, where the CodeNomad maintainer confirmed this is an OpenCode-level issue.
Steps to Reproduce
Expected Behavior
MCP server connections are re-established after compaction. Tools remain available throughout the session.
Actual Behavior
All MCP tool calls fail after compaction. The tools are simply gone — no error, no reconnect attempt. A full new session is required to restore MCP functionality.
Impact
Any workflow relying on MCP tools (e.g. database tools, agent registries, custom servers) is silently broken after compaction. This is especially problematic for long-running sessions where compaction is expected.
Environment
Related