Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new configuration option to pretty print JSON output from the server and refactors the server setup to use a dedicated configuration struct.
- Introduces a runConfig struct to encapsulate server configuration options.
- Adds a pretty-print-json flag and implements JSONPrettyPrintWriter for pretty printing JSON output.
Comments suppressed due to low confidence (2)
cmd/github-mcp-server/main.go:123
- Add tests for JSONPrettyPrintWriter to validate the pretty printing behavior with various JSON inputs, including invalid JSON scenarios.
func (j JSONPrettyPrintWriter) Write(p []byte) (n int, err error) {
cmd/github-mcp-server/main.go:131
- Consider adding tests for runStdioServer to verify that all configuration options (including the new pretty-print-json flag) are correctly handled.
func runStdioServer(cfg runConfig) error {
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
toby
approved these changes
Apr 5, 2025
| } | ||
|
|
||
| func runStdioServer(readOnly bool, logger *log.Logger, logCommands bool, exportTranslations bool) error { | ||
| type runConfig struct { |
Member
There was a problem hiding this comment.
I'd probably just call this config but other than that lgtm!
Collaborator
Author
There was a problem hiding this comment.
going to leave it so you don't have to do another review
There was a problem hiding this comment.
I'd probably just call this
configbut other than that lgtm!
DaleSeo
pushed a commit
to DaleSeo/github-mcp-server
that referenced
this pull request
Oct 24, 2025
|
Hu |
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.
Closes: #113
Introduces a new flag
pretty-print-jsonwhich will format json output from the server for easier visualization.As the list of configuration options was growing, I opted to add a config struct instead of adding one more to the pile.
(partial output in the screenshot below)

With all of this code in main, there isn't a good way to add tests here and it felt a bit out of place to add to pkg/github/server.go
A refactor would be very helpful to make this easier.
I did not add a new option to the launch.json for it, as I feel like it is still best to be disabled by default.
A future enhancement might be to incorporate https://github.com/cli/go-gh/blob/61bf393cf4aeea6d00a6251390f5f67f5b67e727/pkg/jsonpretty/format.go