mcpworkload

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcpworkload generates deterministic MCP query workloads.

Index

Constants

View Source
const (
	SchemaVersion          = "mcp-workload-v1"
	DefaultCallCount       = 10_000
	DefaultSeed      int64 = 42
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Calls  int
	Seed   int64
	Corpus Corpus
}

Config controls one generated workload.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the standard workload used by the MCP performance phase. Ten thousand calls makes the percentages exact while remaining small enough for a smoke run.

type Corpus

type Corpus struct {
	Probes []Probe `json:"probes"`
}

Corpus contains the valid query probes for one snapshot.

func DefaultCorpus

func DefaultCorpus() Corpus

DefaultCorpus uses the probe names emitted by internal/synthetic for its deterministic corpus. A benchmark can replace it with probes from another corpus without changing the workload distribution.

type Operation

type Operation string

Operation is one read-only MCP tool included in the performance workload.

const (
	FindSymbol             Operation = "find_symbol"
	GetSymbol              Operation = "get_symbol"
	FindReferences         Operation = "find_references"
	FindCrossRepoConsumers Operation = "find_cross_repo_consumers"
	GetBlastRadius         Operation = "get_blast_radius"
)

type Probe

type Probe struct {
	Name      string `json:"name"`
	StableKey string `json:"stable_key"`
}

Probe identifies a symbol that is valid in the snapshot under test. Name is used by find_symbol; StableKey is used by the other operations.

type Request

type Request struct {
	Sequence  int            `json:"sequence"`
	Operation Operation      `json:"operation"`
	Arguments map[string]any `json:"arguments"`
}

Request is one MCP CallTool request and can be passed directly to the SDK.

type Workload

type Workload struct {
	SchemaVersion string            `json:"schema_version"`
	Seed          int64             `json:"seed"`
	Calls         int               `json:"calls"`
	Distribution  map[Operation]int `json:"distribution"`
	Requests      []Request         `json:"requests"`
}

Workload is the self-describing output consumed by later benchmark tasks.

func Generate

func Generate(ctx context.Context, config Config) (Workload, error)

Generate creates a deterministic workload. The operation counts are the largest-remainder allocation of the declared weights, so the required percentages are exact when Calls is divisible by 20 and remain balanced for smaller smoke runs.

Jump to

Keyboard shortcuts

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