From ccc25e70797935e711f7c2144189f858384c9515 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 2 Mar 2026 15:05:11 +0800 Subject: [PATCH] Add tags field to Server struct in MCP model - Introduce a new Tags field in the Server struct to allow for additional metadata. - Update the listServers function to populate the Tags field from the server metadata, enhancing the server representation with more contextual information. --- openapi/mcp/mcp.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openapi/mcp/mcp.go b/openapi/mcp/mcp.go index a73e5ef2..0f9c9484 100644 --- a/openapi/mcp/mcp.go +++ b/openapi/mcp/mcp.go @@ -9,12 +9,13 @@ import ( // Server represents an MCP server option (from user perspective) type Server struct { - Label string `json:"label"` - Value string `json:"value"` - Name string `json:"name"` - Description string `json:"description,omitempty"` - Transport string `json:"transport,omitempty"` // "stdio", "sse", "http" - Builtin bool `json:"builtin"` // true for system built-in, false for user-defined + Label string `json:"label"` + Value string `json:"value"` + Name string `json:"name"` + Description string `json:"description,omitempty"` + Tags []string `json:"tags,omitempty"` + Transport string `json:"transport,omitempty"` // "stdio", "sse", "http" + Builtin bool `json:"builtin"` // true for system built-in, false for user-defined } // Attach attaches the MCP server management handlers to the router with OAuth protection @@ -58,6 +59,7 @@ func listServers(c *gin.Context) { Value: id, Name: name, Description: meta.Description, + Tags: meta.Tags, Transport: transport, Builtin: meta.Builtin, })