diff --git a/registry/mcp_model.go b/registry/mcp_model.go index 9a491149b..19567f8bc 100644 --- a/registry/mcp_model.go +++ b/registry/mcp_model.go @@ -43,7 +43,7 @@ type McpServerRule struct { MatchRoute []string `json:"_match_route_,omitempty"` Server *ServerConfig `json:"server,omitempty"` Tools []*McpTool `json:"tools,omitempty"` - AllowTools []string `json:"allowTools,omitempty"` + AllowTools []string `json:"allowTools"` } type ServerConfig struct { diff --git a/registry/nacos/mcpserver/watcher.go b/registry/nacos/mcpserver/watcher.go index 4472df70d..ba8319f1f 100644 --- a/registry/nacos/mcpserver/watcher.go +++ b/registry/nacos/mcpserver/watcher.go @@ -434,7 +434,7 @@ func (w *watcher) processToolConfig(dataId, data string, credentials map[string] rule.Server.SecuritySchemes = toolsDescription.SecuritySchemes } - var allowTools []string + allowTools := []string{} for _, t := range toolsDescription.Tools { convertTool := &provider.McpTool{Name: t.Name, Description: t.Description} @@ -813,6 +813,9 @@ func generateServiceEntry(host string, services *model.Service) *v1alpha3.Servic endpoints := make([]*v1alpha3.WorkloadEntry, 0) for _, service := range services.Hosts { + if !service.Healthy || !service.Enable { + continue + } protocol := common.HTTP if service.Metadata != nil && service.Metadata["protocol"] != "" { protocol = common.ParseProtocol(service.Metadata["protocol"])