mcp

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInput added in v0.48.0

type BuildInput struct {
	Path             string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Builder          *string `json:"builder,omitempty" jsonschema:"Builder to use (pack, s2i, or host)"`
	Registry         *string `json:"registry,omitempty" jsonschema:"Container registry for function image"`
	BuilderImage     *string `json:"builderImage,omitempty" jsonschema:"Custom builder image to use with buildpacks"`
	Image            *string `json:"image,omitempty" jsonschema:"Full image name (overrides registry)"`
	Platform         *string `json:"platform,omitempty" jsonschema:"Target platform (e.g., linux/amd64)"`
	Push             *bool   `json:"push,omitempty" jsonschema:"Push image to registry after building"`
	RegistryInsecure *bool   `json:"registryInsecure,omitempty" jsonschema:"Skip TLS verification for insecure registries"`
	BuildTimestamp   *bool   `json:"buildTimestamp,omitempty" jsonschema:"Use actual time for image timestamp (buildpacks only)"`
	Verbose          *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

BuildInput defines the input parameters for the build tool.

func (BuildInput) Args added in v0.48.0

func (i BuildInput) Args() []string

type BuildOutput added in v0.48.0

type BuildOutput struct {
	Image   string `json:"image,omitempty" jsonschema:"The built image name"`
	Message string `json:"message" jsonschema:"Output message from func command"`
}

BuildOutput defines the structured output returned by the build tool.

type ConfigEnvsInput added in v0.48.0

type ConfigEnvsInput struct {
	Action  string  `json:"action" jsonschema:"required,Action to perform: add, remove, or list"`
	Path    string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Name    *string `json:"name,omitempty" jsonschema:"Name of the environment variable"`
	Value   *string `json:"value,omitempty" jsonschema:"Value of the environment variable (for add action)"`
	Verbose *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

ConfigEnvsInput defines the input parameters for the config_envs tool.

func (ConfigEnvsInput) Args added in v0.48.0

func (i ConfigEnvsInput) Args() []string

type ConfigEnvsOutput added in v0.48.0

type ConfigEnvsOutput struct {
	Message string `json:"message" jsonschema:"Output message"`
}

ConfigEnvsOutput defines the structured output returned by the config_envs tool.

type ConfigLabelsInput added in v0.48.0

type ConfigLabelsInput struct {
	Action  string  `json:"action" jsonschema:"required,Action to perform: add, remove, or list"`
	Path    string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Name    *string `json:"name,omitempty" jsonschema:"Name of the label"`
	Value   *string `json:"value,omitempty" jsonschema:"Value of the label (for add action)"`
	Verbose *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

ConfigLabelsInput defines the input parameters for the config_labels tool.

func (ConfigLabelsInput) Args added in v0.48.0

func (i ConfigLabelsInput) Args() []string

type ConfigLabelsOutput added in v0.48.0

type ConfigLabelsOutput struct {
	Message string `json:"message" jsonschema:"Output message"`
}

ConfigLabelsOutput defines the structured output returned by the config_labels tool.

type ConfigVolumesInput added in v0.48.0

type ConfigVolumesInput struct {
	Action    string  `json:"action" jsonschema:"required,Action to perform: add, remove, or list"`
	Path      string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Type      *string `json:"type,omitempty" jsonschema:"Volume type for add action: configmap, secret, pvc, or emptydir"`
	MountPath *string `json:"mountPath,omitempty" jsonschema:"Mount path for the volume in the container"`
	Source    *string `json:"source,omitempty" jsonschema:"Name of the ConfigMap, Secret, or PVC to mount"`
	Medium    *string `json:"medium,omitempty" jsonschema:"Storage medium for EmptyDir volume: Memory or empty string"`
	Size      *string `json:"size,omitempty" jsonschema:"Maximum size limit for EmptyDir volume (e.g., 1Gi)"`
	ReadOnly  *bool   `json:"readOnly,omitempty" jsonschema:"Mount volume as read-only (only for PVC)"`
	Verbose   *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

ConfigVolumesInput defines the input parameters for the config_volumes tool.

func (ConfigVolumesInput) Args added in v0.48.0

func (i ConfigVolumesInput) Args() []string

type ConfigVolumesOutput added in v0.48.0

type ConfigVolumesOutput struct {
	Message string `json:"message" jsonschema:"Output message"`
}

ConfigVolumesOutput defines the structured output returned by the config_volumes tool.

type CreateInput added in v0.48.0

type CreateInput struct {
	Language   string  `json:"language" jsonschema:"required,Language runtime to use"`
	Path       string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Template   *string `json:"template,omitempty" jsonschema:"Function template (e.g., http, cloudevents)"`
	Repository *string `json:"repository,omitempty" jsonschema:"Git repository URI containing custom templates"`
	Verbose    *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (CreateInput) Args added in v0.48.0

func (i CreateInput) Args() []string

type CreateOutput added in v0.48.0

type CreateOutput struct {
	Runtime  string  `json:"runtime" jsonschema:"Language runtime used"`
	Template *string `json:"template" jsonschema:"Template used"`
	Message  string  `json:"message,omitempty" jsonschema:"Output message"`
}

type DeleteInput added in v0.48.0

type DeleteInput struct {
	Path      *string `json:"path,omitempty" jsonschema:"Path to the function project directory (mutually exclusive with name)"`
	Name      *string `json:"name,omitempty" jsonschema:"Name of the function to delete (mutually exclusive with path)"`
	Namespace *string `json:"namespace,omitempty" jsonschema:"Kubernetes namespace to delete from (default: current or active namespace)"`
	All       *string `json:"all,omitempty" jsonschema:"Delete all related resources like Pipelines, Secrets (true/false)"`
	Verbose   *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

DeleteInput defines the input parameters for the delete tool. Exactly one of Path or Name must be provided.

func (DeleteInput) Args added in v0.48.0

func (i DeleteInput) Args() []string

type DeleteOutput added in v0.48.0

type DeleteOutput struct {
	Message string `json:"message" jsonschema:"Output message"`
}

DeleteOutput defines the structured output returned by the delete tool.

type DeployInput added in v0.48.0

type DeployInput struct {
	Path               string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Builder            *string `json:"builder,omitempty" jsonschema:"Builder to use (pack, s2i, or host)"`
	Registry           *string `json:"registry,omitempty" jsonschema:"Container registry for function image"`
	Image              *string `json:"image,omitempty" jsonschema:"Full image name (overrides registry)"`
	Namespace          *string `json:"namespace,omitempty" jsonschema:"Kubernetes namespace to deploy into"`
	GitURL             *string `json:"gitUrl,omitempty" jsonschema:"Git URL containing the function source"`
	GitBranch          *string `json:"gitBranch,omitempty" jsonschema:"Git branch for remote deployment"`
	GitDir             *string `json:"gitDir,omitempty" jsonschema:"Directory inside the Git repository"`
	BuilderImage       *string `json:"builderImage,omitempty" jsonschema:"Custom builder image"`
	Domain             *string `json:"domain,omitempty" jsonschema:"Domain for the function route"`
	Platform           *string `json:"platform,omitempty" jsonschema:"Target platform (e.g., linux/amd64)"`
	Build              *string `json:"build,omitempty" jsonschema:"Build control: true, false, or auto"`
	PVCSize            *string `json:"pvcSize,omitempty" jsonschema:"Custom volume size for remote builds"`
	ServiceAccount     *string `json:"serviceAccount,omitempty" jsonschema:"Kubernetes ServiceAccount to use"`
	RemoteStorageClass *string `json:"remoteStorageClass,omitempty" jsonschema:"Storage class for remote volume"`
	Push               *bool   `json:"push,omitempty" jsonschema:"Push image to registry before deployment"`
	RegistryInsecure   *bool   `json:"registryInsecure,omitempty" jsonschema:"Skip TLS verification for registry"`
	BuildTimestamp     *bool   `json:"buildTimestamp,omitempty" jsonschema:"Use actual time in image metadata"`
	Remote             *bool   `json:"remote,omitempty" jsonschema:"Trigger remote deployment"`
	Verbose            *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

DeployInput defines the input parameters for the deploy tool.

func (DeployInput) Args added in v0.48.0

func (i DeployInput) Args() []string

type DeployOutput added in v0.48.0

type DeployOutput struct {
	URL     string `json:"url,omitempty" jsonschema:"The deployed Function URL"`
	Image   string `json:"image,omitempty" jsonschema:"The Function image name"`
	Message string `json:"message" jsonschema:"Output message"`
}

DeployOutput defines the structured output returned by the deploy tool.

type HealthcheckInput added in v0.48.0

type HealthcheckInput struct{}

HealthcheckInput defines the input parameters for the healthcheck tool. No parameters are required for healthcheck.

type HealthcheckOutput added in v0.48.0

type HealthcheckOutput struct {
	Status  string `json:"status" jsonschema:"Status of the server (ok)"`
	Message string `json:"message" jsonschema:"Healthcheck message"`
}

HealthcheckOutput defines the structured output returned by the healthcheck tool.

type ListInput added in v0.48.0

type ListInput struct {
	AllNamespaces *bool   `json:"allNamespaces,omitempty" jsonschema:"List functions in all namespaces (overrides namespace parameter)"`
	Namespace     *string `json:"namespace,omitempty" jsonschema:"Kubernetes namespace to list functions in (default: current namespace)"`
	Output        *string `json:"output,omitempty" jsonschema:"Output format: human, plain, json, xml, or yaml"`
	Verbose       *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

ListInput defines the input parameters for the list tool. All fields are optional since list can work without any parameters.

func (ListInput) Args added in v0.48.0

func (i ListInput) Args() []string

type ListOutput added in v0.48.0

type ListOutput struct {
	Message string `json:"message" jsonschema:"Output message"`
}

ListOutput defines the structured output returned by the list tool.

type Option added in v0.48.0

type Option func(*Server)

func WithExecutor added in v0.48.0

func WithExecutor(executor executor) Option

WithExecutor sets a custom executor for running commands; used in tests.

func WithPrefix added in v0.48.0

func WithPrefix(prefix string) Option

WithPrefix sets the command prefix (e.g., "func" or "kn func")

func WithReadonly added in v0.48.0

func WithReadonly(readonly bool) Option

WithReadonly sets the server to readonly mode.

func WithTransport added in v0.48.0

func WithTransport(transport mcp.Transport) Option

WithTransport sets a custom transport for the server; used in tests.

type Server added in v0.48.0

type Server struct {
	OnInit func(context.Context) // Invoked when the server is initialized
	// contains filtered or unexported fields
}

Server is an MCP Server instance

func New added in v0.48.0

func New(options ...Option) *Server

New MCP Server

func (*Server) Start added in v0.48.0

func (s *Server) Start(ctx context.Context, writeEnabled bool) error

Start the MCP server using the configured transport

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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