From 5d9171bdccf579398273806a7067cda29e88363c Mon Sep 17 00:00:00 2001 From: Yusheng Guo <113574546+yshngg@users.noreply.github.com> Date: Mon, 26 May 2025 04:24:40 +0800 Subject: [PATCH] fix(model): inline ServerDetail fields in PublishRequest (#62) Inline ServerDetail fields in PublishRequest ## Motivation and Context Fix #55 ## How Has This Been Tested? ## Breaking Changes ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [x] I have added appropriate error handling - [x] I have added or updated documentation as needed ## Additional context https://github.com/modelcontextprotocol/registry/blob/94c19fafa45896df4ea55fc2fd06309b42499393/scripts/test_publish.sh#L61-L102 --------- Co-authored-by: Avinash Sridhar --- internal/model/model.go | 2 +- tools/publisher/main.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/model/model.go b/internal/model/model.go index 2f908ca..7090ff5 100644 --- a/internal/model/model.go +++ b/internal/model/model.go @@ -19,7 +19,7 @@ type Authentication struct { // PublishRequest represents a request to publish a server to the registry type PublishRequest struct { - ServerDetail ServerDetail `json:"server_detail"` + ServerDetail `json:",inline"` Authentication Authentication `json:"-"` // Now provided via Authorization header AuthStatusToken string `json:"-"` // Used internally for device flows } diff --git a/tools/publisher/main.go b/tools/publisher/main.go index 80b006a..638076f 100644 --- a/tools/publisher/main.go +++ b/tools/publisher/main.go @@ -294,9 +294,7 @@ func publishToRegistry(registryURL string, mcpData []byte, token string) error { } // Create the publish request payload (without authentication) - publishReq := map[string]interface{}{ - "server_detail": mcpDetails, - } + publishReq := mcpDetails // Convert the request to JSON jsonData, err := json.Marshal(publishReq)