mcp

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSSEServer

func CreateSSEServer(mcpServer *server.MCPServer) *server.SSEServer

CreateSSEServer creates a new SSE server for the MCP server

func CreateServer

func CreateServer(k8sClient *k8s.Client) *server.MCPServer

CreateServer creates a new MCP server for Kubernetes

func NewApplyResourceTool

func NewApplyResourceTool() mcp.Tool

NewApplyResourceTool creates a new apply_resource tool

func NewClusteredResourceTemplate

func NewClusteredResourceTemplate() mcp.ResourceTemplate

NewClusteredResourceTemplate creates a new clustered resource template

func NewListResourcesTool

func NewListResourcesTool() mcp.Tool

NewListResourcesTool creates a new list_resources tool

func NewNamespacedResourceTemplate

func NewNamespacedResourceTemplate() mcp.ResourceTemplate

NewNamespacedResourceTemplate creates a new namespaced resource template

Types

type Implementation

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

Implementation implements the MCP protocol

func NewImplementation

func NewImplementation(k8sClient *k8s.Client) *Implementation

NewImplementation creates a new MCP implementation

func (*Implementation) HandleApplyResource

func (m *Implementation) HandleApplyResource(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

HandleApplyResource handles the apply_resource tool

func (*Implementation) HandleClusteredResource

func (m *Implementation) HandleClusteredResource(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

HandleClusteredResource handles the clustered resource template

func (*Implementation) HandleListAllResources

func (m *Implementation) HandleListAllResources(ctx context.Context) ([]mcp.Resource, error)

HandleListAllResources handles the listResources request

func (*Implementation) HandleListResources

func (m *Implementation) HandleListResources(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

HandleListResources handles the list_resources tool

func (*Implementation) HandleNamespacedResource

func (m *Implementation) HandleNamespacedResource(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

HandleNamespacedResource handles the namespaced resource template

type ResourceURIComponents

type ResourceURIComponents struct {
	Group     string
	Version   string
	Resource  string
	Name      string
	Namespace string // Only for namespaced resources
}

ResourceURIComponents represents the components of a Kubernetes resource URI

Jump to

Keyboard shortcuts

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