anomalyco / anomalyco/opencode

Desktop caches MCP tools at startup, never refreshes on reconnect

Open
#40,015 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Aug 1, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

OpenCode Desktop (1.18.10) caches the MCP tools list at application startup and never refreshes it when the MCP server is restarted or its tool set changes. CLI opencode run (1.17.16) works correctly — it fetches the full tools list on every new session.

Steps to reproduce

  1. Configure a remote MCP server in opencode.json:
{
  "mcp": {
    "omniroute": {
      "type": "remote",
      "url": "http://localhost:20128/api/mcp/stream",
      "headers": { "Authorization": "Bearer <key>" },
      "oauth": false
    }
  }
}
  1. The MCP server exposes 108 tools (verified via direct tools/list JSON-RPC call).
  2. Open Desktop — only ~17 MCP tools are visible in the request body.
  3. Restart the MCP server (or add new tools) — Desktop still shows the same cached subset.
  4. Run opencode run from CLI — all 108 tools appear correctly.

Expected behavior

Desktop should fetch the full tools/list from the MCP server on each new session (or at least on reconnect), matching CLI behavior.

Actual behavior

Desktop appears to cache the tools list at first successful MCP connection and never invalidates it. The cached subset is missing tools that the server exposes (e.g., omniroute_memory_add, omniroute_memory_search, omniroute_memory_clear).

Evidence

Call logs from the OmniRoute gateway show:

  • Desktop requests (1.18.10): consistently 25 total tools, 17 MCP tools — no memory tools
  • CLI sessions (1.17.16): 108+ tools including all MCP tools with memory

Environment

  • macOS (darwin)
  • Desktop: OpenCode 1.18.10 (packaged)
  • CLI: 1.17.16
  • MCP transport: Streamable HTTP (POST /api/mcp/stream)
  • MCP server: OmniRoute (custom,108 tools)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.