mcpserver

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 4 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 mcpserver exposes strata's questions as Model Context Protocol tools, so an agent can ask "which prod images are on an EOL base?" and get an answer from the index directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(svc *service.Service, version string) *mcp.Server

New returns an MCP server with tools for explain, ancestry, descendants, query, stale, roots and cleanup.

Types

type CleanupInput added in v0.3.0

type CleanupInput struct {
	Where string `json:"where,omitempty" jsonschema:"select candidates with the query language; default stale = \"abandoned\""`
	Scope string `` /* 152-byte string literal not displayed */
	Limit int    `json:"limit,omitempty" jsonschema:"most candidates to list, largest first (default 50); totals count them all"`
}

CleanupInput asks which images can be deleted.

type DescendantsInput

type DescendantsInput struct {
	RefInput
	Depth       int  `json:"depth,omitempty" jsonschema:"levels below the base; 0 means the whole subtree (default 0)"`
	AllVersions bool `json:"all_versions,omitempty" jsonschema:"match every digest the base tag has ever held"`
}

DescendantsInput asks what is built on a base.

type ExplainInput

type ExplainInput struct {
	RefInput
	History bool `json:"history,omitempty" jsonschema:"include the build steps from the config history"`
}

ExplainInput asks about one image.

type GraphOutput

type GraphOutput struct {
	Graph *graph.Graph `json:"graph"`
}

GraphOutput wraps a lineage graph.

type QueryInput

type QueryInput struct {
	Filter  string   `json:"filter" jsonschema:"filter in strata's query language, such as label.env = \"prod\" and stale.eol_base"`
	Fields  []string `json:"fields,omitempty" jsonschema:"columns to return, such as repo, tag, digest, stale, label.team"`
	Sort    []string `json:"sort,omitempty" jsonschema:"fields to sort by; prefix - for descending"`
	Limit   int      `json:"limit,omitempty" jsonschema:"maximum rows (default 200)"`
	GroupBy string   `json:"group_by,omitempty" jsonschema:"count images per value of this field instead of listing them"`
}

QueryInput runs a filter.

type RefInput

type RefInput struct {
	Ref      string `json:"ref" jsonschema:"repo:tag, repo@digest, a digest, or a digest prefix of at least 12 hex characters"`
	Platform string `json:"platform,omitempty" jsonschema:"platform to pick when the ref names a multi-platform index, such as linux/arm64"`
}

RefInput names one image.

type RootsOutput

type RootsOutput struct {
	Roots []service.Root `json:"roots"`
}

RootsOutput lists root bases.

type StaleInput

type StaleInput struct {
	GroupBy string `json:"group_by,omitempty" jsonschema:"group by repo, root or a field such as label.team"`
}

StaleInput asks for the staleness mix.

type TableOutput

type TableOutput struct {
	Columns []string `json:"columns"`
	Rows    [][]any  `json:"rows"`
}

TableOutput is a tabular answer.

Jump to

Keyboard shortcuts

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