Skip to content

Desktop caches MCP tools at startup, never refreshes on reconnect #40015

Closed as not planned

Description

@Egorich-print

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)

Activity

  1. angelamdigital commented on Sep 27, 2026

    @angelamdigital

    Repro on Windows, Desktop 2.0.18 (still present):

    • Added 2 MCP servers to opencode.json (one local stdio, one remote) and disabled 2 others, then fully restarted Desktop (which also self-updated 2.0.6 → 2.0.18).
    • Pre-existing session keeps the old tool catalog — new servers never appear. The disabled pencil server did drop out of the catalog after restart, but otherwise the session's tool definitions stayed frozen.
    • Same machine, CLI opencode mcp list: all 8 servers listed correctly, new ones connected.

    So runtime reconciliation from #37421 works at the config level, but a running session's tool definitions never refresh — forcing a brand-new chat for any MCP change. This overlaps #39987 / #51597.

  2. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions