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) -> StreamServerBuilder
pub fn new(backend: BackendConfig) -> StreamServerBuilder
Create a new builder with the given backend configuration
Sourcepub fn stateful(self, enabled: bool) -> StreamServerBuilder
pub fn stateful(self, enabled: bool) -> StreamServerBuilder
Set whether to enable stateful mode
Sourcepub fn mcp_id(self, id: impl Into<String>) -> StreamServerBuilder
pub fn mcp_id(self, id: impl Into<String>) -> StreamServerBuilder
Set the MCP service identifier
Sourcepub fn tool_filter(self, filter: ToolFilter) -> StreamServerBuilder
pub fn tool_filter(self, filter: ToolFilter) -> StreamServerBuilder
Set the tool filter configuration
Sourcepub fn backend_isolation(
self,
isolation: BackendIsolation,
) -> StreamServerBuilder
pub fn backend_isolation( self, isolation: BackendIsolation, ) -> StreamServerBuilder
Override backend isolation (URL defaults to per-session, stdio to shared).
Sourcepub fn max_sessions(self, max: usize) -> StreamServerBuilder
pub fn max_sessions(self, max: usize) -> StreamServerBuilder
Limit concurrent upstream sessions.
Sourcepub fn connect_timeout(self, timeout: Duration) -> StreamServerBuilder
pub fn connect_timeout(self, timeout: Duration) -> StreamServerBuilder
Timeout for per-session lazy backend connect.
Sourcepub async fn build(
self,
) -> Result<(Router, CancellationToken, ProxyHandler), Error>
pub async fn build( self, ) -> Result<(Router, CancellationToken, ProxyHandler), Error>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request