pub struct Spec {Show 14 fields
pub name: String,
pub transport: Transport,
pub command: String,
pub args: Vec<String>,
pub env: Vec<String>,
pub cwd: Cwd,
pub url: Option<String>,
pub token_env: Option<String>,
pub timeout_secs: Option<u64>,
pub policy: Policy,
pub policies: BTreeMap<String, Policy>,
pub prefix: String,
pub override_builtin: bool,
pub disabled: bool,
}Expand description
One [[mcp]] entry — in a plugin manifest, or in config.toml (#352).
Serializing it back out is what lets config show print the file it loaded, and what lets
eclipse mcp add write an entry the loader reads again.
Fields§
§name: StringThe server’s name in source = "plugin:mcp:<name>" and in messages.
transport: TransportHow to reach it. The default is what every manifest written before #502 means.
command: StringThe program to start, for transport = "stdio". Refused on the HTTP transport.
args: Vec<String>§env: Vec<String>Names copied from the agent’s environment (never KEY=VALUE, so a manifest cannot carry a
secret and cannot overwrite PATH with something it ships).
cwd: CwdWhere the server runs. Defaults to the workspace, like a plugin command.
url: Option<String>The endpoint for transport = "http". Required there, refused on stdio.
token_env: Option<String>The name of an environment variable holding a bearer token (token_env = "HA_TOKEN").
Never the token itself: env already refuses KEY=VALUE so a manifest cannot carry a
secret, and that property has to survive the HTTP transport or a manifest becomes a place
where credentials are written down (#502).
timeout_secs: Option<u64>Ceiling for one call, clamped like any plugin timeout.
policy: PolicyPolicy for every tool this server offers; ask unless the manifest says otherwise.
policies: BTreeMap<String, Policy>Per-tool overrides, by the name the server uses: policies = { read_text_file = "allow" }.
prefix: StringPrefix for the registered name, for servers whose tool names are too generic to live beside
shell and write_file (prefix = "fs_").
override_builtin: boolReplace a built-in or another plugin’s tool of the same name.
disabled: boolDo not start this server at all.
Implementations§
Source§impl Spec
impl Spec
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
The one place a [[mcp]] entry is checked (#502), for the transport it names and for
the fields that belong to the other one. An entry that mixes them is refused with a reason
naming both, rather than a half-ignored setting that looks configured and is not.
The messages use backticks, not quotes: they are read in a terminal next to the file they are about, and a key name is clearer in the same style the rest of the errors use.
Sourcepub fn token_source(&self, secrets: &Secrets) -> TokenSource
pub fn token_source(&self, secrets: &Secrets) -> TokenSource
Where Self::token would read the token from — the one-word answer a listing shows
(#517), so a server that cannot authenticate says so where it is listed rather than only
when somebody presses test. Never the value.