Documentation
¶
Overview ¶
Package mcpserver offers clusterctl to an AI agent over the Model Context Protocol.
The agent is given a few tools shaped around what it is asked to find out, rather than one tool per command: resolve a node set, describe nodes across the inventory and the workload manager, query Slurm, and run any command the command tree marks as read-only. Nothing changes the site except through a plan: plan_change resolves and previews an action exactly as the confirmation gate would, and apply_plan carries it out once the administrator, not the agent, has answered the gate's question.
The server runs on the administrator's workstation, over stdio, as the administrator: it reaches the site with their ssh agent and their configuration, and it is pinned to the context it was started in.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfirmMode ¶
type ConfirmMode string
ConfirmMode says who answers the confirmation gate before a plan is applied.
const ( // ConfirmElicit asks the administrator through the client, with an MCP // elicitation the agent cannot answer. A client that cannot ask is // refused. ConfirmElicit ConfirmMode = "elicit" // ConfirmApproval leaves the question to the client's own approval of // the apply_plan call, which shows the node set and the count the agent // had to repeat. It is only as good as the client's approval settings. ConfirmApproval ConfirmMode = "approval" )
type Options ¶
type Options struct {
// App holds the global options every call resolves the configuration
// with. Its context is pinned when the server starts; the node set,
// dry run, confirmation and force options are ignored.
App app.Options
// StateDir and CacheDir are where the calls keep their state and cache.
StateDir string
CacheDir string
// Command builds a fresh command tree writing to the given streams. The
// read_command tool runs the read-only commands through it.
Command func(ctx context.Context, streams app.Streams) *cobra.Command
// Confirm says who answers the confirmation gate.
Confirm ConfirmMode
// PlanTTL is how long a plan may wait to be applied.
PlanTTL time.Duration
// Version is reported to the client.
Version string
// Log receives the server's own messages. Standard output carries the
// protocol, so this is never it.
Log io.Writer
// Now replaces the clock in tests.
Now func() time.Time
}
Options configure a server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a clusterctl MCP server.