About Neva
Neva is a Rust SDK for building MCP clients and servers, aimed at developers creating asynchronous MCP systems. It combines core MCP entities and local or remote transports with authentication, structured data, and support for multi-round-trip requests.
Key features
- 01Build MCP clients and servers
- 02stdio and Streamable HTTP transports
- 03Define and consume tools, resources, prompts
- 04Async and synchronous handlers
- 05Bearer authentication and role-based access
- 06Structured output and multi-round-trip requests
Use cases
- 01Building a Rust MCP server
- 02Connecting an MCP client over stdio
- 03Supporting remote bidirectional MCP communication
- 04Handling multi-round-trip tool requests
MCP support
Neva provides an SDK for implementing MCP clients and servers. Servers can expose tools, resources, and prompts; clients can connect over stdio or Streamable HTTP.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMENeva
Blazingly fast and easily configurable Model Context Protocol (MCP) server and client SDK for Rust. With simple configuration and ergonomic APIs, it provides everything you need to quickly build MCP clients and servers, fully aligned with the latest MCP specification.
💡 Note: This project is currently in preview. Breaking changes can be introduced without prior notice.
Tutorial | API Docs | Examples
Key Features
- Client & Server SDK - one library to build both MCP clients and servers with the powers of Rust.
- Performance - asynchronous and Tokio-powered.
- Transports - stdio for local integrations and Streamable HTTP for remote, bidirectional communication.
- Tools, Resources & Prompts - full-house support for defining and consuming the main MCP entities.
- Async or sync handlers - write
async fnwhen you await something, a plainfnwhen you don't. Addblockingwhen the body blocks, and it runs on Tokio's blocking pool instead of a runtime worker. - Authentication & Authorization - bearer token authentication, role-based access control, and more to fit high security standards.
- Structured Data - output validation, embedded resources, and resource links out of the box.
- Safe Multi Round-Trip Requests - a handler that asks the client for input mid-call re-runs from the top on every round, so neva owns the idempotency:
ctx.memocomputes once,ctx.onceruns an effect once,ctx.on_commitdefers it to the final result, and a lost response replays the committed answer instead of charging the card twice. - Confidential request state - the
requestStateblob that carries progress between rounds is sealed with ChaCha20-Poly1305, not merely signed, so whatctx.memocaches stays unreadable to the client that echoes it back. - Handing tools to a model - with the
svirfeature, an MCP server's tools become a svirToolbox: a remote server's throughRemoteTools, or a function written once with#[tool]called in the same process through the server's own pipeline. Prompts and resources become svir messages, and a server's sampling request is answered with a model. - Registry publishing -
server.jsonfor the MCP Registry is generated from what the server already knows: its version, its transport and the crate Cargo is building. The registry's limits are checked before the upload rather than by it. - Spec Alignment - designed to track the latest MCP specification and cover its core functionality.
Quick Start
MCP Client
Dependencies
[dependencies]
neva = { version = "0.9.0", features = ["client-full"] }
tokio = { version = "1", features = ["full"] }
Code
use neva::prelude::*;
#[tokio::main]
async fn main() -> Result<(), Error> {
let mut client = Client::new()
.with_options(|opt| opt
.with_stdio("npx", ["-y", "@modelcontextprotocol/server-everything"])
.with_timeout(Duration::from_secs(5)));
client.connect().await?;
// List tools
for tool in client.tools().list_all().await? {
println!("- {}", tool.name);
}
// Call a tool
let args = [
("message", "Hello MCP!")
];
let result = client.tools().call("echo", args).await?;
println!("{:?}", result.content);
client.disconnect().await
}
MCP Server
Dependencies
[dependencies]
neva = { version = "0.9.0", features = ["server-full"] }
tokio = { version = "1", features = ["full"] }
Code
use neva::prelude::*;
#[tool(descr = "A say hello tool")]
async fn hello(name: String) -> String {
format!("Hello, {name}!")
}
#[resource(uri = "res://{name}", descr = "Some details about resource")]
async fn get_res(name: String) -> ResourceContents {
ResourceContents::new(format!("res://{name}"))
.with_mime("plain/text")
.with_text(format!("Some details about resource: {name}"))
}
// Nothing to await here, so a plain `fn` will do.
#[prompt(descr = "Analyze code for potential improvements")]
fn analyze_code(lang: String) -> PromptMessage {
PromptMessage::user()
.with(format!("Language: {lang}"))
}
#[tokio::main]
async fn main() {
App::new()
.with_options(|opt| opt
.with_stdio()
.with_name("Sample MCP server")
.with_version("1.0.0"))
.run()
.await;
}
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.