pub struct McpEngineClient { /* private fields */ }Expand description
A connected MCP client: initialize done, ready for tools/call.
Implementations§
Source§impl McpEngineClient
impl McpEngineClient
Sourcepub fn connect(spec: &EngineSpec) -> Result<Self>
pub fn connect(spec: &EngineSpec) -> Result<Self>
Connect over the transport spec selects and run the handshake.
Sourcepub fn connect_with(spec: &EngineSpec, timeout: Duration) -> Result<Self>
pub fn connect_with(spec: &EngineSpec, timeout: Duration) -> Result<Self>
Self::connect with a per-request timeout.
Sourcepub fn connect_stdio(
command: &str,
args: &[String],
timeout: Duration,
) -> Result<Self>
pub fn connect_stdio( command: &str, args: &[String], timeout: Duration, ) -> Result<Self>
Spawn command args… (stderr inherited) and connect over its stdio.
Sourcepub fn protocol_version(&self) -> &str
pub fn protocol_version(&self) -> &str
The protocol revision the server answered with.
Sourcepub fn server_info(&self) -> &Value
pub fn server_info(&self) -> &Value
The server’s serverInfo ({ name, version }).
Sourcepub fn request(&mut self, method: &str, params: Value) -> Result<Value>
pub fn request(&mut self, method: &str, params: Value) -> Result<Value>
One JSON-RPC request; the result, or the server’s error as
Error::Other.
Sourcepub fn notify(&mut self, method: &str, params: Value) -> Result<()>
pub fn notify(&mut self, method: &str, params: Value) -> Result<()>
One JSON-RPC notification (no reply).
Sourcepub fn list_tools(&mut self) -> Result<Vec<Value>>
pub fn list_tools(&mut self) -> Result<Vec<Value>>
tools/list: the catalog as the server describes it.
Sourcepub fn call_tool(&mut self, name: &str, args: Value) -> Result<ToolResult>
pub fn call_tool(&mut self, name: &str, args: Value) -> Result<ToolResult>
tools/call: the tool’s JSON body and its error flag. A reply whose
text content is not JSON is an error (the reference’s
tool <name> returned non-JSON).
Trait Implementations§
Source§impl Debug for McpEngineClient
impl Debug for McpEngineClient
Source§impl Drop for McpEngineClient
impl Drop for McpEngineClient
Source§impl EngineClient for McpEngineClient
impl EngineClient for McpEngineClient
Source§fn read_doc(&mut self, path: &str) -> Result<Option<DocBytes>>
fn read_doc(&mut self, path: &str) -> Result<Option<DocBytes>>
docs_read by path; a tool error (doc_missing, …) reads as absent,
as the reference treats it. The hash is computed here: the wire
carries the bytes, not the store’s file_hash.
Source§fn observe_many(&mut self, files: &[FileBytes]) -> Result<Vec<ObserveOutcome>>
fn observe_many(&mut self, files: &[FileBytes]) -> Result<Vec<ObserveOutcome>>
Source§fn observe_delete(&mut self, path: &str) -> Result<DeleteOutcome>
fn observe_delete(&mut self, path: &str) -> Result<DeleteOutcome>
Source§fn changes_since(
&mut self,
cursor: i64,
limit: Option<usize>,
origin: Option<&str>,
) -> Result<ChangesPage>
fn changes_since( &mut self, cursor: i64, limit: Option<usize>, origin: Option<&str>, ) -> Result<ChangesPage>
cursor (§6).