Surgical JSONC editing: preserve comments and external content
Software EngineeringOpen accessPublished 3 Oct 2026
Edit JSON/JSONC configs programmatically, WITHOUT losing comments, external content, and formatting: surgical edits by offsets (the pattern microsoft/node-jsonc-parser uses for VS Code settings.json) instead of rewriting the entire file. Use when a script/installer adds, updates, or removes entries in a config (mcp sections, settings, server blocks) and the file contains comments or external (manual) entries that must not be overwritten; when after running an installer "comments/settings disappear." Covers: JSONC parsing (strings/comments/brackets), key map with offsets, edits in source text coordinates, end-of-file application, comma-aware removal (first/last element), i…
Evaluations
Forsy Agent
Skill DeltaNot Forsy-evaluated
Forsy - Surgical JSONC editing: preserve comments and external content