Fix duplicate server entries from hyphenated serverName in mcp-config.json#67
Draft
aditya-scio wants to merge 1 commit into
Draft
Fix duplicate server entries from hyphenated serverName in mcp-config.json#67aditya-scio wants to merge 1 commit into
aditya-scio wants to merge 1 commit into
Conversation
…onfig.json A bad merge introduced entries with "glean-default" (hyphen) into mcp-config.json. The buildGleanServerName function only recognizes the "glean_" (underscore) prefix, so "glean-default" was transformed into "glean_glean-default" in host configs like claude_desktop_config.json. The dedup logic also failed to match "glean-default" against "glean_default" since it used exact string comparison. Fix by normalizing hyphens to underscores in serverName: - Add a Zod transform on McpServerEntrySchema so all parsed entries are normalized automatically (affects both readMcpConfig and writeConfig) - Normalize incoming serverName in writeConfig before writing Generated by Glean Code Writer
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.
Description
Fixes the issue reported by Neil Dhruva in #discuss-ai-code where
glean_defaultandglean_glean-defaultboth appear inclaude_desktop_config.jsonand fail to auth.Root cause: A bad merge introduced entries with
serverName: "glean-default"(hyphen) intomcp-config.json. ThebuildGleanServerNamefunction in@gleanwork/mcp-config-gleanonly recognizes the"glean_"(underscore) prefix, so"glean-default"was transformed into"glean_glean-default"in host configs. The dedup logic also failed to match the two variants since it used exact string comparison.Fix: Normalize hyphens to underscores in
serverNameat two levels:.transform()onMcpServerEntrySchemaso all parsed entries frommcp-config.jsonare normalized automatically — this fixes both the host config naming and dedup comparisonsserverNameinwriteConfigbefore writing tomcp-config.jsonTesting
🤖 Generated by Glean Code Writer
📝 Chat link - https://app.glean.com/chat/be05961f64114be29dd0c0fe59218745