cmdutil

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package cmdutil provides shared command-line helpers for MCP binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggingFlags

type LoggingFlags struct {
	LogFile   string
	LogFormat string
	LogLevel  slog.Level
}

LoggingFlags are common flags for configuring slog output.

func (*LoggingFlags) Register

func (flags *LoggingFlags) Register(fs *flag.FlagSet)

Register registers common logging flags on fs.

func (*LoggingFlags) Setup

func (flags *LoggingFlags) Setup() (func(), *slog.Logger, error)

Setup configures slog from common logging flags.

type RunOptions added in v0.4.0

type RunOptions struct {
	Name       string
	Server     *mcp.Server
	Handler    func(*http.Request) *mcp.Server
	Middleware func(http.Handler) http.Handler
	Logger     *slog.Logger
}

RunOptions configures TransportFlags.Run.

type TransportFlags

type TransportFlags struct {
	Transport                  string
	Addr                       string
	TLSCertFile                string
	TLSKeyFile                 string
	TLSClientCAFile            string
	ExposeProvider             string
	ExposeType                 string
	ExposeConfig               string
	ExposeName                 string
	DisableLocalhostProtection bool
}

TransportFlags are common MCP server transport flags.

func (*TransportFlags) Register

func (flags *TransportFlags) Register(fs *flag.FlagSet)

Register registers common MCP transport flags on fs.

func (TransportFlags) Run

func (flags TransportFlags) Run(ctx context.Context, opts RunOptions) error

Run starts an MCP server using the selected transport. Middleware wraps MCP endpoints only; the /health endpoint is intentionally left unwrapped.

Jump to

Keyboard shortcuts

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