fix(mcp): preserve user's enabled:false and apply disabled_mcps to all MCP sources #1721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
598a4389where OMO force-enabled all MCPs, ignoring user'senabled: falseinopencode.jsondisabledMcpsparameter toloadMcpConfigs()that was dropped during refactorenabled: falsesettings after MCP config mergedisabled_mcpsfiltering to all MCP sources (built-in,.mcp.json, and plugins)Root Cause
Commit
598a4389("refactor(core): split index.ts and config-handler.ts into focused modules") extracted MCP config handling intomcp-config-handler.tsbut:loadMcpConfigs()without thedisabledMcpsparameter (originally added infab0f462).mcp.jsonMCPs (hardcodedenabled: trueintransformer.ts) overwrote user'senabled: falsefromopencode.jsonChanges
loader.tsdisabledMcps: string[] = []parameter; MCPs in the list are skipped during loadingloader.test.tsdisabledMcpsfilteringmcp-config-handler.tsenabled: falsebefore merge, passesdisabled_mcpsto loader, restoresenabled: falseafter merge, deletesdisabled_mcpsentries from final resultmcp-config-handler.test.tsVerification
Summary by cubic
Fixes a regression that force-enabled MCPs. We now respect enabled:false in user config and apply disabled_mcps across built-in, .mcp.json, and plugin MCPs.
Written for commit 0dace5c. Summary will update on new commits.