Skip to content

feat: Support YAML for MCP server configuration#85

Open
zyfy29 wants to merge 4 commits intomcpjungle:mainfrom
zyfy29:feat-yaml-config
Open

feat: Support YAML for MCP server configuration#85
zyfy29 wants to merge 4 commits intomcpjungle:mainfrom
zyfy29:feat-yaml-config

Conversation

@zyfy29
Copy link

@zyfy29 zyfy29 commented Aug 30, 2025

close #78

Copilot AI review requested due to automatic review settings August 30, 2025 11:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds YAML support for MCP server configuration files, allowing users to register servers using either JSON or YAML format. This enhances user experience by providing flexibility in configuration file formats.

  • Added YAML struct tags to RegisterServerInput fields alongside existing JSON tags
  • Implemented file extension-based format detection (.json, .yaml, .yml)
  • Created separate parsing functions for JSON and YAML formats with comprehensive test coverage

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/types/mcp_server.go Added YAML struct tags to all RegisterServerInput fields
cmd/register.go Refactored config reading to support both JSON and YAML formats with extension detection
cmd/register_test.go Added comprehensive tests for both JSON and YAML configuration parsing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cmd/register.go Outdated
}
defer f.Close()
ext := filepath.Ext(filePath)
switch ext {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, do you think it is better to take out the whole configuration parsing logic into a separate package?
There are also some other commands that now rely on finding & parsing configurations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this logic should be reuseble.

@duaraghav8
Copy link
Member

@zyfy29 everything looks great. Mainly 2 things from me:

  • please resolve the conflict
  • let's take the config parsing out into its own separate package

@duaraghav8 duaraghav8 force-pushed the main branch 2 times, most recently from c445a3e to bf87f96 Compare September 8, 2025 21:28
@zyfy29
Copy link
Author

zyfy29 commented Sep 9, 2025

OK, I'll look at this today.

@zyfy29
Copy link
Author

zyfy29 commented Sep 17, 2025

Sorry for the late response, I was preparing for interviews... What do you think of the implementation now?

@zyfy29 zyfy29 requested a review from duaraghav8 September 17, 2025 08:36
@duaraghav8
Copy link
Member

@zyfy29 thanks! Looks cleaner now, I will do one final round of testing myself and then merge

@duaraghav8 duaraghav8 moved this to In progress in MCPJungle Sep 18, 2025
@duaraghav8 duaraghav8 moved this from In progress to In review in MCPJungle Sep 18, 2025
@duaraghav8 duaraghav8 force-pushed the main branch 2 times, most recently from e6f9f3d to 321f552 Compare October 8, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Support YAML for MCP server configuration

3 participants