3 releases

new 0.0.3 Apr 17, 2025
0.0.2 Apr 9, 2025
0.0.1 Apr 7, 2025

#517 in HTTP server

Download history 81/week @ 2025-04-02 170/week @ 2025-04-09

251 downloads per month

MIT license

180KB
4.5K SLoC

Neva

Easy configurable MCP server SDK for Rust

latest latest License: MIT CI Release

💡 Note: This project is currently in preview. Breaking changes can be introduced without prior notice.

API Docs | Examples

Dependencies

[dependencies]
neva = { version = "0.0.3", features = ["full"] }
tokio = { version = "1", features = ["full"] }

Code

use neva::{App, tool, resource, prompt};

#[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) -> (String, String) {
    (
        format!("res://{name}"),
        format!("Some details about resource: {name}")
    )
}

#[prompt(descr = "Analyze code for potential improvements")]
async fn analyze_code(lang: String) -> (String, String) {
    (format!("Language: {lang}"), "user".into())
}

#[tokio::main]
async fn main() {
    let mut app = App::new()
        .with_options(|opt| opt
            .with_stdio()
            .with_name("Sample MCP server")
            .with_version("1.0.0"));

    map_hello(&mut app);
    map_get_res(&mut app);
    map_analyze_code(&mut app);

    app.run().await;
}

Dependencies

~5–12MB
~120K SLoC