pub struct McpServerConfig {Show 16 fields
pub id: String,
pub command: Option<String>,
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub url: Option<String>,
pub timeout: u64,
pub policy: McpPolicy,
pub headers: HashMap<String, String>,
pub oauth: Option<McpOAuthConfig>,
pub trust_level: McpTrustLevel,
pub tool_allowlist: Option<Vec<String>>,
pub expected_tools: Vec<String>,
pub roots: Vec<McpRootEntry>,
pub tool_metadata: HashMap<String, ToolSecurityMeta>,
pub elicitation_enabled: Option<bool>,
pub env_isolation: Option<bool>,
}Fields§
§id: String§command: Option<String>Stdio transport: command to spawn.
args: Vec<String>§env: HashMap<String, String>§url: Option<String>HTTP transport: remote MCP server URL.
timeout: u64§policy: McpPolicyOptional declarative policy for this server (allowlist, denylist, rate limit).
headers: HashMap<String, String>Static HTTP headers for the transport (e.g. Authorization: Bearer <token>).
Values support vault references: ${VAULT_KEY}.
oauth: Option<McpOAuthConfig>OAuth 2.1 configuration for this server.
trust_level: McpTrustLevelTrust level for this server. Default: Untrusted.
tool_allowlist: Option<Vec<String>>Tool allowlist. None means no override (inherit defaults).
Some(vec![]) is an explicit empty list (deny all for Untrusted/Sandboxed).
Some(vec!["a", "b"]) allows only listed tools.
expected_tools: Vec<String>Expected tool names for attestation. Supplements tool_allowlist.
When non-empty: tools not in this list are filtered out (Untrusted/Sandboxed) or warned about (Trusted). Schema drift is logged when fingerprints change between connections.
roots: Vec<McpRootEntry>Filesystem roots exposed to this MCP server via roots/list.
Each entry is a {uri, name?} pair. URI must use file:// scheme.
When empty, the server receives an empty roots list.
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: Option<bool>Per-server elicitation override. None = inherit global elicitation_enabled.
Some(true) = allow this server to elicit regardless of global setting.
Some(false) = always decline for this server.
env_isolation: Option<bool>Isolate the environment for this Stdio server.
When true (or when [mcp].default_env_isolation = true), the spawned process
only sees a minimal base env (PATH, HOME, etc.) plus this server’s env map.
Overrides [mcp].default_env_isolation when set explicitly.
Default: false (backward compatible).
Trait Implementations§
Source§impl Clone for McpServerConfig
impl Clone for McpServerConfig
Source§fn clone(&self) -> McpServerConfig
fn clone(&self) -> McpServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for McpServerConfig
impl Debug for McpServerConfig
Source§impl<'de> Deserialize<'de> for McpServerConfig
impl<'de> Deserialize<'de> for McpServerConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<McpServerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<McpServerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for McpServerConfig
impl Serialize for McpServerConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for McpServerConfig
impl RefUnwindSafe for McpServerConfig
impl Send for McpServerConfig
impl Sync for McpServerConfig
impl Unpin for McpServerConfig
impl UnsafeUnpin for McpServerConfig
impl UnwindSafe for McpServerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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