pub struct McpClient { /* private fields */ }Expand description
A live connection to one MCP server.
Implementations§
Source§impl McpClient
impl McpClient
Sourcepub async fn connect(
cfg: &McpServerConfig,
sandbox: &Sandbox,
workspace: &Path,
) -> Result<Arc<Self>>
pub async fn connect( cfg: &McpServerConfig, sandbox: &Sandbox, workspace: &Path, ) -> Result<Arc<Self>>
Spawn the server, perform the initialize handshake, and return a client.
An MCP server is third-party code running on your machine, which makes
it a larger hole than shell ever was: shell at least runs commands a
model asked for out loud, where a server runs whatever its author wrote.
So it gets the same treatment — a named environment rather than an
inherited one, and optional confinement.
pub fn name(&self) -> &str
Auto Trait Implementations§
impl !Freeze for McpClient
impl !RefUnwindSafe for McpClient
impl !UnwindSafe for McpClient
impl Send for McpClient
impl Sync for McpClient
impl Unpin for McpClient
impl UnsafeUnpin for McpClient
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