kube

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger zerolog.Logger) tools.Tool

Types

type Input

type Input struct {
	Action     string   `json:"action" validate:"required,oneof=port-forward stop-port-forward get create delete apply"` // Action to perform (e.g., "port-forward", "stop-port-forward", "get", "create", "delete", "apply")
	Namespace  string   `json:"namespace,omitempty" validate:"omitempty,alphanum|contains=-,max=63"`                     // Kubernetes namespace (default: "default")
	Resource   string   `json:"resource,omitempty" validate:"omitempty,max=512"`                                         // Resource to act on (e.g., "pod/my-pod", "deployment/my-deployment", "service/my-service")
	LocalPort  int      `json:"local_port,omitempty" validate:"min=0,max=65535"`                                         // Local port for port-forward (default: 6060)
	RemotePort int      `json:"remote_port,omitempty" validate:"min=0,max=65535"`                                        // Remote port for port-forward
	KubeConfig string   `json:"kubeconfig,omitempty" validate:"omitempty,filepath"`                                      // Path to kubeconfig file
	Context    string   `json:"context,omitempty" validate:"omitempty,alphanum|contains=-|contains=_,max=253"`           // Kubernetes context to use
	ExtraArgs  []string `json:"extra_args,omitempty"`                                                                    // Additional kubectl arguments
}

type Output

type Output struct {
	Action     string `json:"action"`
	Namespace  string `json:"namespace"`
	Resource   string `json:"resource,omitempty"`
	LocalPort  int    `json:"local_port,omitempty"`
	RemotePort int    `json:"remote_port,omitempty"`
	Status     string `json:"status"`
	Message    string `json:"message"`
	Command    string `json:"command,omitempty"`
}

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

func (*Tool) KubeHandler

func (k *Tool) KubeHandler(ctx context.Context, _ *mcp.CallToolRequest, input Input) (*mcp.CallToolResult, Output, error)

func (*Tool) Register

func (k *Tool) Register(srv *server.Server)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL