mcptool

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildResponse

func BuildResponse(exitCode int, files *output.Files) *mcp.CallToolResult

func HandleRunCommand

func HandleRunCommand(ctx context.Context, cmd string, cfg HandlerConfig) (*mcp.CallToolResult, any, error)

func Register

func Register(s *mcp.Server, cfg HandlerConfig)

Types

type ContainerRunner

type ContainerRunner interface {
	RunContainer(ctx context.Context, serviceName, cmd string, env []string, stdout, stderr io.Writer) (int, error)
}

type HandlerConfig

type HandlerConfig struct {
	OutputDir               string
	AllowPatterns           []string
	DenyPatterns            []string
	ContainerRunner         ContainerRunner
	ContainerEnvPassthrough []string
}

type RunCommandInput

type RunCommandInput struct {
	Command        string `json:"command"`
	TimeoutSeconds *int   `json:"timeout_seconds,omitempty"`
}

type ToolResult

type ToolResult struct {
	ExitCode   int    `json:"exit_code"`
	StdoutPath string `json:"stdout_path,omitempty"`
	StderrPath string `json:"stderr_path,omitempty"`
}

Jump to

Keyboard shortcuts

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