pub enum McpServerConfig {
Stdio {
command: String,
args: Vec<String>,
env: BTreeMap<String, String>,
cwd: Option<PathBuf>,
startup_timeout_ms: u64,
call_timeout_ms: u64,
},
StreamableHttp {
url: String,
headers: BTreeMap<String, String>,
startup_timeout_ms: u64,
call_timeout_ms: u64,
},
Sse {
url: String,
headers: BTreeMap<String, String>,
startup_timeout_ms: u64,
call_timeout_ms: u64,
},
}Expand description
Connection configuration for one MCP server. Tag (transport) selects
the wire transport; per-variant fields configure that transport.
Variants§
Stdio
Spawn a child process and speak JSON-RPC over stdio.
Fields
StreamableHttp
Newer MCP spec HTTP/JSON streaming transport.
Sse
Older MCP spec HTTP+SSE transport.
Implementations§
Source§impl McpServerConfig
impl McpServerConfig
Sourcepub fn stdio(command: impl Into<String>, args: Vec<String>) -> Self
pub fn stdio(command: impl Into<String>, args: Vec<String>) -> Self
Convenience constructor for stdio servers.
Sourcepub fn streamable_http(url: impl Into<String>) -> Self
pub fn streamable_http(url: impl Into<String>) -> Self
Convenience constructor for streamable-HTTP servers.
pub fn startup_timeout(&self) -> Duration
pub fn call_timeout(&self) -> Duration
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 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<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
impl Eq for McpServerConfig
Source§impl PartialEq for McpServerConfig
impl PartialEq for McpServerConfig
Source§fn eq(&self, other: &McpServerConfig) -> bool
fn eq(&self, other: &McpServerConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for McpServerConfig
impl Serialize for McpServerConfig
impl StructuralPartialEq for McpServerConfig
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
Mutably borrows from an owned value. Read more
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.