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 — config: V2 silently ignores MCP servers defined directly under `mcp` instead of `mcp.servers` · Issue #56602 · anomalyco/opencode

config: V2 silently ignores MCP servers defined directly under mcp instead of mcp.servers #56602

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
config: V2 silently ignores MCP servers defined directly under mcp instead of mcp.servers#56602
Copy link

Description

@DeepxD-code
DeepxD-code
opened on Oct 18, 2026
Issue body actions

Summary

V2 config silently ignores an MCP server placed directly under mcp instead of mcp.servers, with no warning. opencode mcp list reports "No MCP servers configured" while the config file clearly contains one, so a broken integration looks like a working config.

Environment

  • opencode version: 2.0.32
  • OS: Windows_NT 10.0.26300 (win32 x64)
  • Terminal: desktop app (OpenCode.exe) + opencode-cli.exe
  • Shell: n/a (desktop app)
  • Install/channel: latest (desktop, @opencodedesktop)
  • Active plugins: none configured

Reproduction

  1. Put an MCP server under mcp (the V1 shape):
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "roam": {
      "type": "local",
      "command": ["node", "/path/to/server.mjs", "serve"]
    }
  }
}
  1. Restart OpenCode (or restart the service).
  2. Run opencode mcp list.

Expected Behavior

Either the server connects, or OpenCode tells me the key is wrong — for example a warning that mcp.roam is not a recognised shape and that V2 expects mcp.servers.roam. The V1-to-V2 migration guide notes V1 config files "are intended to remain compatible", so silently dropping an entire server definition leaves the user with a config file that looks correct and a tool that has been unavailable for weeks.

Actual Behavior

No error, no warning, no migration hint:

$ opencode mcp list
No MCP servers configured

The agent simply has no tools from that server. In my case this went unnoticed for a long time because the missing tool's absence looked like the agent choosing a different approach, rather than a config mistake.

For contrast, moving the identical block one level deeper made it appear immediately:

"mcp": { "servers": { "roam": { "type": "local", "command": [...] } } }

Additional Context

  • Reproducible every time; 100% deterministic.
  • Worth considering: when an object key sits directly under mcp and is not servers/timeout, log a warning naming the key and the expected mcp.servers.<name> path. A one-line warning at config load would have saved hours here.
  • Related: opencode mcp list returning "No MCP servers configured" while a config file visibly contains an mcp block could echo which files were loaded, which would also help when config is present but ignored for other reasons.

Activity

  1. opencode-agent commented on Oct 18, 2026

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

    Thanks for the detailed report. I tried this on 2.0.32 (Linux, CLI with the background service) using your flat config, mcp: { roam: { type: "local", command: [...] } }, pointed at a minimal stdio MCP server. I couldn't reproduce the server being ignored:

    • opencode debug config shows the flat entry migrated to mcp.servers.roam, so V2 does read the V1 shape.
    • Right after opencode service restart, the first opencode mcp list printed No MCP servers configured. Running it again a couple of seconds later printed ✓ roam connected.
    • I saw the same pattern with the mcp.servers.roam shape: an empty first result after a restart, then connected.

    So the empty list probably comes from a race right after the service starts, not from the config shape. These look related, ordered by likelihood:

    • MCP HTTP handlers read an empty registry on cold locations #54192: the first opencode mcp list for a location can report no servers before config has finished loading (proposed fix in fix(server): wait for MCP handler readiness #54191)
    • mcp: Windows service registers zero MCP servers from global config #50710: on Windows, the service registers zero MCP servers from global config, persistently
    • mcp: invalid server entries are silently dropped from config #55419: MCP entries that fail validation are dropped with no warning

    Could you check whether that matches what you see? With the flat shape back in place:

    1. Restart the service, then run opencode mcp list two or three times, a few seconds apart.
    2. Run opencode debug config and paste the output. It shows which config files were loaded and whether roam ended up under mcp.servers.
    3. Say which file the config is in (global ~/.config/opencode/opencode.json or a project opencode.json) and whether you start the service from the desktop app or from opencode-cli.exe.

    If it stays empty on repeated calls on Windows, that output will help narrow it down.

  2. DeepxD-code commented on Oct 18, 2026

    @DeepxD-code
    DeepxD-code
    on Oct 18, 2026
    Author
    More actions

    Fix pushed in PR #55231 (branch truncated-diff-patches-v2, commit 233fa69).

    Root cause: normalizeMcp tried V1 decode for keys other than servers/timeout. A V2-only shape (e.g. timeout as an object, or disabled instead of enabled) failed V1 decode and was silently dropped with no diagnostic.

    Fix: try V1 first with a temp diagnostics array; on failure try ConfigMCP.Server (V2) before surfacing any diagnostic. Adds a regression test using timeout-as-object (V2-only shape that fails V1 PositiveInt decode).

    Verified: normalization.test.ts 37/37 green, tsc clean on core+schema.

  3. opencode-agent commented on Oct 18, 2026

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

    Thanks for the report. V2 does read servers placed directly under mcp (the V1 shape) and migrates them to mcp.servers. With your config, the server was only missing from the first opencode mcp list right after a service restart. That timing issue is tracked in #54192, so we're closing this as a duplicate.

  4. opencode-agent
    closed this as duplicateon Oct 18, 2026
  5. opencode-agent
    closed this as not plannedon Oct 21, 2026
  6. opencode-agent commented on Oct 21, 2026

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

    I'm closing this for now since we haven't heard back. On 2.0.32, a flat mcp.roam entry was migrated to mcp.servers.roam and connected. The only No MCP servers configured I got was on the first opencode mcp list right after a service restart, and it happened with both config shapes. That matches the startup race in #54192, which has a proposed fix in #54191.

    If the server still doesn't show up when you run opencode mcp list several times after a restart, please reply here or open a new issue. Include the output of opencode debug config, the path of the config file, and whether the service was started by the desktop app or by opencode-cli.exe. If it's a persistent problem on Windows, #50710 may be the issue. Thanks for the detailed report!

  7. opencodejr
    reopened this on Nov 3, 2026
  8. ahundt
    added a commit that references this issue on Nov 10, 2026

    integrations.rs: write OpenCode servers under mcp.servers and move th…

    6e774a1
  9. FScholPer
    added 2 commits that reference this issue on Nov 11, 2026

    fix(opencode): write V2 mcp.servers format and migrate V1 entries

    690ace9

    Feat/automatic agent context apm setup (#74)

    93d0f38
  10. neriousy commented on Nov 19, 2026

    @neriousy
    neriousy
    on Nov 19, 2026
    Member
    More actions

    I re-checked this after the earlier automatic close was reverted. V2 does migrate a server placed directly under mcp to mcp.servers, so the config shape isn't the cause; a service that keeps reporting No MCP servers configured for a correct config is the problem tracked in #50710, so I'm closing this in favor of that issue. A missing warning for invalid MCP entries is a fair separate request if you want to open one.

  11. neriousy
    closed this as a duplicateof mcp: Windows service registers zero MCP servers from global config #50710 on Nov 19, 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

    No labels
    No labels

    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.