pub struct ServerEntry {Show 13 fields
pub id: String,
pub transport: McpTransport,
pub timeout: Duration,
pub trust_level: McpTrustLevel,
pub tool_allowlist: Option<Vec<String>>,
pub allow_untrusted_without_allowlist: bool,
pub expected_tools: Vec<String>,
pub roots: Vec<Root>,
pub tool_metadata: HashMap<String, ToolSecurityMeta>,
pub elicitation_enabled: bool,
pub elicitation_timeout_secs: u64,
pub env_isolation: bool,
pub media_passthrough: bool,
}Expand description
Connection parameters for a single MCP server consumed by McpManager.
Deserialized from the [[mcp.servers]] TOML config table or constructed
programmatically for tests. All fields except id and transport have
reasonable defaults via #[serde(default)].
§Trust semantics
The combination of trust_level, tool_allowlist, expected_tools, and
allow_untrusted_without_allowlist controls which tools are exposed to the agent:
Trusted— all tools are exposed; SSRF and data-flow checks are relaxed.Untrusted+ no allowlist — fails closed: zero tools exposed, unlessallow_untrusted_without_allowlististrue(opt-in escape hatch that keeps the full untrusted pipeline — SSRF, sanitization, injection detection, attestation — while exposing all tools).Untrusted+ allowlist — only listed tools are exposed.Sandboxed+ allowlist — only listed tools; empty allowlist = no tools.Sandboxed+ no allowlist — no tools exposed (fail closed unconditionally;allow_untrusted_without_allowlisthas no effect onSandboxed).
Fields§
§id: String§transport: McpTransport§timeout: Duration§trust_level: McpTrustLevelTrust level for this server. Controls SSRF validation and tool filtering.
Trusted skips SSRF checks (for operator-controlled static config).
tool_allowlist: Option<Vec<String>>Tool allowlist. None means no override (inherit from config or deny by default).
Some(vec![]) is an explicit empty list. See McpTrustLevel for per-level semantics.
allow_untrusted_without_allowlist: boolExplicit opt-in to expose all tools for an Untrusted server with no
tool_allowlist declared. Default: false (secure by default — fails closed).
Mirrors McpServerConfig::allow_untrusted_without_allowlist.
expected_tools: Vec<String>Expected tool names for attestation. When non-empty, tools outside this list are filtered (Untrusted/Sandboxed) or warned (Trusted).
roots: Vec<Root>Filesystem roots to advertise to the server via roots/list.
rmcp::model::Root is deprecated by SEP-2577 but still functional — see
crate::roots for the construction-helper boundary that isolates this.
tool_metadata: HashMap<String, ToolSecurityMeta>Per-tool security metadata overrides. Keys are tool names. When absent for a tool, metadata is inferred from the tool name via heuristics.
elicitation_enabled: boolWhether this server is allowed to send elicitation requests.
Overrides the global elicitation_enabled config.
Sandboxed servers always have elicitation disabled regardless of this flag.
elicitation_timeout_secs: u64Timeout in seconds for the user to respond to an elicitation request.
env_isolation: boolWhen true, spawn this Stdio server with an isolated environment: only the minimal
base env vars (PATH, HOME, etc.) plus this server’s declared env map are passed.
Default: false (backward compatible).
media_passthrough: boolOpt-in: decode and attach images this server returns as native MessagePart::Image
siblings for vision-capable providers (spec-072). Mirrors
McpServerConfig::media_passthrough.
Always hard-blocked when trust_level == McpTrustLevel::Sandboxed, regardless of
this flag. Default: false.
Trait Implementations§
Source§impl Clone for ServerEntry
impl Clone for ServerEntry
Source§fn clone(&self) -> ServerEntry
fn clone(&self) -> ServerEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerEntry
impl Debug for ServerEntry
Source§impl<'de> Deserialize<'de> for ServerEntry
impl<'de> Deserialize<'de> for ServerEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ServerEntry
impl RefUnwindSafe for ServerEntry
impl Send for ServerEntry
impl Sync for ServerEntry
impl Unpin for ServerEntry
impl UnsafeUnpin for ServerEntry
impl UnwindSafe for ServerEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request