pub struct McpServerConfig {
pub id: McpServerId,
pub transport: McpTransportBinding,
pub metadata: MetadataMap,
}Expand description
Full configuration for a single MCP server.
Fields§
§id: McpServerIdUnique identifier for this server.
transport: McpTransportBindingTransport binding that determines how communication happens.
metadata: MetadataMapArbitrary metadata attached to this server configuration.
Implementations§
Source§impl McpServerConfig
impl McpServerConfig
Sourcepub fn new(id: impl Into<String>, transport: McpTransportBinding) -> Self
pub fn new(id: impl Into<String>, transport: McpTransportBinding) -> Self
Creates a new server configuration with the given identifier and transport.
Sourcepub fn stdio(id: impl Into<String>, command: impl Into<String>) -> Self
pub fn stdio(id: impl Into<String>, command: impl Into<String>) -> Self
Creates a stdio-backed server configuration.
Sourcepub fn streamable_http(id: impl Into<String>, url: impl Into<String>) -> Self
pub fn streamable_http(id: impl Into<String>, url: impl Into<String>) -> Self
Creates a Streamable HTTP-backed server configuration.
Sourcepub fn with_metadata(self, metadata: MetadataMap) -> Self
pub fn with_metadata(self, metadata: MetadataMap) -> Self
Replaces the configuration metadata.
Trait Implementations§
Source§impl Clone for McpServerConfig
impl Clone for McpServerConfig
Source§fn clone(&self) -> McpServerConfig
fn clone(&self) -> McpServerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for McpServerConfig
impl !UnwindSafe for McpServerConfig
impl Freeze for McpServerConfig
impl Send for McpServerConfig
impl Sync for McpServerConfig
impl Unpin for McpServerConfig
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more