Skip to main content

Crate xianyun_mcp

Crate xianyun_mcp 

Source
Expand description

Library half of xianyun-mcp: the allowlist/annotation/middleware configuration (config) and the clap::Command tree-building logic shared between the real xianyun-mcp binary (src/main.rs) and this crate’s tests (golden-file snapshot, guardrail, in-process protocol).

See src/main.rs’s module doc comment for the full story on why the binary routes argv between the mcp subtree and real xianyun command dispatch, and why mounted_root un-globals Cli::command()’s global arguments before mounting brontes::command onto it.

Modules§

config
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.

Constants§

MCP_GROUP
Group name brontes::command mounts its subtree under; matches brontes’s own default (see brontes::Config::command_name, which this crate does not override).

Functions§

is_mcp_invocation
true when argv[1] is exactly "mcp", or argv carries no arguments beyond the binary name (the no-arguments-given default).
mounted_root
Builds the full xianyun command tree with brontes::command mounted onto it, after un-globaling Cli::command()’s own global arguments so they don’t collide with brontes’s own --log-level flag on its mounted subcommands. See the crate-level doc comment for the full story.