Rust SDK

v1.0.0Developer Toolsstable

The official Rust SDK for the Model Context Protocol

rust-sdkmcpai-integration
Share:
3,439
Stars
0
Downloads
0
Weekly
0/5

What is Rust SDK?

Rust SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to official rust sdk for the model context protocol

The official Rust SDK for the Model Context Protocol

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • The official Rust SDK for the Model Context Protocol

Use Cases

Build MCP servers and clients using the official Rust SDK.
Develop high-performance MCP integrations in Rust.
LicenseNOASSERTION
Languagerust
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx rust-sdk

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Rust SDK

The RMCP crate is the official Rust SDK for the Model Context Protocol, providing a fully async, Tokio-based framework for building both MCP servers and clients in Rust. It supports all core MCP primitives — tools, resources, prompts, completions, subscriptions, and long-running tasks — with declarative procedural macros that eliminate boilerplate. Developers who need high-performance or low-overhead MCP integrations, such as embedded systems or latency-sensitive services, benefit most from this SDK.

Prerequisites

  • Rust toolchain (stable, 2021 edition or later) with Cargo
  • Tokio async runtime added as a dependency
  • Serde and Schemars crates for serialization and JSON Schema generation
  • An MCP-compatible client such as Claude Desktop to test your server
1

Add rmcp to your Cargo.toml

Add the rmcp crate with the features you need. Use the 'server' feature to build an MCP server, or 'client' to build a client.

[dependencies]
rmcp = { version = "0.16.0", features = ["server"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
2

Define your server struct and tools

Create a struct that represents your MCP server, then implement tool methods using the #[tool] and #[tool_router] macros. Each method annotated with #[tool] becomes a callable MCP tool.

use rmcp::{ServiceExt, tool, tool_router, transport::stdio};

#[derive(Clone)]
struct MyServer;

#[tool_router(server_handler)]
impl MyServer {
    #[tool(description = "Add two numbers together")]
    fn add(&self, a: i64, b: i64) -> String {
        (a + b).to_string()
    }
}
3

Start the server over stdio

In your main function, serve the struct over stdio transport so an MCP client such as Claude Desktop can launch and communicate with it as a subprocess.

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let service = MyServer.serve(stdio()).await?;
    service.waiting().await?;
    Ok(())
}
4

Build a release binary

Compile your MCP server to a standalone binary. The resulting binary in target/release/ is what you point Claude Desktop at.

cargo build --release
5

Configure Claude Desktop to launch your server

Edit your Claude Desktop configuration file to register the compiled binary as an MCP server. Replace the path with the actual path to your compiled binary.

Rust SDK Examples

Client configuration

Register your compiled Rust MCP server binary in Claude Desktop. Adjust the path to match where your binary was built.

{
  "mcpServers": {
    "my-rust-server": {
      "command": "/path/to/your/project/target/release/my-mcp-server",
      "args": []
    }
  }
}

Prompts to try

Once your Rust MCP server exposes tools, you can invoke them via your MCP client. These examples assume a server that exposes math and file tools.

- "Add 42 and 58 using the calculator tool"
- "List the resources available in this MCP server"
- "Call the echo tool with the message 'Hello from Rust'"

Troubleshooting Rust SDK

Compilation fails with missing feature flags

Ensure you have specified the correct features in Cargo.toml. For a server use features = ["server"]; for a client use features = ["client"]. Both can be combined.

Claude Desktop shows 'server disconnected' immediately

Verify the binary path in claude_desktop_config.json is absolute and the binary exists. Run the binary manually from a terminal to check for startup panics or missing environment variables.

JSON Schema errors when registering tools

rmcp requires schemars version compatible with JSON Schema 2020-12. Ensure your schemars dependency is at a recent version (0.8+) and that all tool parameter types derive JsonSchema.

Frequently Asked Questions about Rust SDK

What is Rust SDK?

Rust SDK is a Model Context Protocol (MCP) server that official rust sdk for the model context protocol It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Rust SDK?

Follow the installation instructions on the Rust SDK GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Rust SDK?

Rust SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Rust SDK free to use?

Yes, Rust SDK is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "rust-sdk": { "command": "npx", "args": ["-y", "rust-sdk"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Rust SDK?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides