mcpserver

package
v0.6.1 Latest Latest
Warning

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

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

Documentation

Overview

Package mcpserver exposes a Halos policy repo to agents over MCP.

Design rule: the server can inspect everything and propose changes, but it can never take an irreversible step. It does not publish releases, retag registry rings, merge, or push to a default branch; those stay with a human. Write tools exist only when Options.AllowWrites is set, default to dry_run, and require a reason that lands in the commit message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(o Options) (*mcp.Server, error)

New builds the MCP server. It registers tools, resources and prompts.

Types

type Options

type Options struct {
	PolicyDir   string
	AllowWrites bool
	// ClickHouse, when non-nil, enables analyze_experiment and lets
	// propose_promotion check the verdict before opening a PR.
	ClickHouse *promote.ClickHouse
	// SchemaDir holds *.schema.json; auto-detected near PolicyDir when empty.
	SchemaDir string
	Version   string
	// Upgrade, when set, supplies upgrade_candidates' Registry, Models and
	// Verifier (tests); nil = npm and the vendors' release metadata.
	Upgrade *upgrade.Watcher
	// Onboard, when set, is the machine the onboarding tools probe (tests);
	// nil = the real one.
	Onboard *onboard.Env
	// Server is halo-server's base URL for the fleet tools (kill switch,
	// audit, devices); empty = HALO_SERVER. The admin session is always
	// read from HALO_SESSION, never a flag or a tool argument.
	Server string
	// PROpener opens review PRs (propose_promotion, open_pr on the rollout
	// tools); nil = gh via promote.GHOpener; halo mcp serve sets a promote.ForgeOpener (--forge). Tests inject a fake.
	PROpener promote.PROpener
	// AdminRead lets admin_plan read the live vendor consoles, with
	// credentials from HALO_MCP_ADMIN_<VENDOR>_TOKEN (`halo mcp serve
	// --admin-read`). Off: admin_plan renders from policy only.
	AdminRead bool
	// AdminBaseURLs overrides admin_plan's vendor API base URLs (tests);
	// empty = the vendors' public APIs. Never a tool argument.
	AdminBaseURLs map[string]string
	// ROIIdentities is the identity roster CSV for roi_report and for the
	// delivery-ROI section of propose_promotion PRs (`halo mcp serve
	// --roi-identities`); ROIStore a local JSONL store of PR outcomes, else
	// they come from ClickHouse. Never tool arguments.
	ROIIdentities string
	ROIStore      string
}

Options configures New.

Jump to

Keyboard shortcuts

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