pub struct McpStreamableHttpServer {
pub url: String,
pub headers: Option<HashMap<String, String>>,
pub timeout: f64,
pub sse_read_timeout: f64,
pub terminate_on_close: bool,
}Expand description
Configuration for an MCP server connected via Streamable HTTP.
Fields§
§url: StringThe URL of the HTTP endpoint.
headers: Option<HashMap<String, String>>Optional headers to send with the connection request.
timeout: f64Connection timeout in seconds.
sse_read_timeout: f64SSE read timeout in seconds.
terminate_on_close: boolWhether to terminate the connection on close.
Implementations§
Source§impl McpStreamableHttpServer
impl McpStreamableHttpServer
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Create a new Streamable HTTP MCP Server configuration.
Sourcepub fn header(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn header(self, k: impl Into<String>, v: impl Into<String>) -> Self
Add a header to the HTTP connection.
Sourcepub const fn timeout(self, timeout: f64) -> Self
pub const fn timeout(self, timeout: f64) -> Self
Set the HTTP connection/request timeout in seconds.
Sourcepub const fn sse_read_timeout(self, timeout: f64) -> Self
pub const fn sse_read_timeout(self, timeout: f64) -> Self
Set the streaming read timeout in seconds.
Trait Implementations§
Source§impl Clone for McpStreamableHttpServer
impl Clone for McpStreamableHttpServer
Source§fn clone(&self) -> McpStreamableHttpServer
fn clone(&self) -> McpStreamableHttpServer
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 McpStreamableHttpServer
impl Debug for McpStreamableHttpServer
Source§impl<'de> Deserialize<'de> for McpStreamableHttpServer
impl<'de> Deserialize<'de> for McpStreamableHttpServer
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
Source§impl From<McpStreamableHttpServer> for McpServer
impl From<McpStreamableHttpServer> for McpServer
Source§fn from(val: McpStreamableHttpServer) -> Self
fn from(val: McpStreamableHttpServer) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for McpStreamableHttpServer
impl RefUnwindSafe for McpStreamableHttpServer
impl Send for McpStreamableHttpServer
impl Sync for McpStreamableHttpServer
impl Unpin for McpStreamableHttpServer
impl UnsafeUnpin for McpStreamableHttpServer
impl UnwindSafe for McpStreamableHttpServer
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