rcp-protocol, imported as rcp) is built entirely on the Rust
standard library — no dependencies. Like the C++ SDK vendors json.hpp, this
crate vendors a small JSON value type, so you never need serde to speak RCP. It
is synchronous and blocking; every call returns Result<_, RcpError>, and it
interoperates byte-for-byte with the C++, Python, and Node.js SDKs.
Add it
Cargo.toml:
Server
Handlers areFnMut(&Json) -> Result<Json, RcpError>.
Client
Connect over stdio or HTTP, then make typed, capability-gated calls. A gated call to an unadvertised capability returnsErr(CapabilityMissing) before any I/O.
Display renders "[RCP <code>] <message>":
embed, embed_sparse, embed_multi, rerank, retrieve,
search (returns SearchResult { hits, usage, next_cursor }), graph,
transform, index_add, index_delete, catalog, info, ping, call,
shutdown.
Selecting a backend
The JSON value type
rcp::Json is a small, ordered JSON value with parse, Display / dump,
get / get_str / as_* accessors, insert / push, From impls, and the
rcp::obj(&[(key, value)]) builder — the reason the SDK stays dependency-free.
Fusion & the vector codec
The reference Reciprocal Rank Fusion (spec §16.3) and the compactf32-base64
embedding codec (§7.3.1) are standalone, unit-tested modules — byte-for-byte
identical to the Python, Node, and C++ SDKs:
Test
The suite includes a case where the Rust client drives the C++ example
server, proving cross-language interop;
cargo clippy is clean.