Skip to content

fix: do not wipe JSONC MCP configs when adding Patchloom - #248

Merged
SebTardif merged 2 commits into
mainfrom
fix/improve-mpi-20260828-s0700
Aug 28, 2026
Merged

fix: do not wipe JSONC MCP configs when adding Patchloom#248
SebTardif merged 2 commits into
mainfrom
fix/improve-mpi-20260828-s0700

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

Summary

Configure MCP treated any JSON.parse failure as an empty object, so a
VS Code mcp.json that used comments or a trailing comma was rewritten
to only patchloom. Other MCP servers were deleted.

Parse JSONC, keep sibling servers, and refuse garbage without writing.

Why

.vscode/mcp.json is edited as JSONC. That is valid for VS Code and
invalid for JSON.parse. The old unit test called the wipe "graceful".

Verification

  • Red: JSONC fixture with a github server lost that server on current main
  • Green: sibling preserved; "not json {{{" leaves the file bytes unchanged
  • npm run check

Checklist

  • All commits in this pull request are signed off with git commit -s
  • I ran npm run check and it passes
  • I updated docs if user-facing behavior changed
  • I am contributing this work under the repository license (MIT)

parseJsonObject treated any JSON.parse failure as an empty object, so
Configure MCP overwrote VS Code mcp.json that used comments or trailing
commas. Parse JSONC, preserve sibling servers, and refuse garbage
without writing.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@SebTardif
SebTardif marked this pull request as ready for review August 28, 2026 14:23
@SebTardif
SebTardif enabled auto-merge (squash) August 28, 2026 14:23
@SebTardif
SebTardif merged commit c36ba6d into main Aug 28, 2026
22 checks passed
@SebTardif
SebTardif deleted the fix/improve-mpi-20260828-s0700 branch August 28, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant