MCP ExplorerExplorer

Neva

@RomanEmreison a year ago
4 MIT
FreeCommunity
AI Systems
MCP server SDK for Rust

Overview

What is Neva

Neva is an MCP server SDK designed specifically for the Rust programming language, enabling developers to create and manage MCP servers efficiently.

Use cases

Use cases for Neva include creating multiplayer game servers, developing real-time communication platforms, and building applications that require efficient data handling and server management.

How to use

To use Neva, developers need to integrate the SDK into their Rust projects, follow the documentation for setup, and utilize the provided APIs to build custom MCP server functionalities.

Key features

Key features of Neva include high performance, ease of integration with Rust applications, support for various MCP protocols, and a modular architecture that allows for customization.

Where to use

Neva can be used in game development, real-time data processing applications, and any other domain where MCP server capabilities are required.

Content

Neva

Easy configurable MCP server and client 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

MCP Client

Dependencies

[dependencies]
neva = { version = "0.1.0", features = ["client-full"] }
tokio = { version = "1", features = ["full"] }

Code

use std::time::Duration;
use neva::Client;
use neva::error::Error;

#[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
    let tools = client.list_tools(None).await?;
    for tool in tools.tools {
        println!("- {}", tool.name);
    }

    // Call a tool
    let args = [
        ("message", "Hello MCP!")
    ];
    let result = client.call_tool("echo", Some(args)).await?;
    println!("{:?}", result.content);

    client.disconnect().await
}

MCP Server

Dependencies

[dependencies]
neva = { version = "0.1.0", features = ["server-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() {
    App::new()
        .with_options(|opt| opt
            .with_stdio()
            .with_name("Sample MCP server")
            .with_version("1.0.0"))
        .run()
        .await;
}

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers