Skip to content

v1.15.13 upward config loading causes local mcp sections to shadow/replace global MCP servers instead of merging #30415

Closed as not planned

Description

@wzhbak

Description

Describe the bug

After upgrading to v1.15.13, all MCP servers defined in the global ~/.config/opencode/config.json stopped being recognized. The v1.15.13 release introduced upward config loading ("Config now loads from the opened location upward"), but the merge strategy for the mcp key appears to be a shallow replace rather than a deep merge — so any local opencode.json/opencode.jsonc found in the directory hierarchy that contains even a partial mcp section silently discards all servers defined in the global config.

Steps to reproduce

Define multiple MCP servers in ~/.config/opencode/config.json under the mcp key.
Create a project-level opencode.jsonc (e.g. at ~/Repositories/myproject/opencode.jsonc) with only a single, different MCP server:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"control-chrome": {
"type": "local",
"command": ["chrome-devtools-mcp"],
"enabled": true
}
}
}
Open opencode from ~/Repositories/myproject/.
All MCP servers from the global config are gone — only control-chrome is available.
Expected behavior

The mcp maps from all config files found during upward loading should be merged additively (per-key, like a Object.assign / deep merge), so that a local config can add project-specific MCP servers without removing globally defined ones.

Actual behavior

The local mcp object completely replaces the global one. Any MCP servers not redeclared in the local config are silently dropped.

Environment

OpenCode version: 1.15.13
Install method: auto-updater
OS: macOS (darwin arm64)
Additional context

This is a breaking change for any user who has global MCP servers in ~/.config/opencode/config.json and project-level configs with a partial mcp section. Before v1.15.13 the upward traversal didn't happen, so this conflict never surfaced. The fix is likely to change the config merge strategy for the mcp key from a shallow object replace to a per-server-key merge.

Plugins

No response

OpenCode version

1.15.13

Steps to reproduce

Define multiple MCP servers in ~/.config/opencode/config.json under the mcp key.
Create a project-level opencode.jsonc (e.g. at ~/Repositories/myproject/opencode.jsonc) with only a single, different MCP server:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"control-chrome": {
"type": "local",
"command": ["chrome-devtools-mcp"],
"enabled": true
}
}
}
Open opencode from ~/Repositories/myproject/.
All MCP servers from the global config are gone — only control-chrome is available.
Expected behavior

The mcp maps from all config files found during upward loading should be merged additively (per-key, like a Object.assign / deep merge), so that a local config can add project-specific MCP servers without removing globally defined ones.

Screenshot and/or share link

No response

Operating System

macOS (darwin arm64)

Terminal

No response

Activity

  1. github-actions commented on Jun 2, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Aug 2, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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