mcp

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 9 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 ConfigEnvsAddInput added in v0.50.0

type ConfigEnvsAddInput struct {
	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 `` /* 127-byte string literal not displayed */
	SecretName    *string `json:"secretName,omitempty" jsonschema:"Name of the Kubernetes Secret to source the value from"`
	SecretKey     *string `json:"secretKey,omitempty" jsonschema:"Key within the Secret; omit to import all keys as env vars"`
	ConfigMapName *string `json:"configMapName,omitempty" jsonschema:"Name of the Kubernetes ConfigMap to source the value from"`
	ConfigMapKey  *string `json:"configMapKey,omitempty" jsonschema:"Key within the ConfigMap; omit to import all keys as env vars"`
	Verbose       *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigEnvsAddInput) Args added in v0.50.0

func (i ConfigEnvsAddInput) Args() []string

type ConfigEnvsAddOutput added in v0.50.0

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

type ConfigEnvsListInput added in v0.50.0

type ConfigEnvsListInput struct {
	Path    string `json:"path" jsonschema:"required,Path to the function project directory"`
	Verbose *bool  `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigEnvsListInput) Args added in v0.50.0

func (i ConfigEnvsListInput) Args() []string

type ConfigEnvsListOutput added in v0.50.0

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

type ConfigEnvsRemoveInput added in v0.50.0

type ConfigEnvsRemoveInput struct {
	Path    string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Name    *string `json:"name,omitempty" jsonschema:"Name of the environment variable to remove"`
	Verbose *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigEnvsRemoveInput) Args added in v0.50.0

func (i ConfigEnvsRemoveInput) Args() []string

type ConfigEnvsRemoveOutput added in v0.50.0

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

type ConfigLabelsAddInput added in v0.50.0

type ConfigLabelsAddInput struct {
	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"`
	Verbose *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigLabelsAddInput) Args added in v0.50.0

func (i ConfigLabelsAddInput) Args() []string

type ConfigLabelsAddOutput added in v0.50.0

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

type ConfigLabelsListInput added in v0.50.0

type ConfigLabelsListInput struct {
	Path    string `json:"path" jsonschema:"required,Path to the function project directory"`
	Verbose *bool  `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigLabelsListInput) Args added in v0.50.0

func (i ConfigLabelsListInput) Args() []string

type ConfigLabelsListOutput added in v0.50.0

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

type ConfigLabelsRemoveInput added in v0.50.0

type ConfigLabelsRemoveInput struct {
	Path    string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Name    *string `json:"name,omitempty" jsonschema:"Name of the label to remove"`
	Verbose *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigLabelsRemoveInput) Args added in v0.50.0

func (i ConfigLabelsRemoveInput) Args() []string

type ConfigLabelsRemoveOutput added in v0.50.0

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

type ConfigVolumesAddInput added in v0.50.0

type ConfigVolumesAddInput struct {
	Path      string  `json:"path" jsonschema:"required,Path to the function project directory"`
	Type      *string `json:"type,omitempty" jsonschema:"Volume type: 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"`
}

func (ConfigVolumesAddInput) Args added in v0.50.0

func (i ConfigVolumesAddInput) Args() []string

type ConfigVolumesAddOutput added in v0.50.0

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

type ConfigVolumesListInput added in v0.50.0

type ConfigVolumesListInput struct {
	Path    string `json:"path" jsonschema:"required,Path to the function project directory"`
	Verbose *bool  `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigVolumesListInput) Args added in v0.50.0

func (i ConfigVolumesListInput) Args() []string

type ConfigVolumesListOutput added in v0.50.0

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

type ConfigVolumesRemoveInput added in v0.50.0

type ConfigVolumesRemoveInput struct {
	Path      string  `json:"path" jsonschema:"required,Path to the function project directory"`
	MountPath *string `json:"mountPath,omitempty" jsonschema:"Mount path of the volume to remove"`
	Verbose   *bool   `json:"verbose,omitempty" jsonschema:"Enable verbose logging output"`
}

func (ConfigVolumesRemoveInput) Args added in v0.50.0

func (i ConfigVolumesRemoveInput) Args() []string

type ConfigVolumesRemoveOutput added in v0.50.0

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

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       *bool   `json:"all,omitempty" jsonschema:"Delete all related resources like Pipelines, Secrets"`
	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"`
	Version string `json:"version" jsonschema:"Version of the MCP server"`
}

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"). The prefix is validated to reject shell metacharacters.

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) error

Start the MCP server using the configured transport. The server's readonly mode is determined at construction time via WithReadonly; it cannot be changed after the server is created.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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