mcpserver

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mcpserver exposes NVCRE certification state to MCP (Model Context Protocol) agents as a set of read-only tools.

The server answers "did this certification pass, and which nodes failed?" from the same typed data sources the nvcrectl report command reads — catalog.List, report.Build, and the failed-nodes ConfigMaps. Every certification verdict is projected from report.Build rather than re-derived from the CR, so a tool can never disagree with the report the CLI prints.

The tool set is read-only by design (issue #242): no tool creates, mutates, or deletes a resource, and nothing triggers a run — runs consume real GPU time. Every tool also carries the MCP readOnlyHint annotation so clients can treat the whole surface as non-mutating.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(store *Store, version string) *mcp.Server

New returns an MCP server with the four read-only NVCRE tools registered. An empty version resolves to "dev".

func Run

func Run(ctx context.Context, store *Store, version string) error

Run serves the MCP server over stdio until the context is cancelled or the client disconnects. Stdio keeps the transport local: the agent spawns the server itself, so kubeconfig credentials never leave the machine.

Types

type Store

type Store struct {
	// Client reads Certification, Workflow, and node-results ConfigMap
	// objects. Only read paths are exercised — the handlers call
	// report.Build, report.FailedNodesFromRef, and plain Gets, all of which
	// issue reads against the API server.
	Client client.Client
	// Catalog lists the registered certification categories. A nil Catalog
	// defaults to catalog.List.
	Catalog func() []catalog.CategoryInfo
}

Store holds the cluster-backed data sources behind the MCP tools. Tests inject a fake client; production builds the client from the kubeconfig flags (see NewCommand).

Jump to

Keyboard shortcuts

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