mcp

package
v0.0.0-...-1e484f9 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxOutputLines defines the maximum number of lines to return from command output
	MaxOutputLines = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Image is the container image to use for running the commands on the node.
	Image string
}

Config contains the configuration for the kernel MCP server.

type MCPServer

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

MCPServer provides MCP server functionality for kernel operations.

func NewMCPServer

func NewMCPServer(k8sMcpServer *kubernetesmcp.MCPServer, cfg Config) *MCPServer

NewMCPServer creates a new MCP server instance

func (*MCPServer) AddTools

func (s *MCPServer) AddTools(server *mcp.Server)

AddTools registers all kernel-related MCP tools

func (*MCPServer) GetConntrack

GetConntrack MCP handler for conntrack operations. GetConntrack retrieves connection tracking entries from a Kubernetes node. TODO: Add support for conntrack event monitoring (-E flag). TODO: Add support for -G (get specific entry) command.

func (*MCPServer) GetIPCommandOutput

func (s *MCPServer) GetIPCommandOutput(ctx context.Context, req *mcp.CallToolRequest, in types.ListIPParams) (*mcp.CallToolResult, types.Result, error)

GetIPCommandOutput MCP handler for ip utility operations. GetIPCommandOutput executes 'ip' utility commands on a node. Requires ip utility in the debug container image.

func (*MCPServer) GetIptables

GetIptables MCP handler for iptables operations. GetIptables retrieves iptables/ip6tables rules from a Kubernetes node. Automatically detects IPv6 and uses ip6tables when needed.

func (*MCPServer) GetNFT

GetNFT MCP handler for nftables operations. GetNFT retrieves nftables configuration from a Kubernetes node.

Jump to

Keyboard shortcuts

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