GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MCP tools with codemode: false are missing on the first step while the server is still starting · Issue #58373 · anomalyco/opencode

MCP tools with codemode: false are missing on the first step while the server is still starting #58373

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
MCP tools with codemode: false are missing on the first step while the server is still starting#58373
Copy link
Labels
pending closetriaging

Description

@JoshuaMart
JoshuaMart
opened on Oct 23, 2026
Issue body actions

Description

MCP servers connect in the background, and the tool list for a step only includes servers that are already connected. So the first step after a server starts (a cold opencode run --standalone, or the first session on a fresh service) goes out without that server's tools.

With Code Mode this is mostly hidden: execute is always there and later steps get the full catalog. With codemode: false the server's tools are simply absent from the first request, so an agent meant to call <server>_<tool> directly has nothing to call and stops. In practice it looks like codemode: false doesn't expose MCP tools at all.

Possibly related to #55079 (closed) and #51849, but a different cause: here the server comes from config only and is still starting when the first step's tool list is built. Once it is connected, codemode: false works and the tools are called directly.

Plugins

No response

OpenCode version

2.1.2 (also reproduced on dev at 4d30794)

Steps to reproduce

  1. Configure a local MCP server that takes ~2s to answer initialize, with "codemode": false under mcp.servers.<name>.
  2. Run opencode run --standalone "call <name>_<tool>" with an agent whose permissions allow that tool.
  3. The first request to the model has no <name>_<tool>; the log shows the server connecting shortly after (mcp connected server=<name> tools=N).

Screenshot

No response

Operating System

macOS

Terminal

No response

Activity

  1. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 23, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the clear write-up, and for the fix in #58374.

    I think this is a duplicate of #51812. It describes the same problem: MCP servers connect in the background, and the first step's tool list doesn't wait for servers that are still pending. So a cold opencode run --standalone, or the first prompt on a fresh service, goes out without the codemode: false tools. The comments there also cover a server that already shows as connected but isn't in the tool registry yet.

    Possible duplicates and related issues, ordered by likelihood:

    • First prompt after start has no MCP tools: tool list does not wait for pending MCP connections #51812: first prompt after start has no MCP tools because the tool list doesn't wait for pending connections (open; includes codemode: false and run --standalone)
    • Direct MCP tools (codemode: false) are nondeterministically missing from the session toolset; opencode run can hang forever after a session error #56240: direct MCP tools (codemode: false) sometimes missing from a fresh opencode run --standalone; already closed as a duplicate of First prompt after start has no MCP tools: tool list does not wait for pending MCP connections #51812
    • mcp.add resolves befor the session tool registry has the new server's tools #51089: same kind of race, but for servers added at runtime with mcp.add
    • MCP codemode: false is ignored: server tools stay behind execute (2.0.25–2.0.28, opencode acp) #55079: codemode: false looked ignored over ACP; one of the causes found there was this same startup race

    Your PR #58374 looks like a direct fix for #51812, so you could point it at that issue as well. A maintainer said on #51812 that connecting in the background was intentional, so the discussion about waiting is happening there.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent
    added
    pending close
    triaging
    on Oct 23, 2026
  3. JoshuaMart
    closed this as completedon Oct 23, 2026
  4. opencode-agent
    closed this as duplicateon Oct 24, 2026
  5. opencode-agent commented on Oct 24, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 24, 2026 – with OpenCode Agent
    Contributor
    More actions

    It's been a day without a reply, so I'm closing this as a duplicate of #51812. That issue covers the same problem: the first step's tool list doesn't wait for MCP servers that are still starting, so codemode: false tools are missing from a cold opencode run --standalone or the first session on a fresh service.

    To follow this:

    • First prompt after start has no MCP tools: tool list does not wait for pending MCP connections #51812: the main issue, where the discussion about waiting for pending servers is happening
    • fix(core): wait for MCP servers only before a session's first request #58374: your fix PR. You could point it at First prompt after start has no MCP tools: tool list does not wait for pending MCP connections #51812 so it's linked there.

    If your case turns out to be different from #51812, please reply here or open a new issue that links this one. Thanks again for the report and the fix.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closetriaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.