mcp

package
v5.28.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mcp provides an MCP server for exposing KSail commands as tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(cfg ServerConfig) (*mcpsdk.Server, error)

NewServer creates and configures a new MCP server with KSail tools.

func RunServer

func RunServer(ctx context.Context, cfg ServerConfig) error

RunServer creates and runs an MCP server over stdio. This is the main entry point for the MCP server.

Types

type ServerConfig

type ServerConfig struct {
	// Name is the server name.
	Name string
	// Version is the server version.
	Version string
	// RootCmd is the root Cobra command for tool generation.
	RootCmd *cobra.Command
	// Logger is the logger for the server (optional).
	Logger *slog.Logger
	// WorkingDirectory is the directory to run commands in (defaults to current directory).
	WorkingDirectory string
}

ServerConfig contains configuration for the MCP server.

func DefaultConfig

func DefaultConfig(rootCmd *cobra.Command, version string) ServerConfig

DefaultConfig returns a default server configuration.

Jump to

Keyboard shortcuts

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