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
Binary file added kind
Binary file not shown.
5 changes: 4 additions & 1 deletion pkg/controller/mcpserver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@ func (r *MCPServerReconciler) validateMCPServer(server *kagentdevv1alpha1.MCPSer
}

// Check if required fields are present
// Allow empty image if command is npx or uvx (default images will be injected)
if server.Spec.Deployment.Image == "" {
return fmt.Errorf("deployment.image is required")
if server.Spec.Deployment.Cmd != "npx" && server.Spec.Deployment.Cmd != "uvx" {
return fmt.Errorf("deployment.image is required when command is not 'npx' or 'uvx'")
}
}

// Additional validation could be added here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ func (t *transportAdapterTranslator) translateTransportAdapterDeployment(
image := server.Spec.Deployment.Image
if image == "" && server.Spec.Deployment.Cmd == "uvx" {
image = "ghcr.io/astral-sh/uv:debian"
klog.Infof("MCPServer %s: Injected default image for uvx command: %s", server.Name, image)
}
if image == "" && server.Spec.Deployment.Cmd == "npx" {
image = "node:24-alpine3.21"
klog.Infof("MCPServer %s: Injected default image for npx command: %s", server.Name, image)
}
if image == "" {
return nil, fmt.Errorf("image must be specified for MCPServer %s or the command must be 'uvx' or 'npx'", server.Name)
Expand Down
Loading