mcptool

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 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 = router.ContainerRunner

ContainerRunner is the engine's container-execution interface, re-exported so existing callers (serve.go, tests) keep their import.

type DropRule added in v0.14.3

type DropRule = router.DropRule

DropRule is the router's drop rule (pattern + optional message), re-exported so callers can build a HandlerConfig without importing router directly.

type HandlerConfig

type HandlerConfig struct {
	OutputDir               string
	AllowPatterns           []string
	DropRules               []DropRule
	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