Rust SDK
The official Rust SDK for the Model Context Protocol
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
Maintainer
Works with
Installation
Manual Installation
npx rust-sdkConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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"] }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()
}
}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(())
}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 --releaseConfigure 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.
Rust SDK Alternatives — Similar Developer Tools Servers
Looking for alternatives to Rust SDK? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Rust SDK in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.