Skip to content

cli: mcp list reports no servers on first run in a fresh directory #63722

Closed as duplicate

Description

@gcar-bendingspoons

Description

opencode mcp list prints No MCP servers configured the first time it runs in a directory the background service has not opened yet, even though the configured servers exist and are later reported as connected. The second invocation in the same directory lists them.

This makes mcp list look like it ignores the config. Reproduced with both the V1 flat mcp map and the native V2 mcp.servers shape, so the config shape is not the cause: MCP connections are per directory, and the CLI reads the directory's MCP state before that directory's servers are known.

Steps to reproduce

  1. Add a local MCP server to the global config, e.g. ~/.config/opencode/opencode.json:
    { "mcp": { "servers": { "everything": { "type": "local", "command": ["npx", "-y", "@modelcontextprotocol/server-everything"] } } } }
  2. From a directory the running service has never opened: mkdir /tmp/fresh && cd /tmp/fresh && opencode mcp list
    • prints No MCP servers configured
  3. Run the same command again in the same directory:
    • prints ○ everything pending
  4. Run it a third time:
    • prints ✓ everything connected

Expected

Configured servers are listed on the first invocation, at least as pending/connecting.

Actual

No MCP servers configured on the first invocation, which is indistinguishable from a config that really has no servers.

Additional context

  • Also reproducible for a directory that is already a project, as long as the service has not booted that location yet.
  • Server log shows the location booting and the servers connecting right after the first invocation, e.g. message="mcp connected" server=... directory=<dir>.
  • Workaround: run the command twice, or run it from a directory already open in a session.

Plugins

-opencode.browser, -opencode.models.dev, plus local OpenChamber plugins (agent-tool, session-title, routed-model)

OpenCode version

2.2.6 (CLI) against a running service reporting 2.2.5

Operating System

macOS 27.0.0 (Darwin 27.0.0, arm64)

Terminal

xterm-256color

Activity

  1. opencodejr commented on Nov 13, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and the server log.

    I think this is a duplicate of #54192. It describes the same thing: the first opencode mcp list in a directory the service hasn't opened yet prints No MCP servers configured, and a later call lists the servers. It's open, has been reproduced, and links a proposed fix in #54191.

    Possible duplicates and related issues, ordered by likelihood:

    I'm closing this issue now as a duplicate of #54192. Please add your details there: the version mismatch (2.2.6 CLI against a 2.2.5 service), the fact that both config shapes reproduce it, and that it also happens in existing projects. If you think this is a different problem, reply here and the issue will reopen.

  2. added
    area/mcp
    type/bug
    version/v2
    on Nov 13, 2026
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

    area/mcpplatform/macostype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions