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

scripting

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package scripting provides a simple script runner for testing MCP tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	Raw bool

	// Responder answers elicitation and sampling requests with the answers
	// queued by elicit_response / sample_response. Optional.
	Responder *client.Responder
	// Client receives roots added by add_root. Optional.
	Client *mcp.Client
	// Notifications records server notifications for wait_notification. Optional.
	Notifications *client.Notifications
	// contains filtered or unexported fields
}

Runner manages the execution of MCP test scripts.

func NewRunner

func NewRunner(session *mcp.ClientSession, raw bool) *Runner

NewRunner creates a new Runner with the given MCP client session.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, script string, outputFormat string) (*TestResult, error)

Run executes a script string against the established MCP session.

type TestFailure added in v1.4.0

type TestFailure struct {
	Line  int    `json:"line"`
	Error string `json:"error"`
}

TestFailure records one failed script line.

type TestResult added in v0.2.1

type TestResult struct {
	Executed int           `json:"executed"`
	Passed   int           `json:"passed"`
	Failed   int           `json:"failed"`
	Failures []TestFailure `json:"failures,omitempty"`
}

TestResult holds numeric summary of test execution

Jump to

Keyboard shortcuts

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