Help us shape the future of Go! Take the 2026 Go Developer Survey

mcp

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffInput

type DiffInput struct {
	CommonArgs       []string `json:"common_args,omitempty" jsonschema:"Common arguments prepended to both left and right commands"`
	LeftArgs         []string `json:"left_args,omitempty" jsonschema:"Arguments specific to the left command"`
	RightArgs        []string `json:"right_args,omitempty" jsonschema:"Arguments specific to the right command"`
	Diff             string   `json:"diff,omitempty" jsonschema:"Diff command (e.g. 'diff -u', 'dyff')"`
	Shell            string   `json:"shell,omitempty" jsonschema:"Shell executable used to run subcommands (default: bash)"`
	Startup          []string `json:"startup,omitempty" jsonschema:"Commands executed before left and right commands"`
	Interceptor      []string `json:"interceptor,omitempty" jsonschema:"Commands executed between left and right commands"`
	Preprocess       []string `json:"preprocess,omitempty" jsonschema:"Filter pipeline applied to both left and right outputs"`
	LeftPreprocess   []string `json:"left_preprocess,omitempty" jsonschema:"Filter pipeline applied only to left output"`
	RightPreprocess  []string `json:"right_preprocess,omitempty" jsonschema:"Filter pipeline applied only to right output"`
	Cleanup          []string `json:"cleanup,omitempty" jsonschema:"Teardown commands executed on exit"`
	Env              []string `json:"env,omitempty" jsonschema:"Environment variables for all commands (KEY=VALUE)"`
	LeftEnv          []string `json:"left_env,omitempty" jsonschema:"Environment variables for left command only"`
	RightEnv         []string `json:"right_env,omitempty" jsonschema:"Environment variables for right command only"`
	StdinContent     string   `json:"stdin_content,omitempty" jsonschema:"Literal string passed to stdin of both commands"`
	LeftStdin        string   `json:"left_stdin,omitempty" jsonschema:"Input source for left stdin ('-' or '@filename')"`
	RightStdin       string   `json:"right_stdin,omitempty" jsonschema:"Input source for right stdin ('-' or '@filename')"`
	Snapshot         string   `json:"snapshot,omitempty" jsonschema:"Static snapshot source for both commands ('-' or '@filename')"`
	LeftSnapshot     string   `json:"left_snapshot,omitempty" jsonschema:"Static snapshot source for left command ('-' or '@filename')"`
	RightSnapshot    string   `json:"right_snapshot,omitempty" jsonschema:"Static snapshot source for right command ('-' or '@filename')"`
	UseLabel         bool     `json:"label,omitempty" jsonschema:"Pass --label arguments to diff command"`
	Success          bool     `json:"success,omitempty" jsonschema:"Exit with 0 even when diffs are detected"`
	WorkDir          string   `json:"work_dir,omitempty" jsonschema:"Working directory for temporary output files"`
	TimeoutMs        int64    `json:"timeout_ms,omitempty" jsonschema:"Timeout in milliseconds for the entire execution"`
	ProcessTimeoutMs int64    `json:"process_timeout_ms,omitempty" jsonschema:"Timeout in milliseconds for each subcommand"`
	Presets          []string `json:"presets,omitempty" jsonschema:"Preset names to apply (e.g. 'json', 'yaml', 'dyff')"`
}

type DiffOutput

type DiffOutput struct {
	Stdout   string `json:"stdout" jsonschema:"Standard output containing diff results"`
	ExitCode int    `json:"exit_code" jsonschema:"Exit code of execution (0: no diff/success, 1: diff detected, 2: failure)"`
	HasDiff  bool   `json:"has_diff" jsonschema:"True if diff was detected between outputs"`
	Error    string `json:"error,omitempty" jsonschema:"Error message if execution failed"`
}

type DryRunInput

type DryRunInput struct {
	DiffInput
}

type DryRunOutput

type DryRunOutput struct {
	Script string `json:"script" jsonschema:"Generated bash script capturing the full execution pipeline"`
	Error  string `json:"error,omitempty" jsonschema:"Error message if script generation failed"`
}

type ListPresetsInput

type ListPresetsInput struct{}

type ListPresetsOutput

type ListPresetsOutput struct {
	Presets []PresetInfo `json:"presets" jsonschema:"List of available presets"`
}

type PresetInfo

type PresetInfo struct {
	Name       string   `json:"name" jsonschema:"Preset identifier"`
	Diff       string   `json:"diff,omitempty" jsonschema:"Configured diff command"`
	Preprocess []string `json:"preprocess,omitempty" jsonschema:"Preprocess filters"`
	CommonArgs []string `json:"common_args,omitempty" jsonschema:"Common args"`
	LeftArgs   []string `json:"left_args,omitempty" jsonschema:"Left args"`
	RightArgs  []string `json:"right_args,omitempty" jsonschema:"Right args"`
}

type Server

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

Server encapsulates the MCP server for cmdcomp.

func NewServer

func NewServer(baseConfig *config.Config) *Server

NewServer creates a new cmdcomp MCP server.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Serve runs the MCP server on stdio.

func (*Server) ServeWithTransport

func (s *Server) ServeWithTransport(ctx context.Context, t sdk.Transport) error

ServeWithTransport runs the MCP server using the specified transport.

Jump to

Keyboard shortcuts

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