pub struct SessionMcpHandler { /* private fields */ }
Expand description
JSON-RPC 2.0 over HTTP handler with shared StreamManager
Implementations§
Source§impl SessionMcpHandler
impl SessionMcpHandler
Sourcepub fn new(
config: ServerConfig,
dispatcher: Arc<JsonRpcDispatcher>,
stream_config: StreamConfig,
) -> Self
pub fn new( config: ServerConfig, dispatcher: Arc<JsonRpcDispatcher>, stream_config: StreamConfig, ) -> Self
Create a new handler with default in-memory storage (zero-configuration)
Create handler with shared StreamManager instance (corrected architecture)
Sourcepub fn with_storage(
config: ServerConfig,
dispatcher: Arc<JsonRpcDispatcher>,
session_storage: Arc<BoxedSessionStorage>,
stream_config: StreamConfig,
) -> Self
pub fn with_storage( config: ServerConfig, dispatcher: Arc<JsonRpcDispatcher>, session_storage: Arc<BoxedSessionStorage>, stream_config: StreamConfig, ) -> Self
Create handler with specific session storage backend (creates own StreamManager) Note: Use with_shared_stream_manager for correct architecture
Sourcepub fn get_stream_manager(&self) -> &Arc<StreamManager>
pub fn get_stream_manager(&self) -> &Arc<StreamManager>
Get access to the StreamManager for notifications
Sourcepub async fn handle_mcp_request(
&self,
req: Request<Incoming>,
) -> Result<Response<UnsyncBoxBody<Bytes, Error>>>
pub async fn handle_mcp_request( &self, req: Request<Incoming>, ) -> Result<Response<UnsyncBoxBody<Bytes, Error>>>
Handle MCP HTTP requests with full MCP 2025-06-18 compliance
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionMcpHandler
impl !RefUnwindSafe for SessionMcpHandler
impl Send for SessionMcpHandler
impl Sync for SessionMcpHandler
impl Unpin for SessionMcpHandler
impl !UnwindSafe for SessionMcpHandler
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