pub struct McpServerConnectionConfig {
pub name: String,
pub transport: TransportTypeId,
pub command: Option<String>,
pub args: Vec<String>,
pub url: Option<String>,
pub config: Value,
pub timeout_secs: u64,
pub env: HashMap<String, String>,
}Expand description
Configuration for connecting to an MCP server.
Fields§
§name: StringServer name (identifier)
transport: TransportTypeIdTransport type
command: Option<String>Command to run (for stdio)
args: Vec<String>Command arguments (for stdio)
url: Option<String>URL endpoint (for HTTP/SSE)
config: ValueServer-specific configuration
timeout_secs: u64Connection timeout in seconds
env: HashMap<String, String>Environment variables to set for stdio transport
Implementations§
Source§impl McpServerConnectionConfig
impl McpServerConnectionConfig
Sourcepub fn stdio(
name: impl Into<String>,
command: impl Into<String>,
args: Vec<String>,
) -> Self
pub fn stdio( name: impl Into<String>, command: impl Into<String>, args: Vec<String>, ) -> Self
Create a stdio server configuration.
Sourcepub fn http(name: impl Into<String>, url: impl Into<String>) -> Self
pub fn http(name: impl Into<String>, url: impl Into<String>) -> Self
Create an HTTP server configuration.
Sourcepub fn with_config(self, config: Value) -> Self
pub fn with_config(self, config: Value) -> Self
Set server-specific configuration.
Sourcepub fn with_timeout(self, timeout_secs: u64) -> Self
pub fn with_timeout(self, timeout_secs: u64) -> Self
Set connection timeout.
Trait Implementations§
Source§impl Clone for McpServerConnectionConfig
impl Clone for McpServerConnectionConfig
Source§fn clone(&self) -> McpServerConnectionConfig
fn clone(&self) -> McpServerConnectionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for McpServerConnectionConfig
impl Debug for McpServerConnectionConfig
Source§impl<'de> Deserialize<'de> for McpServerConnectionConfig
impl<'de> Deserialize<'de> for McpServerConnectionConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for McpServerConnectionConfig
impl RefUnwindSafe for McpServerConnectionConfig
impl Send for McpServerConnectionConfig
impl Sync for McpServerConnectionConfig
impl Unpin for McpServerConnectionConfig
impl UnwindSafe for McpServerConnectionConfig
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