Skip to main content

Spec

Struct Spec 

Source
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: String

The server’s name in source = "plugin:mcp:<name>" and in messages.

§transport: Transport

How to reach it. The default is what every manifest written before #502 means.

§command: String

The 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: Cwd

Where 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: Policy

Policy 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: String

Prefix for the registered name, for servers whose tool names are too generic to live beside shell and write_file (prefix = "fs_").

§override_builtin: bool

Replace a built-in or another plugin’s tool of the same name.

§disabled: bool

Do not start this server at all.

Implementations§

Source§

impl Spec

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for Spec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Spec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Spec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Spec

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Spec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Spec

Auto Trait Implementations§

§

impl Forget for Spec

§

impl Freeze for Spec
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const LeafNode<String, Policy> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Policy)>>: Freeze,

§

impl Move for Spec

§

impl RefUnwindSafe for Spec

§

impl Send for Spec
where RawVecInner: Send, NodeRef<Owned, String, Policy, LeafOrInternal>: Send, BoxRaw<(String, Policy)>: Send,

§

impl Sync for Spec
where RawVecInner: Sync, NodeRef<Owned, String, Policy, LeafOrInternal>: Sync, BoxRaw<(String, Policy)>: Sync,

§

impl Unpin for Spec
where *const u8 is !null: Unpin, *const LeafNode<String, Policy> is !null: Unpin, Box<(String, Policy)>: Unpin,

§

impl UnsafeUnpin for Spec

§

impl UnwindSafe for Spec
where RawVecInner: UnwindSafe, BTreeMap<String, Policy>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more