Skip to content

mcp: "enabled": false is dropped at parse, so the server still starts #61589

Closed as duplicate

Description

@phs

Description

The docs list enabled as the way to turn a server off without deleting it ("You can also disable a server by setting enabled to false"), and both option tables carry enabled | Boolean | "Enable or disable the MCP server on startup". The key is dropped during config parsing, while startup gates on disabled, which the docs never mention. So "enabled": false is inert and the server connects.

// opencode.json
{
  "mcp": { "servers": {
    "a-enabled-only":  { "type": "remote", "url": "http://127.0.0.1:1/mcp", "enabled": false },
    "b-disabled-only": { "type": "remote", "url": "http://127.0.0.1:2/mcp", "disabled": true },
    "c-both":          { "type": "remote", "url": "http://127.0.0.1:3/mcp", "enabled": false, "disabled": true },
    "d-plain":         { "type": "remote", "url": "http://127.0.0.1:4/mcp" }
  } }
}

opencode --standalone debug config prints a-enabled-only with no enabled key at all, and keeps disabled: true on the other two.

Plugins

none

OpenCode version

2.2.5

Steps to reproduce

  1. Write the config above into opencode.json in an empty directory.
  2. opencode --standalone debug config — enabled is gone from a-enabled-only.
  3. opencode serve --hostname 127.0.0.1 --port 49399 with OPENCODE_PASSWORD set, then curl -u "opencode:$OPENCODE_PASSWORD" http://127.0.0.1:49399/api/mcp.
entry in config status from /api/mcp
"enabled": false failed — it tried to connect
"disabled": true disabled
both keys disabled
neither key failed — it tried to connect

Expected: enabled: false behaves like disabled: true.

The published config schema carries enabled with the description "Enable or disable the MCP server on startup", while the MCP layer's config classes declare disabled and its startup loop tests config.disabled. Nothing maps one to the other, so the documented key does nothing and the undocumented one is the only lever. Not a duplicate of #55419, which covers invalid entries being dropped.

Operating System

Ubuntu 24.04 (container)

Terminal

xterm-256color

Activity

  1. opencodejr commented on Nov 4, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and the comparison table, @phs!

    This is how v2 is meant to work. Under the v2 mcp.servers layout, the key that turns a server off is disabled, and enabled isn't part of that layout. The v2 MCP docs say: "Use disabled, not an enabled field, to keep one configured without connecting it". The v1 migration guide also says v2 "replaces enabled with the inverse disabled". The page and table you quoted describe the v1 layout, where servers sit directly under mcp. That older layout is still converted, and there "enabled": false does become disabled: true, e.g.:

    { "mcp": { "a": { "type": "remote", "url": "http://127.0.0.1:1/mcp", "enabled": false } } }

    What goes wrong in your case is that an enabled key inside mcp.servers is dropped without any warning, so the server connects anyway. I'm treating that as an improvement request: v2 should either accept enabled there or warn when it ignores it. The maintainers will consider it.

    Related issues:

  2. phs commented on Nov 4, 2026

    @phs
    Author

    You're right, I quoted the v1 page. opencode.ai/docs/mcp-servers/ is still live, still indexed, carries no v1 banner, and its prose says "You can also disable a server by setting enabled to false". The v2 pages and the migration guide are unambiguous, so this is documentation drift rather than a parser bug.

    Narrowed ask, then:

    1. Warn when a key inside mcp.servers is not part of the v2 layout. An enabled sitting there is ignored with no trace today, and mcp: invalid server entries are silently dropped from config #55419 shows a rejected entry can disappear entirely. A closed object plus silent ignore is the failure mode.
    2. Banner that page as v1, or move its prose into the v2 docs, so the page people land on matches the version they run.

    The runtime difference I measured does hold: "enabled": false under flat mcp converts to disabled: true, and the same key under mcp.servers connects.

    Happy to close this if #55419 and #50852 already cover what's left.

  3. neriousy commented on Nov 23, 2026

    @neriousy
    Member

    Closing as a duplicate of #55419: V2 uses disabled; silently dropped invalid MCP entries are tracked there. Please follow that issue for updates and add any extra details there.

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