Skip to content

Use hujson to load MCP list from settings.json, allowing JSON comments. Closes #4430#4485

Closed
vky5 wants to merge 2 commits intosuperfly:masterfrom
vky5:fix/support-comments-in-json
Closed

Use hujson to load MCP list from settings.json, allowing JSON comments. Closes #4430#4485
vky5 wants to merge 2 commits intosuperfly:masterfrom
vky5:fix/support-comments-in-json

Conversation

@vky5
Copy link
Copy Markdown

@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

@vky5 vky5 closed this by deleting the head repository Jan 14, 2026
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