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:
parent
1b60feacab
commit
ccc25e7079
1 changed files with 8 additions and 6 deletions
|
|
@ -9,12 +9,13 @@ import (
|
||||||
|
|
||||||
// Server represents an MCP server option (from user perspective)
|
// Server represents an MCP server option (from user perspective)
|
||||||
type Server struct {
|
type Server struct {
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
Transport string `json:"transport,omitempty"` // "stdio", "sse", "http"
|
Tags []string `json:"tags,omitempty"`
|
||||||
Builtin bool `json:"builtin"` // true for system built-in, false for user-defined
|
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
|
// Attach attaches the MCP server management handlers to the router with OAuth protection
|
||||||
|
|
@ -58,6 +59,7 @@ func listServers(c *gin.Context) {
|
||||||
Value: id,
|
Value: id,
|
||||||
Name: name,
|
Name: name,
|
||||||
Description: meta.Description,
|
Description: meta.Description,
|
||||||
|
Tags: meta.Tags,
|
||||||
Transport: transport,
|
Transport: transport,
|
||||||
Builtin: meta.Builtin,
|
Builtin: meta.Builtin,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue