mcp

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRunner

type CommandRunner interface {
	Subscribe(ch chan<- command.Event)
	ConfigureContext(ctx context.Context, opts ...command.RunnerOpt) error
	RunContext(ctx context.Context) command.Output
	SendEvent(evt command.Event)
}

type ExecutionState

type ExecutionState struct {
	Output command.Output
}

ExecutionState tracks the current state of command execution.

type GetResourceParams

type GetResourceParams struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Name       string `json:"name"`
	Namespace  string `json:"namespace"`
	Path       string `json:"path"`
}

GetResourceParams defines parameters for the get_resource tool.

type GetResourceResult

type GetResourceResult struct {
	Resource *ResourceDetails `json:"resource,omitempty"`
	Error    string           `json:"error,omitempty"`
	Message  string           `json:"message"`
	Found    bool             `json:"found"`
}

GetResourceResult contains the result of getting a single resource.

type ListResourcesParams

type ListResourcesParams struct {
	Path string `json:"path"`
}

ListResourcesParams defines parameters for the list_resources tool.

type ListResourcesResult

type ListResourcesResult struct {
	Error         string                  `json:"error,omitempty"`
	StdoutPreview string                  `json:"stdoutPreview"`
	StderrPreview string                  `json:"stderrPreview"`
	Message       string                  `json:"message"`
	Resources     []kube.ResourceMetadata `json:"resources"`
	ResourceCount int                     `json:"resourceCount"`
}

ListResourcesResult contains the result of listing resources.

type ResourceDetails

type ResourceDetails struct {
	Metadata kube.ResourceMetadata `json:"metadata"`
	YAML     string                `json:"yaml"`
}

ResourceDetails contains detailed information about a Kubernetes resource.

type Server

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

Server implements the MCP server for kat.

func NewServer

func NewServer(address string, runner CommandRunner, initialPath string) (*Server, error)

NewServer creates a new Server.

func (*Server) Close

func (s *Server) Close()

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Serve starts the MCP server.

func (*Server) Server

func (s *Server) Server() *mcp.Server

type TracedToolHandler

type TracedToolHandler[In, Out any] func(
	context.Context,
	*mcp.CallToolRequest,
	In,
) (*mcp.CallToolResult, Out, error)

TracedToolHandler wraps an MCP ToolHandlerFor with automatic tracing and logging.

Jump to

Keyboard shortcuts

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