fix(config): read the pre-mcpServers mcp string list from v0.x config.json#3960
Merged
Conversation
…ig.json v0.x stored MCP servers in two shapes: the canonical mcpServers map and the older `mcp` list of --mcp-format strings (name=cmd args, name=URL for SSE, name=streamable+URL), with mcpEnv/mcpDisabled keyed by name. Both the one-time migration and the live lowest-priority legacy source only read mcpServers, so servers configured the old way -- including the default memory server -- silently vanished on upgrade. Parse the string list in both paths; mcpServers wins a name collision, matching the v0.x merge order. Anonymous specs get a synthesized name since v1+ plugins require one. Closes #3949
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
v0.x stored MCP servers in two shapes: the canonical
mcpServersmap and the oldermcplist of--mcp-format strings (name=cmd args,name=https://urlfor SSE,name=streamable+https://urlfor streamable HTTP), withmcpEnv/mcpDisabledkeyed by server name. The Go line only readmcpServers— in both the one-time migration and the live lowest-priority legacy source — so servers configured the old way (including the default memory server the v0.x setup writes) silently vanished on upgrade.parseLegacyMCPSpecparses one--mcpstring into aPluginEntry(same transport inference as v0.x:streamable+prefix → http, plainhttp(s)://→ SSE, otherwise stdio via the existing command-line splitter).MigrateLegacyIfNeedednow imports themcplist, applyingmcpEnvto named stdio specs and migratingmcpDisabledentries withauto_start = false;mcpServerswins a name collision, matching the v0.x merge order.loadLegacyMCP(the every-boot legacy source for users whose v2 config already exists) reads the list the same way, skipping disabled names.name=prefix) get a synthesizedmcp-Nname, since v1+ plugins require one.Verified the string format against the v0.x source (
src/mcp/spec.tsparseMcpSpec/normalizeMcpConfigon the v1 branch) rather than guessing.Closes #3949