pub struct StreamableTransport { /* private fields */ }Expand description
Streamable HTTP transport (MCP 2025-03-26 spec).
Implementations§
Source§impl StreamableTransport
impl StreamableTransport
Sourcepub fn new(server: McpServer, addr: impl Into<SocketAddr>) -> Self
pub fn new(server: McpServer, addr: impl Into<SocketAddr>) -> Self
Create a new Streamable HTTP transport.
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Set custom endpoint path (default: “/mcp”).
Sourcepub fn with_auth(self, provider: DynAuthProvider) -> Self
pub fn with_auth(self, provider: DynAuthProvider) -> Self
Require authentication on all requests.
Sourcepub fn with_optional_auth(self, provider: DynAuthProvider) -> Self
pub fn with_optional_auth(self, provider: DynAuthProvider) -> Self
Accept optional authentication.
Sourcepub fn build_router(self) -> (AxumRouter, StreamableState)
pub fn build_router(self) -> (AxumRouter, StreamableState)
Build the Axum router for this transport.
Auto Trait Implementations§
impl Freeze for StreamableTransport
impl !RefUnwindSafe for StreamableTransport
impl Send for StreamableTransport
impl Sync for StreamableTransport
impl Unpin for StreamableTransport
impl UnsafeUnpin for StreamableTransport
impl !UnwindSafe for StreamableTransport
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