File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
crates/rmcp/src/transport/streamable_http_server Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ impl Default for StreamableHttpServerConfig {
4444 }
4545}
4646
47+ /// # Streamable Http Server
48+ ///
49+ /// ## Extract information from raw http request
50+ ///
51+ /// The http service will consume the request body, however the rest part will be remain and injected into [`crate::model::Extensions`],
52+ /// which you can get from [`crate::service::RequestContext`].
53+ /// ```rust
54+ /// use rmcp::handler::server::tool::Extension;
55+ /// use http::request::Parts;
56+ /// async fn my_tool(Extension(parts): Extension<Parts>) {
57+ /// tracing::info!("http parts:{parts:?}")
58+ /// }
59+ /// ```
4760pub struct StreamableHttpService < S , M = super :: session:: local:: LocalSessionManager > {
4861 pub config : StreamableHttpServerConfig ,
4962 session_manager : Arc < M > ,
You can’t perform that action at this time.
0 commit comments