new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

MCP · Building servers and clients · all subjects

client: rust

2 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Rust MCP client with rmcp and TokioChildProcess

The Rust SDK crate `rmcp` (e.g. 0.8.0) with features `server`, `client`, `transport-io`, `transport-child-process` provides the client. Spawn the server with `TokioChildProcess::new(command)` and start a session via `().serve(process).await?`, which yields a `RunningService<RoleClient, ()>`. List tools with `session.list_all_tools()` and call one with `session.call_tool(CallToolRequestParam { name: ..., arguments: tool_call.fn_arguments.as_object().cloned() })`. Cleanup calls `session.cancel().await`.

Rust rmcp crate setup and features for an MCP server

A Rust MCP server uses the `rmcp` crate. In Cargo.toml declare `rmcp = { version = "0.3", features = ["server", "macros", "transport-io"] }` alongside `tokio = { version = "1.46", features = ["full"] }`, `reqwest` (with "json"), `serde` (with "derive"), `serde_json`, `anyhow`, `tracing` and `tracing-subscriber`. The "server" feature enables server implementation, "macros" the procedural macros, and "transport-io" the stdio transport.

Give your agent this brain