mcptool

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 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 CommandRunner added in v0.15.0

type CommandRunner = router.CommandRunner

CommandRunner is the engine's sandbox-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
	CommandRunner CommandRunner
}

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