Skip to content

Conversation

vky5
Copy link

@vky5 vky5 commented Jul 17, 2025

Change Summary

What and Why:

I modified the code (.//internal/command/mcp/list.go) that loads the settings.json file to use hujson, a library that extends standard JSON parsing with support for:

  • Comments (//, /* */)
  • Trailing commas

Because encoding/json, that was being used earlier, doesnt allow comments in json files which was causing issues.

How:

I replaced the standard json.Unmarshal flow with a new pipeline using hujson

  • Read file as bytes
  • Parse with hujson.Parse() → this tolerates comments
  • Convert to standard JSON using hu.Standard()
  • Unmarshal into Go struct with json.Unmarshal

Related to: #4430

Documentation

  • [ X ] Fresh Produce
  • [ X ] In superfly/docs, or asked for help from docs team
  • [ X ] n/a

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.

2 participants