pub struct HttpClientTransport { /* private fields */ }
Expand description
HTTP transport for MCP clients
This transport communicates with an MCP server via HTTP requests and optionally uses Server-Sent Events for real-time notifications.
Implementations§
Source§impl HttpClientTransport
impl HttpClientTransport
Sourcepub async fn with_config<S: AsRef<str>>(
base_url: S,
sse_url: Option<S>,
config: TransportConfig,
) -> McpResult<Self>
pub async fn with_config<S: AsRef<str>>( base_url: S, sse_url: Option<S>, config: TransportConfig, ) -> McpResult<Self>
Sourcepub async fn active_request_count(&self) -> usize
pub async fn active_request_count(&self) -> usize
Get count of active requests (for debugging/metrics)
Trait Implementations§
Source§impl Transport for HttpClientTransport
impl Transport for HttpClientTransport
Source§fn send_request<'life0, 'async_trait>(
&'life0 mut self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_request<'life0, 'async_trait>(
&'life0 mut self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a JSON-RPC request and wait for a response Read more
Source§fn send_notification<'life0, 'async_trait>(
&'life0 mut self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_notification<'life0, 'async_trait>(
&'life0 mut self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a JSON-RPC notification (no response expected) Read more
Source§fn receive_notification<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<Option<JsonRpcNotification>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_notification<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<Option<JsonRpcNotification>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive a notification from the server (non-blocking) Read more
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the transport connection Read more
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if the transport is connected Read more
Source§fn connection_info(&self) -> String
fn connection_info(&self) -> String
Get connection information for debugging Read more
Auto Trait Implementations§
impl Freeze for HttpClientTransport
impl !RefUnwindSafe for HttpClientTransport
impl Send for HttpClientTransport
impl Sync for HttpClientTransport
impl Unpin for HttpClientTransport
impl !UnwindSafe for HttpClientTransport
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