Documentation
¶
Index ¶
- Constants
- type Config
- type MCPServer
- func (s *MCPServer) AddTools(server *mcp.Server)
- func (s *MCPServer) GetConntrack(ctx context.Context, req *mcp.CallToolRequest, in types.ListConntrackParams) (*mcp.CallToolResult, types.Result, error)
- func (s *MCPServer) GetIPCommandOutput(ctx context.Context, req *mcp.CallToolRequest, in types.ListIPParams) (*mcp.CallToolResult, types.Result, error)
- func (s *MCPServer) GetIptables(ctx context.Context, req *mcp.CallToolRequest, in types.ListIPTablesParams) (*mcp.CallToolResult, types.Result, error)
- func (s *MCPServer) GetNFT(ctx context.Context, req *mcp.CallToolRequest, in types.ListNFTParams) (*mcp.CallToolResult, types.Result, error)
Constants ¶
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) GetConntrack ¶
func (s *MCPServer) GetConntrack(ctx context.Context, req *mcp.CallToolRequest, in types.ListConntrackParams) (*mcp.CallToolResult, types.Result, error)
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 ¶
func (s *MCPServer) GetIptables(ctx context.Context, req *mcp.CallToolRequest, in types.ListIPTablesParams) (*mcp.CallToolResult, types.Result, error)
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 ¶
func (s *MCPServer) GetNFT(ctx context.Context, req *mcp.CallToolRequest, in types.ListNFTParams) (*mcp.CallToolResult, types.Result, error)
GetNFT MCP handler for nftables operations. GetNFT retrieves nftables configuration from a Kubernetes node.