pub struct McpTransportConnection { /* private fields */ }Expand description
A transport connection to an MCP server.
Implementations§
Source§impl McpTransportConnection
impl McpTransportConnection
Sourcepub async fn connect_stdio(
command: &str,
args: &[String],
env: &HashMap<String, String>,
) -> Result<Self, String>
pub async fn connect_stdio( command: &str, args: &[String], env: &HashMap<String, String>, ) -> Result<Self, String>
Connect to an MCP server via stdio subprocess.
Sourcepub async fn connect_sse(base_url: &str) -> Result<Self, String>
pub async fn connect_sse(base_url: &str) -> Result<Self, String>
Connect to an MCP server via HTTP/SSE.
Sourcepub async fn request(
&self,
method: &str,
params: Option<Value>,
) -> Result<Value, String>
pub async fn request( &self, method: &str, params: Option<Value>, ) -> Result<Value, String>
Send a JSON-RPC request and wait for the response.
Auto Trait Implementations§
impl !Freeze for McpTransportConnection
impl !RefUnwindSafe for McpTransportConnection
impl Send for McpTransportConnection
impl Sync for McpTransportConnection
impl Unpin for McpTransportConnection
impl UnsafeUnpin for McpTransportConnection
impl !UnwindSafe for McpTransportConnection
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