pub struct McpServerConfig {
pub id: String,
pub name: String,
pub source: McpServerSource,
pub enabled: bool,
pub tool_prefix: Option<String>,
pub resources: Option<Vec<String>>,
pub bearer_token: Option<String>,
}
Expand description
Configuration for an individual MCP server
Defines connection parameters, authentication, and tool management settings for a single MCP server instance.
Fields§
§id: String
Unique identifier for this server
Used internally to track connections and route tool calls. Must be unique across all servers in a single MCP client configuration. Defaults to a UUID if not specified.
name: String
Human-readable name for this server
Used for logging, debugging, and user-facing displays.
source: McpServerSource
Transport-specific connection configuration
enabled: bool
Whether this server should be activated
Disabled servers are ignored during client initialization. Defaults to true if not specified.
tool_prefix: Option<String>
Optional prefix to add to all tool names from this server
Helps prevent naming conflicts when multiple servers provide tools with similar names. For example, with prefix “web”, a tool named “search” becomes “web_search”. Defaults to a UUID-based prefix if not specified.
resources: Option<Vec<String>>
Optional resource URI patterns this server provides
Used for resource discovery and subscription. Supports glob patterns like “file://**” for filesystem access.
bearer_token: Option<String>
Optional Bearer token for authentication
Automatically included as “Authorization: Bearer
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 Default for McpServerConfig
impl Default for McpServerConfig
Source§impl<'de> Deserialize<'de> for McpServerConfigwhere
McpServerConfig: Default,
impl<'de> Deserialize<'de> for McpServerConfigwhere
McpServerConfig: Default,
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 McpServerConfig
impl RefUnwindSafe for McpServerConfig
impl Send for McpServerConfig
impl Sync for McpServerConfig
impl Unpin 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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more