Expand description
Builds the [brontes::Config] that governs which xianyun subcommands
become MCP tools, how they’re annotated, and which ones require explicit
client confirmation before they run.
§The allowlist, in full
brontes::Config::default() (equivalently, passing None to
[brontes::command]) exposes every reachable command as a tool. This
module never does that: build always returns a Config whose
[Selector::cmd] matchers are an explicit allowlist, built from
[selectors::allow_cmds] over exact, fully-qualified command paths. A
command that isn’t named in one of the three groups below is invisible
to MCP clients, full stop — see tests::guardrail in the crate’s
integration tests for the check that keeps a newly added xianyun
subcommand from silently falling through the cracks.
Three allowlist tiers, each with its own annotation shape:
READ_ONLY: pure queries.readOnlyHint: true.STATE_CHANGING: expected, reversible side effects (a local cluster comes up, a Helm chart gets upgraded, a CA key gets lazily generated).destructiveHint: false, but notreadOnlyHint.GATED: commands that tear something down, rewrite a file outside the project (/etc/hosts), or touch the host’s trust store (often undersudo).destructiveHint: true, and wrapped in the confirmation-gating [Middleware] frommiddleware.
Everything else in xianyun’s command tree — run, tool, kubectl,
k9s, stern, edit-mode-process-supervisor — is deliberately excluded.
See EXCLUDED for the reasons, one per command.
Constants§
- EXCLUDED
- Commands intentionally excluded from the MCP tool surface, with the
reason each one is excluded. Checked against the real command tree by
the crate’s guardrail test, so an unclassified new subcommand fails that
test instead of silently inheriting
brontes’s open-by-default exposure. - GATED
- Commands that tear down a cluster and its data, rewrite
/etc/hosts, or install/remove a certificate in the host’s trust store (the latter two typically requiresudo). Allowlisted, but every call throughmiddleware::confirmation_gatefirst. - READ_
ONLY - Commands that only read state: exact
xianyun-rooted paths, matching thepathstringsbrontes’s walker produces (space-joined, starting at the CLI’s own name). - STATE_
CHANGING - Commands with real side effects that are expected, local-only, and
reversible by running the CLI again (bringing a cluster up, redeploying,
pulling repository updates, merging a kubeconfig entry, migrating a
config file to the latest schema, or lazily generating/reading the dev CA
—
ca inspectcan write a CA keypair to disk on first run viaxianyun_pki::ca::load_or_generate, which disqualifies it fromREAD_ONLYdespite its name).
Functions§
- build
- Builds the full [
brontes::Config] for thexianyuncommand tree: the three-tier allowlist above, an annotation for every allowlisted command, and the confirmation-gating middleware wired toGATEDalone. - middleware
- Builds the confirmation-gating [
Middleware] applied to every selector overGATEDcommands.