Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/api/handlers/mcpcatalogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,11 @@ func (h *MCPCatalogHandler) RefreshCompositeComponents(req api.Context) error {
}
}

// Validate the refreshed manifest to ensure it's still valid
if err := validation.ValidateCatalogEntryManifest(entry.Spec.Manifest); err != nil {
return types.NewErrBadRequest("failed to validate entry manifest: %v", err)
}

// Update the entry
if err := req.Update(&entry); err != nil {
return fmt.Errorf("failed to update entry: %w", err)
Expand Down
9 changes: 7 additions & 2 deletions pkg/storage/apis/obot.obot.ai/v1/mcpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,18 @@ func (in *MCPServer) FieldNames() []string {
}

func (in *MCPServer) DeleteRefs() []Ref {
return []Ref{
refs := []Ref{
{ObjType: &Thread{}, Name: in.Spec.ThreadName},
{ObjType: &MCPServerCatalogEntry{}, Name: in.Spec.MCPServerCatalogEntryName},
{ObjType: &MCPCatalog{}, Name: in.Spec.MCPCatalogID},
{ObjType: &PowerUserWorkspace{}, Name: in.Spec.PowerUserWorkspaceID},
{ObjType: &MCPServer{}, Name: in.Spec.CompositeName},
}
if in.Spec.CompositeName == "" {
// Only garbage collect an MCP server when the catalog entry is deleted if it's not a component of a composite MCP server.
// Component MCP servers get their manifest from the composite catalog entry instead.
refs = append(refs, Ref{ObjType: &MCPServerCatalogEntry{}, Name: in.Spec.MCPServerCatalogEntryName})
}
return refs
}

type MCPServerSpec struct {
Expand Down
Loading