pub struct StreamServerBuilder { /* private fields */ }Expand description
Builder for creating Streamable HTTP MCP servers
Implementations§
Source§impl StreamServerBuilder
impl StreamServerBuilder
Sourcepub fn new(backend: BackendConfig) -> Self
pub fn new(backend: BackendConfig) -> Self
Create a new builder with the given backend configuration
Sourcepub fn tool_filter(self, filter: ToolFilter) -> Self
pub fn tool_filter(self, filter: ToolFilter) -> Self
Set the tool filter configuration
Sourcepub fn backend_isolation(self, isolation: BackendIsolation) -> Self
pub fn backend_isolation(self, isolation: BackendIsolation) -> Self
Override backend isolation (URL defaults to per-session, stdio to shared).
Sourcepub fn max_sessions(self, max: usize) -> Self
pub fn max_sessions(self, max: usize) -> Self
Limit concurrent upstream sessions.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Timeout for per-session lazy backend connect.
Sourcepub async fn build(self) -> Result<(Router, CancellationToken, ProxyHandler)>
pub async fn build(self) -> Result<(Router, CancellationToken, ProxyHandler)>
Build the server and return an axum Router, CancellationToken, and a management ProxyHandler.
For Shared isolation the returned handler is the live shared backend.
For PerSession isolation it is a disconnected stub (real backends live
inside each session’s handler); do not rely on swap_backend / availability APIs.
Auto Trait Implementations§
impl Freeze for StreamServerBuilder
impl RefUnwindSafe for StreamServerBuilder
impl Send for StreamServerBuilder
impl Sync for StreamServerBuilder
impl Unpin for StreamServerBuilder
impl UnsafeUnpin for StreamServerBuilder
impl UnwindSafe for StreamServerBuilder
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