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.
This commit is contained in:
Max 2026-03-02 15:05:11 +08:00
parent 1b60feacab
commit ccc25e7079

View file

@ -13,6 +13,7 @@ type Server struct {
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
}
@ -58,6 +59,7 @@ func listServers(c *gin.Context) {
Value: id,
Name: name,
Description: meta.Description,
Tags: meta.Tags,
Transport: transport,
Builtin: meta.Builtin,
})