Skip to main content

Module client

Module client 

Source
Expand description

A no-iroh mcpmesh-local/1 client: connect the UDS, read the server’s Hello first frame, assert the api name, then issue typed request/response frames. Distinct from the CLI crate (cli/)’s ControlClient (which uses mcpmesh_net::framing) — this one links no iroh, so kb and the host shell can use it. kb calls this to self-register its [services.kb] socket backend with the running mcpmesh daemon.

Structs§

ControlClient
A connected mcpmesh-local/1 client: the framed stream + the server’s Hello.
StreamSubscription
A live Request::Subscribe stream yielding typed StreamFrames (snapshot, then events/lagged notices) until the daemon side closes. Holds the connection’s write half for its lifetime — a subscriber only reads, but dropping the writer would half-close the socket. Drop the subscription to disconnect (there is no request channel back).

Enums§

ClientError
The error surface of the client — thin, so callers can anyhow-wrap it.

Functions§

connect_control
Connect + complete the hello handshake, asserting the api name is mcpmesh-local/1.
connect_control_default
connect_control at the platform default endpoint (crate::paths::default_endpoint): the quickstart front door — a consumer dials the running daemon without reimplementing the platform endpoint rule. Resolution failure surfaces as ClientError::Io (NotFound), same as a daemon that is not running.
connect_control_io
Complete the mcpmesh-local/1 hello handshake over ALREADY-CONNECTED byte halves — the transport-agnostic core of connect_control, and the front door for in-process embedding (mcpmesh-node’s Node::control dials a tokio duplex through here).

Type Aliases§

ControlRead
The client’s read half — boxed so ONE ControlClient serves every transport (the platform socket/pipe via connect_control, or an embedder’s in-memory duplex via connect_control_io).
ControlWrite
The client’s write half — see ControlRead.